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); } } } }