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 StaffEdit : 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 StaffEdit()
{
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()
{
NowProvince = OLDProvince = CurrentUser.Province;
NowCity = OLDCity = CurrentUser.City;
this.selStatus.DataSource = bll_Sys_DictionaryBLL.GetDataByType("员工在职状态");
this.selStatus.DataTextField = "Name";
this.selStatus.DataValueField = "Name";
this.DataBind();
Pagination pa = new Pagination();
pa.PageSize = 500;
pa.PageIndex = 1;
this.selDepartmentId.DataSource = bll_OA_DepartmentBll.SelectModelPage(pa, CurrentUser.MemberId, "", "启用");
this.selDepartmentId.DataTextField = "Name";
this.selDepartmentId.DataValueField = "Keyid";
this.selDepartmentId.DataBind();
this.selRole.DataSource = bll_OA_FirmRoleBLL.SelectList(CurrentUser.MemberId).Where(x=>x.IsUsed == true);
this.selRole.DataTextField = "RoleName";
this.selRole.DataValueField = "Keyid";
this.DataBind();
this.selRole.Items.Insert(0, new ListItem("请选择", ""));
this.aSM_IDCardPic.Visible = false;
this.txtName.Value = "";
this.selSex.SelectedIndex = 0;
this.txtStaffUserName.Value = "";
this.txtSM_Post.Value = "";
//this.IsBusinessManager.SelectedValue = "False";
//this.IsAccountManager.SelectedValue = "False";
//this.BF_IsDriver.SelectedValue = "False";
//this.BF_IsDeliverManage.SelectedValue = "False";
//this.BF_IsBaoxiaozhuguan.SelectedValue = "False";
//this.BF_Isbaoxiaojingli.SelectedValue = "False";
this.txtMobieNum.Value = "";
this.txtSM_Money.Value = "";
this.txtSM_Birthday.Value = "";
this.txtPhoneNum.Value = "";
this.txtQQ.Value = "";
this.txtEmail.Value = "";
this.RBLSM_IsContract.SelectedValue = "2";
this.trContract.Visible = false;
txtSM_ContractStartTime.Value = "";
txtSM_ContractEndTime.Value = "";
this.RBLSM_IsSocialSecurity.SelectedValue = "2";
this.trSocialSecurity1.Visible = false;
txtSM_SocialSecurityType.Value = "";
txtSM_SocialSecurityNumber.Value = "";
txtSM_SocialSecurityTime.Value = "";
trSocialSecurity2.Visible = false;
txtSM_SocialSecurityAllMoney.Value = "";
txtSM_SocialSecurityFirmMoney.Value = "";
txtSM_SocialSecuritySelfMoney.Value = "";
txtSM_SpouseName.Value = "";
txtSM_SpousePhone.Value = "";
txtSM_OldAdress.Value = "";
txtSM_NowAddress.Value = "";
//txtSM_IDCardNum.Value = "";
//txtSM_IDCardPic.Value = "";
//SM_CertificateType_xx.Value = "";
//ProductPics.Value = "";
txtSM_OtherLog.Value = "";
txtRemarks.Value = "";
}
//数据加载
public void InitData()
{
NowProvince = OLDProvince = CurrentUser.Province;
NowCity = OLDCity = CurrentUser.City;
this.selStatus.DataSource = bll_Sys_DictionaryBLL.GetDataByType("员工在职状态");
this.selStatus.DataTextField = "Name";
this.selStatus.DataValueField = "Name";
this.DataBind();
Pagination pa = new Pagination();
pa.PageSize = 500;
pa.PageIndex = 1;
this.selDepartmentId.DataSource = bll_OA_DepartmentBll.SelectModelPage(pa, CurrentUser.MemberId, "", "启用");
this.selDepartmentId.DataTextField = "Name";
this.selDepartmentId.DataValueField = "Keyid";
this.selDepartmentId.DataBind();
this.selRole.DataSource = bll_OA_FirmRoleBLL.SelectList(CurrentUser.MemberId).Where(x => x.IsUsed == true); ;
this.selRole.DataTextField = "RoleName";
this.selRole.DataValueField = "Keyid";
this.DataBind();
this.selRole.Items.Insert(0, new ListItem("请选择", ""));
this.aSM_IDCardPic.Visible = false;
if (Request["postid"].ToInt32() > 0 && Request["resumeid"].ToInt32() > 0)
{
OA_StaffResume m_OA_StaffResume = bll_OA_StaffResumeBLL.GetModelByKeyid(Request["resumeid"].ToInt32());
this.txtName.Value = m_OA_StaffResume.R_G_Name;
this.txtMobieNum.Value = m_OA_StaffResume.R_G_Moblie;
this.txtQQ.Value = m_OA_StaffResume.R_G_QQ;
this.txtEmail.Value = m_OA_StaffResume.R_G_Email;
this.selSex.Value = m_OA_StaffResume.R_G_Sex;
//this.IsBusinessManager.SelectedValue = "False";
//this.IsAccountManager.SelectedValue = "False";
//this.BF_IsDeliverManage.SelectedValue = "False";
//this.BF_IsBaoxiaozhuguan.SelectedValue = "False";
//this.BF_Isbaoxiaojingli.SelectedValue = "False";
//this.BF_IsDriver.SelectedValue = "False";
this.txtSM_Birthday.Value = m_OA_StaffResume.R_G_DocumentsType;
this.txtSM_IDCardNum.Value = m_OA_StaffResume.R_G_DocumentsNumber;
this.aSM_IDCardPic.Visible = false;
OLDProvince = m_OA_StaffResume.R_G_OldProvence.ToString2();
OLDCity = m_OA_StaffResume.R_G_OldCity.ToString2();
OLDCounty = m_OA_StaffResume.R_G_OldArea.ToString2();
this.txtSM_OldAdress.Value = m_OA_StaffResume.R_G_OldAdress.ToString2();
NowProvince = m_OA_StaffResume.R_G_NowProvince.ToString2();
NowCity = m_OA_StaffResume.R_G_NowCity.ToString2();
NowCounty = m_OA_StaffResume.R_G_NowArea.ToString2();
this.txtSM_NowAddress.Value = m_OA_StaffResume.R_G_NowAddress.ToString2();
}
else
{
OA_Staff m_OA_Staff = bll_OA_StaffBLL.GetModelByKeyid(Request["keyid"].ToInt32());
if (m_OA_Staff != null)
{
selRole.Disabled = false;
OA_StaffRoleRel m_OA_StaffRoleRel = bll_OA_FirmRoleBLL.SelectOA_StaffRoleRel(m_OA_Staff.Keyid);
if (m_OA_StaffRoleRel == null)
{
m_OA_StaffRoleRel = new OA_StaffRoleRel();
}
this.txtRemarks.Value = m_OA_Staff.Remark;
this.txtMobieNum.Value = m_OA_Staff.MobieNum;
this.txtPhoneNum.Value = m_OA_Staff.PhoneNum;
this.txtQQ.Value = m_OA_Staff.QQ;
this.txtEmail.Value = m_OA_Staff.Email;
this.selSex.Value = m_OA_Staff.Sex;
this.selStatus.Value = m_OA_Staff.Status;
this.selDepartmentId.Value = m_OA_Staff.DepartmentId.ToString2();
//this.IsBusinessManager.SelectedValue = m_OA_Staff.IsBusinessManager ? "True" : "False";
//this.IsAccountManager.SelectedValue = m_OA_Staff.IsAccountManager ? "True" : "False";
//this.BF_IsDeliverManage.SelectedValue = m_OA_Staff.BF_IsDeliverManage ? "True" : "False";
//this.BF_IsBaoxiaozhuguan.SelectedValue = m_OA_Staff.BF_IsBaoxiaozhuguan ? "True" : "False";
//this.BF_Isbaoxiaojingli.SelectedValue = m_OA_Staff.BF_Isbaoxiaojingli ? "True" : "False";
//this.BF_IsDriver.SelectedValue = m_OA_Staff.BF_IsDriver ? "True" : "False";
this.selRole.Value = m_OA_StaffRoleRel.RoleId.ToString2();
this.txtName.Style.Add("display", "none");
this.txtName.Disabled = true;
this.spanName.InnerText = m_OA_Staff.Name;
this.txtStaffUserName.Style.Add("display", "none");
this.txtStaffUserName.Disabled = true;
this.spanStaffUserName.InnerText = m_OA_Staff.StaffUserName;
this.txtSM_SpouseName.Value = m_OA_Staff.SM_SpouseName.ToString2();
this.txtSM_SpousePhone.Value = m_OA_Staff.SM_SpousePhone.ToString2();
this.txtSM_OtherLog.Value = m_OA_Staff.SM_OtherLog.ToString2();
this.txtSM_Post.Value = m_OA_Staff.SM_Post.ToString2();
this.txtSM_Money.Value = m_OA_Staff.SM_Money.ToString2();
this.RBLSM_IsSocialSecurity.SelectedValue = m_OA_Staff.SM_IsSocialSecurity.ToString2();
if (m_OA_Staff.SM_IsSocialSecurity == 1)
{
this.txtSM_SocialSecurityType.Value = m_OA_Staff.SM_SocialSecurityType.ToString2();
this.txtSM_SocialSecurityNumber.Value = m_OA_Staff.SM_SocialSecurityNumber.ToString2();
this.txtSM_SocialSecurityTime.Value = m_OA_Staff.SM_SocialSecurityTime.Value.ToString("yyyy-MM-dd");
this.txtSM_SocialSecurityAllMoney.Value = m_OA_Staff.SM_SocialSecurityAllMoney.Value.ToString("0.00");
this.txtSM_SocialSecurityFirmMoney.Value = m_OA_Staff.SM_SocialSecurityFirmMoney.Value.ToString("0.00");
this.txtSM_SocialSecuritySelfMoney.Value = m_OA_Staff.SM_SocialSecuritySelfMoney.Value.ToString("0.00");
this.trSocialSecurity1.Visible = true;
this.trSocialSecurity2.Visible = true;
this.trSocialSecurity1.Style.Add("display", "");
this.trSocialSecurity2.Style.Add("display", "");
}
else
{
}
this.RBLSM_IsContract.SelectedValue = m_OA_Staff.SM_IsContract.ToString2();
if (m_OA_Staff.SM_IsContract == 1)
{
this.txtSM_ContractStartTime.Value = m_OA_Staff.SM_ContractStartTime.Value.ToString("yyyy-MM-dd");
this.txtSM_ContractEndTime.Value = m_OA_Staff.SM_ContractEndTime.Value.ToString("yyyy-MM-dd");
this.trContract.Visible = true;
this.trContract.Style.Add("display","");
}
else
{
}
if (m_OA_Staff.SM_Birthday == null)
{
this.txtSM_Birthday.Value = "";
}
else
{
this.txtSM_Birthday.Visible = false;
this.spanSM_Birthday.InnerText = m_OA_Staff.SM_Birthday.Value.ToString("yyyy-MM-dd");
}
this.txtSM_IDCardNum.Value = m_OA_Staff.SM_IDCardNum.ToString2();
if (!string.IsNullOrEmpty(m_OA_Staff.SM_IDCardPic) && System.IO.File.Exists(HttpContext.Current.Server.MapPath("~" + m_OA_Staff.SM_IDCardPic)))
{
this.aSM_IDCardPic.HRef = m_OA_Staff.SM_IDCardPic.ToString2();
this.imgSM_IDCardPic.Src = m_OA_Staff.SM_IDCardPic.ToString2();
this.aSM_IDCardPic.Visible = true;
}
else
{
this.aSM_IDCardPic.Visible = false;
}
if (!string.IsNullOrEmpty(m_OA_Staff.SM_CertificateType.Trim(',')))
{
OldFileds = m_OA_Staff.SM_CertificateType.ToString2().Split(',');
NowFileds = m_OA_Staff.SM_CertificatePic.ToString2().Split(',');
}
OLDProvince = m_OA_Staff.SM_NowProvince.ToString2();
OLDCity = m_OA_Staff.SM_NowCity.ToString2();
OLDCounty = m_OA_Staff.SM_NowArea.ToString2();
this.txtSM_NowAddress.Value = m_OA_Staff.SM_NowAddress.ToString2();
NowProvince = m_OA_Staff.SM_OldProvence.ToString2();
NowCity = m_OA_Staff.SM_OldCity.ToString2();
NowCounty = m_OA_Staff.SM_OldArea.ToString2();
this.txtSM_OldAdress.Value = m_OA_Staff.SM_OldAdress.ToString2();
}
else
{
//this.IsBusinessManager.SelectedValue = "False";
//this.IsAccountManager.SelectedValue = "False";
//this.BF_IsDriver.SelectedValue = "False";
//this.BF_IsDeliverManage.SelectedValue = "False";
//this.BF_IsBaoxiaozhuguan.SelectedValue = "False";
//this.BF_Isbaoxiaojingli.SelectedValue = "False";
}
}
}
//提交事件
protected void btn_submit_form(object sender, EventArgs e)
{
try
{
if (this.RBLSM_IsContract.SelectedValue == "1")
{
if (string.IsNullOrEmpty(this.txtSM_Birthday.Value) && string.IsNullOrEmpty(Request["keyid"]))
{
JavaScript.MessageBox("请填写员工出生日期", this);
return;
}
if (string.IsNullOrEmpty(this.txtSM_ContractStartTime.Value) || string.IsNullOrEmpty(this.txtSM_ContractEndTime.Value))
{
JavaScript.MessageBox("此员工已签订合同请选择 合同签订时间 和 合同到期时间 ", this);
return;
}
else if (this.txtSM_ContractStartTime.Value.ToDateTime2() > this.txtSM_ContractEndTime.Value.ToDateTime2())
{
JavaScript.MessageBox("合同签订时间 不能大于 合同到期时间", this);
return;
}
else if (this.txtSM_ContractStartTime.Value.ToDateTime2() > DateTime.Now)
{
JavaScript.MessageBox("合同签订时间 不能大于 当前时间", this);
return;
}
}
if (this.RBLSM_IsSocialSecurity.SelectedValue == "1")
{
if (string.IsNullOrEmpty(this.txtSM_SocialSecurityType.Value) || string.IsNullOrEmpty(this.txtSM_SocialSecurityNumber.Value))
{
JavaScript.MessageBox("此员工已购买社保请填写 社保类型 和 社保卡号 ", this);
return;
}
}
DateTime nowTime = DateTime.Now;
OA_Staff m_OA_Staff = bll_OA_StaffBLL.GetModelByKeyid(Request["keyid"].ToInt32());
if (m_OA_Staff == null)
{
m_OA_Staff = new OA_Staff();
}
OA_StaffRoleRel m_OA_StaffRoleRel = bll_OA_FirmRoleBLL.SelectOA_StaffRoleRel(m_OA_Staff.Keyid);
if (m_OA_StaffRoleRel == null)
{
m_OA_StaffRoleRel = new OA_StaffRoleRel();
m_OA_Staff.SM_EndWorkStatus = 0;
m_OA_Staff.SM_EndWorkStartTime = nowTime;
m_OA_Staff.SM_EndWorkTime = nowTime;
m_OA_Staff.SM_EndWorkContent = "";
m_OA_Staff.SM_DepartmentHeads = "";
m_OA_Staff.SM_AdministrationDepartment = "";
m_OA_Staff.SM_MinistryFinance = "";
m_OA_Staff.SM_GeneralManager = "";
m_OA_Staff.SM_Degree = "";//学历
m_OA_Staff.SM_StartWorkTime = nowTime;//入职时间
m_OA_Staff.SM_Number = "0000";
m_OA_Staff.SM_IsImporting = 2;
m_OA_Staff.SM_IsDelete = 2;
m_OA_Staff.ManageProvince = "";
m_OA_Staff.ManageCity = "";
m_OA_Staff.ManageCountry = "";
}
m_OA_StaffRoleRel.RoleId = this.selRole.Value.ToInt32();
m_OA_Staff.Operator = CurrentUser.ShortName;
m_OA_Staff.LastUpdateTime = nowTime;
m_OA_Staff.Remark = this.txtRemarks.Value;
m_OA_Staff.MobieNum = this.txtMobieNum.Value;
m_OA_Staff.PhoneNum = this.txtPhoneNum.Value;
m_OA_Staff.QQ = this.txtQQ.Value;
m_OA_Staff.Email = this.txtEmail.Value;
m_OA_Staff.Sex = this.selSex.Value;
m_OA_Staff.Status = this.selStatus.Value;
if (this.selStatus.Value == "离职")
{
m_OA_Staff.SM_EndWorkTime = nowTime;
}
//m_OA_Staff.IsBusinessManager = this.IsBusinessManager.SelectedValue.ToBoolean2();
//m_OA_Staff.IsAccountManager = this.IsAccountManager.SelectedValue.ToBoolean2();
//m_OA_Staff.BF_IsDeliverManage = this.BF_IsDeliverManage.SelectedValue.ToBoolean2();
//m_OA_Staff.BF_IsBaoxiaozhuguan = this.BF_IsBaoxiaozhuguan.SelectedValue.ToBoolean2();
//m_OA_Staff.BF_Isbaoxiaojingli = this.BF_Isbaoxiaojingli.SelectedValue.ToBoolean2();
//m_OA_Staff.BF_IsDriver = this.BF_IsDriver.SelectedValue.ToBoolean2();
m_OA_Staff.DepartmentId = this.selDepartmentId.Value.ToInt32();
m_OA_Staff.SM_SpouseName = this.txtSM_SpouseName.Value.ToString2();
m_OA_Staff.SM_SpousePhone = this.txtSM_SpousePhone.Value.ToString2();
m_OA_Staff.SM_OtherLog = this.txtSM_OtherLog.Value.ToString2();
m_OA_Staff.SM_Post = this.txtSM_Post.Value.ToString2();
m_OA_Staff.SM_Money = this.txtSM_Money.Value.ToString2();
m_OA_Staff.SM_IsSocialSecurity = this.RBLSM_IsSocialSecurity.SelectedValue.ToInt32();
m_OA_Staff.SM_SocialSecurityType = this.txtSM_SocialSecurityType.Value.ToString2();
m_OA_Staff.SM_SocialSecurityNumber = this.txtSM_SocialSecurityNumber.Value.ToString2();
m_OA_Staff.SM_SocialSecurityTime = this.txtSM_SocialSecurityTime.Value.ToDateTime2() ?? DateTime.Now;
m_OA_Staff.SM_SocialSecurityAllMoney = this.txtSM_SocialSecurityAllMoney.Value.ToDecimal2() ?? 0;
m_OA_Staff.SM_SocialSecurityFirmMoney = this.txtSM_SocialSecurityFirmMoney.Value.ToDecimal2() ?? 0;
m_OA_Staff.SM_SocialSecuritySelfMoney = this.txtSM_SocialSecuritySelfMoney.Value.ToDecimal2() ?? 0;
m_OA_Staff.SM_IsContract = this.RBLSM_IsContract.SelectedValue.ToInt32();
m_OA_Staff.SM_ContractStartTime = this.txtSM_ContractStartTime.Value.ToDateTime2() ?? nowTime;
m_OA_Staff.SM_ContractEndTime = this.txtSM_ContractEndTime.Value.ToDateTime2() ?? nowTime;
m_OA_Staff.SM_Birthday = this.txtSM_Birthday.Value.ToDateTime2() ?? nowTime;
m_OA_Staff.SM_IDCardNum = this.txtSM_IDCardNum.Value.ToString2();
//身份证图片
CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult0 = CY.WebForm.cs.UploadCS.Upload("txtSM_IDCardPic", m_OA_Staff.SM_IDCardPic);
m_OA_Staff.SM_IDCardPic = m_OA_Staff.SM_IDCardPic ?? "";
if (_UpFileResult0.returnerror.Count == 0)
{
if (_UpFileResult0.returnfilename.Count > 0)
m_OA_Staff.SM_IDCardPic = _UpFileResult0.returnfilename[0].ToString2();
}
else
{
JavaScript.MessageBox(string.Join("
", (string[])_UpFileResult0.returnerror.ToArray(typeof(string))), this);
return;
}
CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult_o = CY.WebForm.cs.UploadCS.Upload("ProductPics", "");
if (_UpFileResult_o.returnerror.Count == 0)
{
ArrayList _Arr = new ArrayList();
ArrayList _Arr_o = new ArrayList();
string[] aaa = (Request.Form["OldProductPics"] ?? "").Split(',');
string[] bbb = (Request.Form["OldSM_CertificatePic"] ?? "").Split(',');
string[] ccc = (Request.Form["OldSM_CertificateType"] ?? "").Split(',');
string[] ddd = (Request.Form["SM_CertificateType_xx"] ?? "").Split(',');
if (aaa != null && aaa.Length > 0)
{
for (int i = 0; i < aaa.Length; i++)
{
_Arr.Add(bbb[aaa[i].ToInt32() ?? 0]);
_Arr_o.Add(ccc[aaa[i].ToInt32() ?? 0]);
}
}
_Arr.AddRange(_UpFileResult_o.returnfilename);
m_OA_Staff.SM_CertificatePic = string.Join(",", (string[])_Arr.ToArray(typeof(string)));
if (_Arr_o.Count > 0 && ddd.Length > 0)
{
m_OA_Staff.SM_CertificateType = string.Join(",", (string[])_Arr_o.ToArray(typeof(string))) + "," + string.Join(",", ddd);
}
else if (_Arr_o.Count > 0)
{
m_OA_Staff.SM_CertificateType = string.Join(",", (string[])_Arr_o.ToArray(typeof(string)));
}
else if (ddd.Length > 0)
{
m_OA_Staff.SM_CertificateType = string.Join(",", ddd);
}
}
else
{
JavaScript.MessageBox(string.Join("
", (string[])_UpFileResult0.returnerror.ToArray(typeof(string))), this);
return;
}
m_OA_Staff.SM_OldProvence = Request["selectProvince#OldAddress"].ToString2();
m_OA_Staff.SM_OldCity = Request["selectCity#OldAddress"].ToString2();
m_OA_Staff.SM_OldArea = Request["selectCounty#OldAddress"].ToString2();
m_OA_Staff.SM_OldAdress = this.txtSM_OldAdress.Value.ToString2();
m_OA_Staff.SM_NowProvince = Request["selectProvince#NowAddress"].ToString2();
m_OA_Staff.SM_NowCity = Request["selectCity#NowAddress"].ToString2();
m_OA_Staff.SM_NowArea = Request["selectCounty#NowAddress"].ToString2();
m_OA_Staff.SM_NowAddress = this.txtSM_NowAddress.Value.ToString2();
m_OA_Staff.MobieNum = this.txtMobieNum.Value.ToString2();
m_OA_Staff.QQ = this.txtQQ.Value.ToString2();
m_OA_Staff.PhoneNum = this.txtPhoneNum.Value.ToString2();
if (Request["keyid"].ToInt32() > 0)
{
EC_MemberBasic m_EC_MemberBasic = bll_EC_MemberBasicBLL.GetMemberByMemberId(m_OA_Staff.MemberId);
switch (this.selStatus.Value)
{
case "在职":
m_EC_MemberBasic.UseState = 3; //未审核0,已到期1,已锁定2,正常3,已注销4
break;
case "审核中":
m_EC_MemberBasic.UseState = 2; //未审核0,已到期1,已锁定2,正常3,已注销4
break;
case "离职":
m_EC_MemberBasic.UseState = 4; //未审核0,已到期1,已锁定2,正常3,已注销4
break;
default:
break;
}
if (bll_OA_StaffBLL.UpdateStaff(m_OA_Staff, m_EC_MemberBasic, m_OA_StaffRoleRel))
JavaScript.MessageBox("操作成功", this, "top.frmright.ReLoad();top.Dialog.close();");
else
JavaScript.MessageBox("操作失败", this);
}
else
{
Guid newGuid = Guid.NewGuid();
EC_MemberBasic m_EC_MemberBasic = new EC_MemberBasic();
m_EC_MemberBasic.MemberId = newGuid;
m_EC_MemberBasic.MemberType = "员工";
m_EC_MemberBasic.Name = this.txtName.Value;
m_EC_MemberBasic.ShortName = this.txtName.Value;
m_EC_MemberBasic.LoginId = this.txtStaffUserName.Value;
m_EC_MemberBasic.Password = DESEncrypt.Encrypt("123456+");
m_EC_MemberBasic.Province = CurrentUser.Province;
m_EC_MemberBasic.City = CurrentUser.City;
m_EC_MemberBasic.County = CurrentUser.County;
m_EC_MemberBasic.bid = -3;
m_EC_MemberBasic.bdomainname = "";
m_EC_MemberBasic.bstenciid = 0;
switch (this.selStatus.Value)
{
case "在职":
m_EC_MemberBasic.UseState = 3; //未审核0,已到期1,已锁定2,正常3,已注销4
break;
case "审核中":
m_EC_MemberBasic.UseState = 2; //未审核0,已到期1,已锁定2,正常3,已注销4
break;
case "离职":
m_EC_MemberBasic.UseState = 4; //未审核0,已到期1,已锁定2,正常3,已注销4
break;
default:
break;
}
m_EC_MemberBasic.PayId = 1;
m_EC_MemberBasic.ExpirationTime = nowTime;
m_EC_MemberBasic.Remark = "";
m_EC_MemberBasic.RegisterDate = nowTime;
m_EC_MemberBasic.RegisteredIp = DNTRequest.GetIP();
m_EC_MemberBasic.LastLoginDate = nowTime;
m_EC_MemberBasic.LastIp = DNTRequest.GetIP();
m_EC_MemberBasic.LastUpdateTime = nowTime;
m_EC_MemberBasic.Operator = this.txtName.Value;
m_EC_MemberBasic.InquiryId = CurrentUser.InquiryId;
m_EC_MemberBasic.CustomStenc = "";
m_OA_Staff.StaffUserName = this.txtStaffUserName.Value;
m_OA_Staff.StaffUserPwd = DESEncrypt.Encrypt("123456+");
m_OA_Staff.FirmId = CurrentUser.MemberId;
m_OA_Staff.Name = this.txtName.Value;
m_OA_Staff.MemberId = m_EC_MemberBasic.MemberId;
m_OA_Staff.ManageProvince = "";
m_OA_Staff.ManageCity = "";
m_OA_Staff.ManageCountry = "";
m_OA_Staff.ManageCountry1 = "";
m_OA_StaffRoleRel.StaffId = 0;
m_OA_StaffRoleRel.FirmId = CurrentUser.MemberId;
if (Request["postid"].ToInt32() > 0 && Request["resumeid"].ToInt32() > 0)
{
OA_StaffPostLog m_OA_StaffPostLog = bll_OA_StaffPostLogBLL.GetModelByKeyid(Request["postid"].ToInt32());
m_OA_StaffPostLog.PL_Status = 5;
m_OA_StaffPostLog.PL_LookTime = DateTime.Now;
m_OA_StaffPostLog.LastUpdateTime = DateTime.Now;
m_OA_StaffPostLog.Operator = CurrentUser.ShortName;
bll_OA_StaffPostLogBLL.UpdateModel(m_OA_StaffPostLog);
}
if (bll_OA_StaffBLL.AddStaff(m_OA_Staff, m_EC_MemberBasic, m_OA_StaffRoleRel))
{
if (Request["postid"].ToInt32() > 0 && Request["resumeid"].ToInt32() > 0)
{
JavaScript.MessageBox("导入成功", this, "top.frmright.ReLoad();top.Dialog.close();");
}
else
{
this.ClearData();
JavaScript.MessageBox("操作成功", this, false, true);
}
}
else
JavaScript.MessageBox("新增失败", this);
}
}
catch (Exception ex)
{
PAGEHandleException(ex);
JavaScript.MessageBox("更新失败", this);
}
}
}
}