1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using CY.Model;
using CY.BLL;
using CY.Infrastructure.Common;
using CY.Infrastructure.Query;
 
namespace CY.WebForm.Pages.personnel
{
    //吴辉
    //新增/修改招聘公司信息表    
    public partial class OA_StaffFirmProfileAdd : BasePage
    {
        OA_StaffFirmProfileBLL bll_OA_StaffFirmProfileBLL = null;
        EC_MemberBasicBLL bll_EC_MemberBasicBLL = null;
        public string Province = ""; //接收值 Request["selectProvince"].ToString2();
        public string City = "";//接收值 Request["selectCity"].ToString2();
        public string County = "";//接收值 Request["selectCounty"].ToString2();
 
        //初始化
        public OA_StaffFirmProfileAdd()
        {
            bll_OA_StaffFirmProfileBLL = new OA_StaffFirmProfileBLL();
            bll_EC_MemberBasicBLL = new EC_MemberBasicBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }
 
        //数据加载
        public void InitData()
        {
            OA_StaffFirmProfile m_OA_StaffFirmProfile = bll_OA_StaffFirmProfileBLL.GetModelByFirmId(CurrentUser.MemberId);
            if (m_OA_StaffFirmProfile != null)
            {
                Province = m_OA_StaffFirmProfile.MP_Province.ToString2();
                City = m_OA_StaffFirmProfile.MP_City.ToString2();
                County = m_OA_StaffFirmProfile.MP_Area.ToString2();
                this.txtMP_PostNumber.Value = m_OA_StaffFirmProfile.MP_PostNumber.ToString2();
                this.txtMP_CompanyName.Value = m_OA_StaffFirmProfile.MP_CompanyName.ToString2();
                this.txtMP_ResumeIndustry.Value = m_OA_StaffFirmProfile.MP_ResumeIndustry.ToString2();
                this.txtMP_ResumePlace.Value = m_OA_StaffFirmProfile.MP_ResumePlace.ToString2();
                this.txtMP_ResumePeople.Value = m_OA_StaffFirmProfile.MP_ResumePeople.ToString2();
                this.txtMP_ResumePhone.Value = m_OA_StaffFirmProfile.MP_ResumePhone.ToString2();
                this.txtMP_ResumeCarWay.Value = m_OA_StaffFirmProfile.MP_ResumeCarWay.ToString2();
                this.txtMP_CompanyWebsite.Value = m_OA_StaffFirmProfile.MP_CompanyWebsite.ToString2();
                this.txtRemark.Text = m_OA_StaffFirmProfile.Remark.ToString2();
            }
            else
            {
                EC_FirmInfo m_EC_FirmInfo = bll_EC_MemberBasicBLL.GetFirmInfoByMemberId(CurrentUser.MemberId);
                Province = CurrentUser.Province;
                City = CurrentUser.City;
                County = CurrentUser.County;
                this.txtMP_PostNumber.Value = CurrentMemberExtend.Postcode;
                this.txtMP_CompanyName.Value = CurrentUser.Name;
                this.txtMP_ResumePlace.Value = CurrentMemberExtend.DetailedAddress;
                this.txtMP_ResumePeople.Value = CurrentMemberExtend.BusinessContacts;
                this.txtMP_ResumePhone.Value = CurrentMemberExtend.PhoneNum;
                this.txtMP_CompanyWebsite.Value = "http://" + CurrentUser.bdomainname;
                if (m_EC_FirmInfo != null)
                {
                    this.txtRemark.Text = m_EC_FirmInfo.FirmDescribe;
                }
            }
        }
 
        //表单提交
        protected void btn_submit_form(object sender, EventArgs e)
        {
            try
            {
                DateTime nowTime = DateTime.Now;
                OA_StaffFirmProfile m_OA_StaffFirmProfile = bll_OA_StaffFirmProfileBLL.GetModelByFirmId(CurrentUser.MemberId);
                if (m_OA_StaffFirmProfile == null)
                {
                    m_OA_StaffFirmProfile = new OA_StaffFirmProfile();
                }
 
                m_OA_StaffFirmProfile.FirmId = CurrentUser.MemberId;
                m_OA_StaffFirmProfile.MP_Province = Request["selectProvince"].ToString2();
                m_OA_StaffFirmProfile.MP_City = Request["selectCity"].ToString2();
                m_OA_StaffFirmProfile.MP_Area = Request["selectCounty"].ToString2();
                m_OA_StaffFirmProfile.MP_PostNumber = this.txtMP_PostNumber.Value.ToString2();
                m_OA_StaffFirmProfile.MP_CompanyName = this.txtMP_CompanyName.Value.ToString2();
                m_OA_StaffFirmProfile.MP_ResumeIndustry = this.txtMP_ResumeIndustry.Value.ToString2();
                m_OA_StaffFirmProfile.MP_ResumePlace = this.txtMP_ResumePlace.Value.ToString2();
                m_OA_StaffFirmProfile.MP_ResumePeople = this.txtMP_ResumePeople.Value.ToString2();
                m_OA_StaffFirmProfile.MP_ResumePhone = this.txtMP_ResumePhone.Value.ToString2();
                m_OA_StaffFirmProfile.MP_ResumeCarWay = this.txtMP_ResumeCarWay.Value.ToString2();
                m_OA_StaffFirmProfile.MP_CompanyWebsite = this.txtMP_CompanyWebsite.Value.ToString2();
                m_OA_StaffFirmProfile.LastUpdateTime = DateTime.Now;
                m_OA_StaffFirmProfile.Operator = CurrentUser.ShortName;
                m_OA_StaffFirmProfile.Remark = this.txtRemark.Text.ToString2();
 
                if (m_OA_StaffFirmProfile.Keyid > 0)
                {
                    if (bll_OA_StaffFirmProfileBLL.UpdateModel(m_OA_StaffFirmProfile))
                        JavaScript.MessageBox("保存成功", this, true, true);
                    else
                        JavaScript.MessageBox("保存失败", this);
                }
                else
                {
                    if (bll_OA_StaffFirmProfileBLL.InsertModel(m_OA_StaffFirmProfile))
                        JavaScript.MessageBox("保存成功", this, true, true);
                    else
                        JavaScript.MessageBox("保存失败", this);
                }
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("操作失败", this);
            }
        }
    }
}