using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.Model; using CY.BLL; using CY.Infrastructure.Common; using CY.BLL.Sys; using CY.BLL.EC; using CY.Infrastructure.DESEncrypt; using CY.Infrastructure.Query; using System.Collections; namespace CY.WebForm.Pages.personnel { //吴辉 //员工详情 public partial class StaffQuanxianshezhi : BasePage { OA_StaffBLL bll_OA_StaffBLL = null; Sys_DictionaryBLL bll_Sys_DictionaryBLL = null; EC_MemberBasicBLL bll_EC_MemberBasicBLL = null; OA_FirmRoleBLL bll_OA_FirmRoleBLL = null; OA_DepartmentBll bll_OA_DepartmentBll = null; OA_StaffResumeBLL bll_OA_StaffResumeBLL = null; OA_StaffPostLogBLL bll_OA_StaffPostLogBLL = null; public string OLDProvince = ""; //接收值 Request["selectProvince"].ToString2(); public string OLDCity = "";//接收值 Request["selectCity"].ToString2(); public string OLDCounty = "";//接收值 Request["selectCounty"].ToString2(); public string NowProvince = ""; //接收值 Request["selectProvince"].ToString2(); public string NowCity = "";//接收值 Request["selectCity"].ToString2(); public string NowCounty = "";//接收值 Request["selectCounty"].ToString2(); public string ManageProvince = ""; //接收值 Request["selectProvince"].ToString2(); public string ManageCity = "";//接收值 Request["selectCity"].ToString2(); public string ManageCounty = "";//接收值 Request["selectCounty"].ToString2(); public string[] OldFileds; public string[] NowFileds; //初始化 public StaffQuanxianshezhi() { bll_OA_StaffBLL = new OA_StaffBLL(); bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); bll_EC_MemberBasicBLL = new EC_MemberBasicBLL(); bll_OA_FirmRoleBLL = new OA_FirmRoleBLL(); bll_OA_DepartmentBll = new OA_DepartmentBll(); bll_OA_StaffResumeBLL = new OA_StaffResumeBLL(); bll_OA_StaffPostLogBLL = new OA_StaffPostLogBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitData(); } } public void ClearData() { } //数据加载 public void InitData() { var keyid = Request["keyid"]; var type = Request["type"]; OA_Staff m_OA_Staff = bll_OA_StaffBLL.GetModelByKeyid(Request["keyid"].ToInt32()); if (m_OA_Staff != null) { if (type.ToInt32() == 1) { this.types.InnerText = "业务经理:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.IsBusinessManager ? "True" : "False"; } else if (type.ToInt32() == 2) { this.types.InnerText = "客户经理:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.IsAccountManager ? "True" : "False"; } else if (type.ToInt32() == 3) { this.types.InnerText = "司机:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.BF_IsDriver ? "True" : "False"; } else if (type.ToInt32() == 4) { this.types.InnerText = "配送权限:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.BF_IsDeliverManage ? "True" : "False"; } else if (type.ToInt32() == 5) { this.types.InnerText = "报销主管:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.BF_IsBaoxiaozhuguan ? "True" : "False"; } else if (type.ToInt32() == 6) { this.types.InnerText = "报销经理:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.BF_Isbaoxiaojingli ? "True" : "False"; } else if (type.ToInt32() == 7) { this.types.InnerText = "公文权限:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.BF_IsGongwen.HasValue&&m_OA_Staff.BF_IsGongwen.Value ? "True" : "False"; } else if (type.ToInt32() == 8) { this.types.InnerText = "常用资料权限:"; this.IsBusinessManager.SelectedValue = m_OA_Staff.BF_IsChangyongziliao.HasValue&& m_OA_Staff.BF_IsChangyongziliao.Value ? "True" : "False"; } } } //提交事件 protected void btn_submit_form(object sender, EventArgs e) { try { var keyid = Request["keyid"]; var type = Request["type"]; OA_Staff m_OA_Staff = bll_OA_StaffBLL.GetModelByKeyid(Request["keyid"].ToInt32()); if (type.ToInt32() == 1) { m_OA_Staff.IsBusinessManager = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 2) { m_OA_Staff.IsAccountManager = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 3) { m_OA_Staff.BF_IsDriver = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 4) { m_OA_Staff.BF_IsDeliverManage = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 5) { m_OA_Staff.BF_IsBaoxiaozhuguan = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 6) { m_OA_Staff.BF_Isbaoxiaojingli = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 7) { m_OA_Staff.BF_IsGongwen = this.IsBusinessManager.SelectedValue.ToBoolean2(); } else if (type.ToInt32() == 8) { m_OA_Staff.BF_IsChangyongziliao = this.IsBusinessManager.SelectedValue.ToBoolean2(); } if (bll_OA_StaffBLL.UpdateModel(m_OA_Staff)) JavaScript.MessageBox("操作成功", this,true,true); else JavaScript.MessageBox("操作失败", this); } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("更新失败", this); } } } }