| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_HR_0202.cs
- * 2.功能描述:新建/编辑员工入职
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王鑫 2014/09/12 1.00 新建
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Windows.Forms;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.DataModels;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- using Dongke.IBOSS.PRD.WCF.Proxys.HRModuleService;
- namespace Dongke.IBOSS.PRD.Client.HRModule
- {
- /// <summary>
- /// 新建/编辑员工入职
- /// </summary>
- public partial class F_HR_0202 : FormBase
- {
- #region 成员变量
- // 页面传过来员工ID
- private int _staffID;
- // 页面传过来员工编码
- private string _staffCode;
- // 性别
- private string _gender;
- // 婚姻情况
- private string _maritalstatus;
- // 民族
- private string _nationalname;
- // 学历
- private string _educational;
- // 编辑状态
- private Constant.FormMode _editStatus;
- // 新建的员工ID集合
- private List<int> _staffIDList = new List<int>();
- // 时间戳
- private DateTime _optimestamp;
- //组织机构
- private string _organizationcode;
- // 员工履历实体类
- private StaffRecordEntity _staffRecordEntity;
- // 员工履历表ID
- private int _staffrecordID;
- // 图片字节集
- private List<byte[]> _PicByte = new List<byte[]>();
- // 缩略图节集
- private List<byte[]> _smallByte = new List<byte[]>();
- // 图片实体集合
- private List<StaffPhotoEntity> _imgList = new List<StaffPhotoEntity>();
- #endregion
- #region 构造函数
- public F_HR_0202()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="frmStatus">窗体状态</param>
- public F_HR_0202(Constant.FormMode frmStatus)
- {
- InitializeComponent();
- _editStatus = frmStatus;
- this.dkStaffName.WhereCondition = "StaffStatus in(0,3) and ValueFlag=1";
- this.dkApplicant.WhereCondition = "StaffStatus in(0,3) and ValueFlag=1";
- // 设置窗口标题,当为新建状态时显示新建员工,当为编辑状态时显示编辑员工
- if (frmStatus == Constant.FormMode.Add)
- {
- this.Text = FormTitles.F_HR_0202_ADD;
- }
- else if (frmStatus == Constant.FormMode.Edit)
- {
- this.Text = FormTitles.F_HR_0202_EDIT;
- }
- // 工具栏按钮文本赋值
- this.btnSave.Text = ButtonText.BTN_SAVE;
- this.btnCancel.Text = ButtonText.BTN_CLOSE;
- }
- #endregion
- #region 属性
- /// <summary>
- /// 页面传过来的员工ID
- /// </summary>
- public int StaffID
- {
- get
- {
- return this._staffID;
- }
- set
- {
- this._staffID = value;
- }
- }
- /// <summary>
- /// 页面传过来的员工ID
- /// </summary>
- public string StaffCode
- {
- get
- {
- return this._staffCode;
- }
- set
- {
- this._staffCode = value;
- }
- }
- /// <summary>
- /// 性别
- /// </summary>
- public string Gender
- {
- get
- {
- return this._gender;
- }
- set
- {
- this._gender = value;
- }
- }
- /// <summary>
- /// 婚姻状况
- /// </summary>
- public string MaritalStatus
- {
- get
- {
- return this._maritalstatus;
- }
- set
- {
- this._maritalstatus = value;
- }
- }
- /// <summary>
- /// 民族
- /// </summary>
- public string NationalName
- {
- get
- {
- return this._nationalname;
- }
- set
- {
- this._nationalname = value;
- }
- }
- /// <summary>
- /// 学历
- /// </summary>
- public string Educational
- {
- get
- {
- return this._educational;
- }
- set
- {
- this._educational = value;
- }
- }
- /// <summary>
- /// 时间戳
- /// </summary>
- public DateTime OPTimeStamp
- {
- get
- {
- return _optimestamp;
- }
- set
- {
- _optimestamp = value;
- }
- }
- /// <summary>
- /// 当前用户组织机构Code
- /// </summary>
- public string OrganizationCode
- {
- get
- {
- return _organizationcode;
- }
- set
- {
- _organizationcode = value;
- }
- }
- /// <summary>
- /// 员工履历表ID
- /// </summary>
- public int StaffRecordID
- {
- get
- {
- return this._staffrecordID;
- }
- set
- {
- this._staffrecordID = value;
- }
- }
- /// <summary>
- /// 员工ID集合
- /// </summary>
- public List<int> StaffIDList
- {
- get
- {
- return _staffIDList;
- }
- set
- {
- _staffIDList = value;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_HR_0104_Load(object sender, EventArgs e)
- {
- try
- {
- // 加载权限
- FormPermissionManager.FormPermissionControl(this.Name, this,
- LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData, LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- #region 绑定工种职务数据源
- this.dropJobs.DisplayMember = "JOBSNAME";
- this.dropJobs.ValueMember = "JOBSID";
- this.dropJobs.DataSource = (DataTable)DoAsync(new BaseAsyncMethod(this.GetJobsData));
- this.droppost.DisplayMember = "POSTNAME";
- this.droppost.ValueMember = "POSTID";
- this.droppost.DataSource = (DataTable)DoAsync(new BaseAsyncMethod(this.GetPostData));
- #endregion
- #region 获取员工履历表数据, 编辑的时候去查,新增的时候不会调用
- if (this._editStatus == Constant.FormMode.Edit)
- {
- DataSet dsStaffRecord = (DataSet)DoAsync(new BaseAsyncMethod(this.GetStaffRecorsRowData));
- if (dsStaffRecord != null && dsStaffRecord.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
- {
- this.dkStaffName.UserID = Convert.ToInt32(dsStaffRecord.Tables[0].Rows[0]["StaffID"]);
- this.dkStaffName.UserCode = dsStaffRecord.Tables[0].Rows[0]["StaffCode"].ToString();
- this.dkStaffName.Text = dsStaffRecord.Tables[0].Rows[0]["StaffName"].ToString();
- //this.dkOrganizationSearch.Text = dsStaffRecord.Tables[0].Rows[0]["organizationname"].ToString();
- //this.dkOrganizationSearch.OrganizationID = Convert.ToInt32(dsStaffRecord.Tables[0].Rows[0]["OriginalOrganizationID"]);
- scbOrganization.InitValue(dsStaffRecord.Tables[0].Rows[0]["organizationname"].ToString().Trim()
- , Convert.ToInt32(dsStaffRecord.Tables[0].Rows[0]["OriginalOrganizationID"]));
- this.dropJobs.SelectedValue = dsStaffRecord.Tables[0].Rows[0]["OriginalJobs"].ToString();
- this.droppost.SelectedValue = dsStaffRecord.Tables[0].Rows[0]["OriginalPost"].ToString();
- this.txtPause.Text = dsStaffRecord.Tables[0].Rows[0]["Reason"].ToString();
- this.txtSuggestion.Text = dsStaffRecord.Tables[0].Rows[0]["Suggestion"].ToString();
- string ExProbationEndDate = dsStaffRecord.Tables[0].Rows[0]["ExProbationEndDate"].ToString();
- this.OPTimeStamp = Convert.ToDateTime(dsStaffRecord.Tables[0].Rows[0]["OPTimeStamp"]);
- if (ExProbationEndDate != string.Empty)
- {
- chkExProbationEndDate.Checked = true;
- dateExProbationEndDate.Value = Convert.ToDateTime(dsStaffRecord.Tables[0].Rows[0]["ExProbationEndDate"]);
- }
- this.txtRecordRemarks.Text = dsStaffRecord.Tables[0].Rows[0]["Remarks"].ToString();
- this.dkApplicant.Text = dsStaffRecord.Tables[0].Rows[0]["ApplicantName"].ToString();
- this.dkApplicant.UserID = Convert.ToInt32(dsStaffRecord.Tables[0].Rows[0]["Applicant"]);
- string ApprovalStatus = dsStaffRecord.Tables[0].Rows[0]["ApprovalStatus"].ToString();
- if (ApprovalStatus != Constant.INT_IS_ZERO.ToString())//非待审批
- {
- //设置非待审核的履历控件禁用
- SetControlEnable();
- }
- }
- else
- {
- //设置非待审核的履历控件禁用
- SetControlEnable();
- }
- }
- #endregion
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 试用选择按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void chkExProbationEndDate_CheckedChanged(object sender, EventArgs e)
- {
- if (chkExProbationEndDate.Checked)
- {
- dateExProbationEndDate.Enabled = true;
- }
- else
- {
- dateExProbationEndDate.Enabled = false;
- }
- }
- /// <summary>
- /// 保存按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- // 验证输入是否正确
- if (!this.CheckInputValidity())
- {
- return;
- }
- this._staffRecordEntity = this.SetStaffRecordEntity();//获取员工履历实体
- if (this._editStatus == Constant.FormMode.Add)
- {
- // 新建员工入职
- this.btnSave.Enabled = false;
- this.btnCancel.Enabled = false;
- HRResultEntity returnStaff = (HRResultEntity)DoAsync(new BaseAsyncMethod(this.AddStaffRecord));
- this.btnSave.Enabled = true;
- this.btnCancel.Enabled = true;
- if (returnStaff.OperateStatus > Constant.INT_IS_ZERO)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "新建员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this._staffIDList.Add(returnStaff.HRStaffRecordID);
- this.Close();
- this.InitializationForm();//清空输入项
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_ONE)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W006, "新建员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_TWO)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W007, "新建员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_THREE)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W007, "新建员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_FOUR)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W008, "预试用结束日期"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "新建员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- else
- {
- // 编辑员工入职
- this.btnSave.Enabled = false;
- this.btnCancel.Enabled = false;
- this._staffRecordEntity.StaffRecordID = StaffRecordID;
- HRResultEntity returnStaff = (HRResultEntity)DoAsync(new BaseAsyncMethod(this.EditStaffRecord));
- this.btnSave.Enabled = true;
- this.btnCancel.Enabled = true;
- if (returnStaff.OperateStatus > Constant.INT_IS_ZERO)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "编辑员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
- this._staffIDList.Add(returnStaff.HRStaffRecordID);
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_ONE)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W006, "编辑员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_TWO)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W007, "编辑员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_THREE)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W007, "编辑员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_FOUR)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_HR_W008, "预试用结束日期"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "编辑员工入职", "保存"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- }
- catch (Exception ex)
- {
- this.btnSave.Enabled = true;
- this.btnCancel.Enabled = true;
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 取消按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnCancel_Click(object sender, EventArgs e)
- {
- if (this._staffIDList != null && this._staffIDList.Count > 0)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- else
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 获取员工基本数据
- /// </summary>
- /// <returns></returns>
- private DataSet GetRowData()
- {
- DataSet returnRowData = null;
- try
- {
- returnRowData = HRModuleProxy.Service.GetRowData(StaffID);
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- return returnRowData;
- }
- /// <summary>
- /// 获取工种数据
- /// </summary>
- /// <returns></returns>
- private DataTable GetJobsData()
- {
- DataTable returntJobsData = null;
- try
- {
- returntJobsData = SystemModuleProxy.Service.GetJobsData(0).Tables[0];
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- return returntJobsData;
- }
- /// <summary>
- /// 获取职务数据
- /// </summary>
- /// <returns></returns>
- private DataTable GetPostData()
- {
- DataTable returntPostData = null;
- try
- {
- returntPostData = SystemModuleProxy.Service.GetPostData(0).Tables[0];
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- return returntPostData;
- }
- /// <summary>
- /// 获取当前职工基本数据
- /// </summary>
- /// <returns></returns>
- private DataSet GetUserRowData()
- {
- DataSet returntUserRowData = null;
- try
- {
- returntUserRowData = SystemModuleProxy.Service.GetUserRowData(LogInUserInfo.CurrentUser.CurrentUserEntity.UserID);
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- return returntUserRowData;
- }
- /// <summary>
- /// 获取当前职工履历基本数据
- /// </summary>
- /// <returns></returns>
- private DataSet GetStaffRecorsRowData()
- {
- DataSet returntStaffRecorsRowData = null;
- try
- {
- returntStaffRecorsRowData = HRModuleProxy.Service.GetStaffRecorsRowData(StaffRecordID);
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- return returntStaffRecorsRowData;
- }
- /// <summary>
- /// 验证输入格式是否正确
- /// </summary>
- /// <returns></returns>
- private bool CheckInputValidity()
- {
- //入职员工
- if (this.dkStaffName.UserID == null)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "员工姓名"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.dkStaffName.Focus();
- return false;
- }
- //所属部门
- if (this.scbOrganization.SearchedPKMember == 0)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "所属部门"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.scbOrganization.Focus();
- return false;
- }
- //申请人
- if (this.dkStaffName.UserID == null)
- {
- if (this.dkApplicant.UserID == null)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "申请人"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.dkApplicant.Focus();
- return false;
- }
- }
- //工号
- //if (this.dkOriginalUserCode.UserID == null)
- //{
- // this.dkOriginalUserCode.Focus();
- // return false;
- //}
- //工种
- if (this.dropJobs.SelectedValue == null || this.dropJobs.SelectedValue.ToString() == string.Empty)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "工种"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.dropJobs.Focus();
- return false;
- }
- //职务
- if (this.droppost.SelectedValue == null || this.droppost.SelectedValue.ToString() == string.Empty)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "职务"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.droppost.Focus();
- return false;
- }
- if (this.txtPause.Text.Trim() == string.Empty)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "申请原因"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtPause.Focus();
- return false;
- }
- if (this.txtSuggestion.Text.Trim() == string.Empty)
- {
- // 提示信息
- MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "部门意见"),
- this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.txtSuggestion.Focus();
- return false;
- }
- return true;
- }
- /// <summary>
- /// 根据页面输入值,给员工对象实体赋值
- /// </summary>
- /// <returns></returns>
- private StaffRecordEntity SetStaffRecordEntity()
- {
- StaffRecordEntity staffRecordEntity = new StaffRecordEntity();
- //员工ID
- staffRecordEntity.StaffID = Convert.ToInt32(this.dkStaffName.UserID);
- //员工Code
- staffRecordEntity.StaffCode = this.dkStaffName.UserCode; ;
- //履历类别 1入职
- staffRecordEntity.RecordType = 1;
- //如果实习,添加预结束实习日期
- if (chkExProbationEndDate.Checked)
- staffRecordEntity.ExProbationEndDate = Convert.ToDateTime(dateExProbationEndDate.Value.ToString("yyyy-MM-dd"));
- //履历日期
- staffRecordEntity.RecordDate = DateTime.Now;
- //原工号
- //staffRecordEntity.OriginalUserID =this.dkOriginalUserCode.UserID;
- //原工号编码
- //staffRecordEntity.OriginalUserCode = this.dkOriginalUserCode.UserCode;
- //原员工状态 0未入职
- staffRecordEntity.OriginalStaffStatus = 0;
- //原工种
- staffRecordEntity.OriginalJobs = Convert.ToInt32(dropJobs.SelectedValue);
- //所属部门
- staffRecordEntity.OriginalOrganizationID = scbOrganization.SearchedPKMember;
- //原职务
- staffRecordEntity.OriginalPost = Convert.ToInt32(droppost.SelectedValue);
- //调整后的工号
- staffRecordEntity.TargetUserID = this.dkOriginalUserCode.UserID;
- //调整后工号编码
- staffRecordEntity.TargetUserCode = this.dkOriginalUserCode.UserCode;
- //调整后员工状态 0未入职
- staffRecordEntity.TargetStaffStatus = chkExProbationEndDate.Checked ? 1 : 2;
- //调整后工种
- staffRecordEntity.TargetJobs = Convert.ToInt32(dropJobs.SelectedValue);
- //调整后所属部门
- staffRecordEntity.TargetOrganizationID = scbOrganization.SearchedPKMember;
- //调整后职务
- staffRecordEntity.TargetPost = Convert.ToInt32(droppost.SelectedValue);
- //申请原因
- staffRecordEntity.Reason = txtPause.Text.Trim();
- //审批状态0 待审批
- // MODIFY 员工入职直接审批通过 BY 付斌 2018-3-31
- staffRecordEntity.ApprovalStatus = 3;
- //部门原因
- staffRecordEntity.Suggestion = txtSuggestion.Text;
- //有效标识
- staffRecordEntity.ValueFlag = 1;
- //时间戳
- staffRecordEntity.OPTimeStamp = OPTimeStamp;
- //申请人
- staffRecordEntity.Applicant = Convert.ToInt32(this.dkApplicant.UserID == null ? this.dkStaffName.UserID : this.dkApplicant.UserID);
- //备注
- staffRecordEntity.Remarks = txtRecordRemarks.Text;
- return staffRecordEntity;
- }
- /// <summary>
- /// 添加员工档案
- /// </summary>
- /// <returns></returns>
- private HRResultEntity EditStaffRecord()
- {
- try
- {
- return HRModuleProxy.Service.EditStaffRecord(_staffRecordEntity);
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 编辑员工档案
- /// </summary>
- /// <returns></returns>
- private HRResultEntity AddStaffRecord()
- {
- try
- {
- return HRModuleProxy.Service.AddStaffRecord(_staffRecordEntity);
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- /// <summary>
- /// 清空输入项
- /// </summary>
- private void InitializationForm()
- {
- this.scbOrganization.ClearValue();
- this.txtPause.Text = "";
- this.dropJobs.Text = "";
- this.dropJobs.SelectedValue = null;
- this.dropJobs.SelectedText = null;
- this.droppost.Text = "";
- this.droppost.SelectedValue = null;
- this.droppost.SelectedText = null;
- this.chkExProbationEndDate.Checked = false;
- this.txtSuggestion.Text = "";
- this.dkStaffName.UserID = null;
- this.dkApplicant.UserID = null;
- this.txtRecordRemarks.Text = "";
- }
- //设置非待审核的履历控件禁用
- private void SetControlEnable()
- {
- this.scbOrganization.Enabled = false;
- this.dropJobs.Enabled = false;
- this.droppost.Enabled = false;
- this.txtPause.Enabled = false;
- this.txtSuggestion.Enabled = false;
- this.chkExProbationEndDate.Enabled = false;
- this.btnSave.Enabled = false;
- }
- /// <summary>
- /// 获取员工图片
- /// </summary>
- /// <returns></returns>
- private DataSet GetImageByStaffId()
- {
- DataSet returnImageByStaffId = null;
- try
- {
- returnImageByStaffId = HRModuleProxy.Service.GetImageByStaffId(StaffID);
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- return returnImageByStaffId;
- }
- #endregion
- }
- }
|