F_HR_0702.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. /*******************************************************************************
  2. * Copyright(c) 2014 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_HR_0702.cs
  5. * 2.功能描述:部门调整新增、修改
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 冯雪 2014/09/18 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Windows.Forms;
  14. using Dongke.IBOSS.PRD.Basics.BaseControls;
  15. using Dongke.IBOSS.PRD.Basics.BaseResources;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.WCF.DataModels;
  18. using Dongke.IBOSS.PRD.WCF.DataModels.HRModule;
  19. using Dongke.IBOSS.PRD.WCF.Proxys;
  20. using Dongke.IBOSS.PRD.WCF.Proxys.HRModuleService;
  21. namespace Dongke.IBOSS.PRD.Client.HRModule
  22. {
  23. /// <summary>
  24. /// 部门调整新增、修改
  25. /// </summary>
  26. public partial class F_HR_0702 : FormBase
  27. {
  28. #region 成员变量
  29. // 窗体状态的枚举 新建/编辑
  30. private Constant.FormMode _editStatus;
  31. // 要编辑的员工编号
  32. private int _userId;
  33. // 页面传过来员工ID
  34. private int _staffRecordID;
  35. // 用户履历实体类
  36. private StaffRecordEntity _staffRecordEntity;
  37. // 员工时间戳
  38. private DateTime _optimestamp;
  39. // 调整前部门信息;
  40. private int _originalOrganization;
  41. // 调整前工号信息;
  42. private int _originalUserID;
  43. // 调整前工种信息;
  44. private int _originalJobs;
  45. // 调整前职务ID
  46. private int _originalPost;
  47. // 员工履历表的时间戳
  48. private DateTime? _rOPTimeStamp;
  49. // 预计试用结束日期
  50. private DateTime? _rExProbationEndDate;
  51. // 新建的员工ID集合
  52. private List<int> _staffIDList = new List<int>();
  53. #endregion
  54. #region 构造函数
  55. /// <summary>
  56. /// 构造函数
  57. /// </summary>
  58. /// <param name="editStatus">新建/编辑</param>
  59. /// <param name="pUserId">要编辑的员工编号</param>
  60. public F_HR_0702(Constant.FormMode editStatus, int pUserId, int pStaffRecordID)
  61. {
  62. InitializeComponent();
  63. this._editStatus = editStatus;
  64. this._userId = pUserId;
  65. this._staffRecordID = pStaffRecordID;
  66. this.SetFromTitleInfo();
  67. }
  68. #endregion
  69. #region 属性
  70. /// <summary>
  71. /// 页面传过来的员工ID
  72. /// </summary>
  73. public int StaffRecordID
  74. {
  75. get
  76. {
  77. return this._staffRecordID;
  78. }
  79. set
  80. {
  81. this._staffRecordID = value;
  82. }
  83. }
  84. /// <summary>
  85. /// 时间戳
  86. /// </summary>
  87. public DateTime OPTimeStamp
  88. {
  89. get
  90. {
  91. return _optimestamp;
  92. }
  93. set
  94. {
  95. _optimestamp = value;
  96. }
  97. }
  98. /// <summary>
  99. /// 员工ID集合
  100. /// </summary>
  101. public List<int> StaffIDList
  102. {
  103. get
  104. {
  105. return _staffIDList;
  106. }
  107. set
  108. {
  109. _staffIDList = value;
  110. }
  111. }
  112. #endregion
  113. #region 事件
  114. /// <summary>
  115. /// 页面加载事件
  116. /// </summary>
  117. /// <param name="sender"></param>
  118. /// <param name="e"></param>
  119. private void F_HR_0702_Load(object sender, EventArgs e)
  120. {
  121. try
  122. {
  123. this.dkUserName.WhereCondition = "StaffStatus in(1,2) And ValueFlag = 1";
  124. this.dkUserApplicant.WhereCondition = "StaffStatus =2 And ValueFlag = 1";
  125. if (this._editStatus == Constant.FormMode.Edit)
  126. {
  127. // 获取用户信息数据集
  128. DataSet staffInfoData = (DataSet)DoAsync(new BaseAsyncMethod(this.GetDataGridViewInfo));
  129. if (staffInfoData != null && staffInfoData.Tables.Count > Constant.INT_IS_ZERO)
  130. {
  131. // 编辑数据 给页面所有项赋值
  132. if (this._editStatus == Constant.FormMode.Edit && staffInfoData.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  133. {
  134. this.dkUserName.UserID = Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["StaffID"]);
  135. this.dkUserName.UserCode = staffInfoData.Tables[0].Rows[0]["StaffCode"].ToString().Trim();
  136. this.dkUserName.UserName = staffInfoData.Tables[0].Rows[0]["StaffName"].ToString().Trim();
  137. this.txtStaffCode.Text = staffInfoData.Tables[0].Rows[0]["StaffCode"].ToString().Trim();
  138. this.txtOrganizationID.Text = staffInfoData.Tables[0].Rows[0]["SOrganizationname"].ToString().Trim();
  139. this._originalOrganization = int.Parse(staffInfoData.Tables[0].Rows[0]["OriginalOrganizationID"].ToString().Trim());
  140. this.txtJobs.Text = staffInfoData.Tables[0].Rows[0]["ROriginalJobsName"].ToString().Trim();
  141. this._originalJobs = int.Parse(staffInfoData.Tables[0].Rows[0]["OriginalJobs"].ToString().Trim());
  142. this.txt_OriginalPost.Text = staffInfoData.Tables[0].Rows[0]["ROriginalPostName"].ToString().Trim();
  143. this._originalPost = Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["OriginalPost"]);
  144. //this.dkTargetOrganization.OrganizationID = Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["TargetOrganizationID"]);
  145. //this.dkTargetOrganization.OrganizationName = staffInfoData.Tables[0].Rows[0]["RTargetOrganizationName"].ToString().Trim();
  146. scbTargetOrganization.InitValue(staffInfoData.Tables[0].Rows[0]["RTargetOrganizationName"].ToString().Trim()
  147. , Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["TargetOrganizationID"]));
  148. // 如果调整后员工工种信息不为空,为调整后工种赋值
  149. if (!string.IsNullOrEmpty(staffInfoData.Tables[0].Rows[0]["TargetJobs"].ToString()))
  150. {
  151. this.dkTargetJobs.JobsID = Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["TargetJobs"]);
  152. this.dkTargetJobs.JobsName = staffInfoData.Tables[0].Rows[0]["RTargetJobsName"].ToString().Trim();
  153. }
  154. // 如果调整后员工职务信息不为空,为调整后员工职务赋值
  155. if (!string.IsNullOrEmpty(staffInfoData.Tables[0].Rows[0]["TargetPost"].ToString()))
  156. {
  157. this.dkPostName.PostID = Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["TargetPost"]);
  158. this.dkPostName.PostName = staffInfoData.Tables[0].Rows[0]["RTargetPostName"].ToString().Trim();
  159. }
  160. this.dkUserApplicant.UserID = Convert.ToInt32(staffInfoData.Tables[0].Rows[0]["Applicant"]);
  161. this.dkUserApplicant.UserName = staffInfoData.Tables[0].Rows[0]["RApplicantName"].ToString().Trim();
  162. this.dtpApplicationTime.Value = Convert.ToDateTime(staffInfoData.Tables[0].Rows[0]["RecordDate"]);
  163. // 如果调整后员工状态为试用为预计试用期状态赋值
  164. if (staffInfoData.Tables[0].Rows[0]["TargetStaffStatus"].ToString().Equals(Constant.StaffStatus.Trial.GetHashCode().ToString()))
  165. {
  166. this.chkProbation.Checked = true;
  167. this._rExProbationEndDate = Convert.ToDateTime(staffInfoData.Tables[0].Rows[0]["RExProbationEndDate"]);
  168. this.dtpExProbationEndDate.Value = this._rExProbationEndDate.Value;
  169. }
  170. this.txtReason.Text = staffInfoData.Tables[0].Rows[0]["Reason"].ToString().Trim();
  171. this.txtSuggestion.Text = staffInfoData.Tables[0].Rows[0]["Suggestion"].ToString().Trim();
  172. this.txtRemarks.Text = staffInfoData.Tables[0].Rows[0]["RRemarks"].ToString().Trim();
  173. this._optimestamp = Convert.ToDateTime(staffInfoData.Tables[0].Rows[0]["SOPTimeStamp"]);
  174. this._rOPTimeStamp = Convert.ToDateTime(staffInfoData.Tables[0].Rows[0]["ROPTimeStamp"]);
  175. }
  176. this.dkUserName.Enabled = false;
  177. }
  178. }
  179. }
  180. catch (Exception ex)
  181. {
  182. // 对异常进行共通处理
  183. ExceptionManager.HandleEventException(this.ToString(),
  184. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  185. }
  186. }
  187. /// <summary>
  188. /// 用户选择控件值改变时事件
  189. /// </summary>
  190. /// <param name="sender"></param>
  191. /// <param name="e"></param>
  192. private void dkUserName_UserValueChanged(object sender, Controls.dkStaffSearchBox.TextChangeEventArgs e)
  193. {
  194. if (this.dkUserName.UserRow != null)
  195. {
  196. this.txtStaffCode.Text = this.dkUserName.StaffEntity.StaffCode;
  197. this.txtOrganizationID.Text = this.dkUserName.StaffEntity.OrganizationName;
  198. this.txtJobs.Text = this.dkUserName.StaffEntity.JobsName;
  199. this.txtJobs.Text = this.dkUserName.StaffEntity.JobsName;
  200. this.txt_OriginalPost.Text = this.dkUserName.StaffEntity.PostName;
  201. this._originalJobs = this.dkUserName.StaffEntity.Jobs;
  202. this._originalUserID = this.dkUserName.StaffEntity.UserID;
  203. this._originalPost = this.dkUserName.StaffEntity.Post;
  204. this._optimestamp = this.dkUserName.StaffEntity.OPTimeStamp;
  205. this._originalOrganization = this.dkUserName.StaffEntity.OrganizationID;
  206. if (this.dkUserName.StaffEntity.StaffStatus == Convert.ToInt32(Constant.StaffStatus.Trial))
  207. {
  208. this.chkProbation.Checked = true;
  209. if (this.dkUserName.StaffEntity.ExProbationEndDate != null)
  210. {
  211. this.dtpExProbationEndDate.Value = this.dkUserName.StaffEntity.ExProbationEndDate.Value;
  212. }
  213. }
  214. }
  215. }
  216. /// <summary>
  217. /// 取消按钮
  218. /// </summary>
  219. /// <param name="sender"></param>
  220. /// <param name="e"></param>
  221. private void btnCancel_Click(object sender, EventArgs e)
  222. {
  223. if (this._staffIDList != null && this._staffIDList.Count > 0)
  224. {
  225. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  226. }
  227. else
  228. {
  229. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  230. }
  231. }
  232. /// <summary>
  233. /// 保存按钮
  234. /// </summary>
  235. /// <param name="sender"></param>
  236. /// <param name="e"></param>
  237. private void btnSave_Click(object sender, EventArgs e)
  238. {
  239. try
  240. {
  241. // 验证输入是否正确
  242. if (!this.CheckInputValidity())
  243. {
  244. return;
  245. }
  246. this._staffRecordEntity = this.SetStaffRecordEntity();
  247. this.btnSave.Enabled = false;
  248. this.btnCancel.Enabled = false;
  249. HRResultEntity returnStaff = (HRResultEntity)DoAsync(new BaseAsyncMethod(this.SaveStaffInfo));
  250. this.btnSave.Enabled = true;
  251. this.btnCancel.Enabled = true;
  252. if (returnStaff.OperateStatus > Constant.INT_IS_ZERO)
  253. {
  254. // 保存成功提示信息
  255. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "部门调整", "保存"),
  256. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  257. this._staffIDList.Add(returnStaff.HRStaffRecordID);
  258. this.InitializationForm();
  259. if (this._editStatus == Constant.FormMode.Edit)
  260. {
  261. this.DialogResult = DialogResult.OK;
  262. }
  263. }
  264. else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_ONE)
  265. {
  266. // 提示信息
  267. MessageBox.Show(Messages.MSG_HR_W009,
  268. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  269. }
  270. else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_TWO)
  271. {
  272. // 提示信息
  273. MessageBox.Show(Messages.MSG_CMN_W012,
  274. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  275. }
  276. else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_THREE)
  277. {
  278. // 提示信息
  279. MessageBox.Show(Messages.MSG_CMN_W012,
  280. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  281. }
  282. else
  283. {
  284. // 提示信息
  285. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "部门调整", "保存"),
  286. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  287. }
  288. }
  289. catch (Exception ex)
  290. {
  291. this.btnSave.Enabled = true;
  292. this.btnCancel.Enabled = true;
  293. // 对异常进行共通处理
  294. ExceptionManager.HandleEventException(this.ToString(),
  295. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  296. }
  297. }
  298. /// <summary>
  299. /// 是否试用Changed事件
  300. /// </summary>
  301. /// <param name="sender"></param>
  302. /// <param name="e"></param>
  303. private void chkProbation_CheckedChanged(object sender, EventArgs e)
  304. {
  305. this.dtpExProbationEndDate.Enabled = this.chkProbation.Checked;
  306. }
  307. #endregion
  308. #region 私有方法
  309. /// <summary>
  310. /// 设置窗体按钮的文本信息
  311. /// </summary>
  312. private void SetFromTitleInfo()
  313. {
  314. if (this._editStatus == Constant.FormMode.Add)
  315. {
  316. this.Text = FormTitles.F_HR_0702_ADD;
  317. }
  318. else if (this._editStatus == Constant.FormMode.Edit)
  319. {
  320. this.Text = FormTitles.F_HR_0702_EDIT;
  321. this.dkUserName.Enabled = false;
  322. }
  323. this.btnSave.Text = ButtonText.BTN_SAVE;
  324. this.btnCancel.Text = ButtonText.BTN_CLOSE;
  325. }
  326. /// <summary>
  327. /// 验证输入格式是否正确
  328. /// </summary>
  329. /// <returns></returns>
  330. private bool CheckInputValidity()
  331. {
  332. // 验证员工信息是否录入;
  333. if (string.IsNullOrEmpty(this.dkUserName.Text.Trim()))
  334. {
  335. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "员工姓名"),
  336. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  337. this.dkUserName.Focus();
  338. return false;
  339. }
  340. // 验证调整后部门信息是否录入;
  341. if (string.IsNullOrEmpty(this.scbTargetOrganization.Text.Trim()))
  342. {
  343. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "调整后部门"),
  344. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  345. this.scbTargetOrganization.Focus();
  346. return false;
  347. }
  348. // 验证调整后部门不能和调整前一样
  349. if (this._originalOrganization == this.scbTargetOrganization.SearchedPKMember)
  350. {
  351. MessageBox.Show(string.Format(Messages.MSG_CMN_W018, "调整后部门", "调整前部门"),
  352. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  353. this.scbTargetOrganization.Focus();
  354. return false;
  355. }
  356. //if (string.IsNullOrEmpty(this.dkPostName.Text.Trim()))
  357. //{
  358. // MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "调整后职务"),
  359. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  360. // this.dkPostName.Focus();
  361. // return false;
  362. //}
  363. // 验证申请人信息是否录入;
  364. if (string.IsNullOrEmpty(this.dkUserApplicant.Text.Trim()))
  365. {
  366. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "申请人"),
  367. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  368. this.dkUserApplicant.Focus();
  369. return false;
  370. }
  371. // 验证申请原因是否录入;
  372. if (string.IsNullOrEmpty(this.txtReason.Text.Trim()))
  373. {
  374. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "申请原因"),
  375. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  376. this.txtReason.Focus();
  377. return false;
  378. }
  379. // 验证部门意见是否录入;
  380. if (string.IsNullOrEmpty(this.txtSuggestion.Text.Trim()))
  381. {
  382. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "部门意见"),
  383. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  384. this.txtSuggestion.Focus();
  385. return false;
  386. }
  387. //// 验证调整后工种不能和调整前一样
  388. //if (this._originalJobs == this.dkTargetJobs.JobsID)
  389. //{
  390. // MessageBox.Show(string.Format(Messages.MSG_CMN_W018, "调整后工种", "调整前工种"),
  391. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  392. // this.dkTargetJobs.Focus();
  393. // return false;
  394. //}
  395. return true;
  396. }
  397. /// <summary>
  398. /// 根据页面输入值,给员工对象实体赋值
  399. /// </summary>
  400. /// <returns></returns>
  401. private StaffRecordEntity SetStaffRecordEntity()
  402. {
  403. StaffRecordEntity staffRecordEntity = new StaffRecordEntity();
  404. staffRecordEntity.StaffID = this.dkUserName.UserID.Value;
  405. staffRecordEntity.StaffCode = this.txtStaffCode.Text.Trim();
  406. staffRecordEntity.RecordType = Convert.ToInt32(Constant.StaffRecordType.AdjustOrganization);
  407. staffRecordEntity.ApprovalStatus = Convert.ToInt32(Constant.ApprovalStatus.Pending);
  408. if (this._editStatus == Constant.FormMode.Add)
  409. {
  410. staffRecordEntity.OriginalOrganizationID = this.dkUserName.StaffEntity.OrganizationID;
  411. staffRecordEntity.OriginalStaffStatus = this.dkUserName.StaffEntity.StaffStatus;
  412. staffRecordEntity.OriginalOrganizationID = this._originalOrganization;
  413. staffRecordEntity.OriginalJobs = this.dkUserName.StaffEntity.Jobs;
  414. staffRecordEntity.OriginalPost = this.dkUserName.StaffEntity.Post;
  415. staffRecordEntity.OriginalUserID = this.dkUserName.StaffEntity.UserID;
  416. staffRecordEntity.OriginalUserCode = this.dkUserName.StaffEntity.UserCode;
  417. }
  418. // 如果是否试用为真,则取录入预计试用结束日期,否则取用户档案表中预计试用结束日期
  419. if (this.chkProbation.Checked)
  420. {
  421. staffRecordEntity.TargetStaffStatus = Convert.ToInt32(Constant.StaffStatus.Trial);
  422. staffRecordEntity.ExProbationEndDate = this.dtpExProbationEndDate.Value;
  423. }
  424. else
  425. {
  426. staffRecordEntity.TargetStaffStatus = chkProbation.Checked ? 1 : 2; //staffRecordEntity.OriginalStaffStatus;
  427. }
  428. staffRecordEntity.TargetOrganizationID = this.scbTargetOrganization.SearchedPKMember;
  429. staffRecordEntity.TargetJobs = this.dkTargetJobs.JobsID;
  430. staffRecordEntity.TargetPost = this.dkPostName.PostID;
  431. staffRecordEntity.Applicant = this.dkUserApplicant.UserID.Value;
  432. staffRecordEntity.RecordDate = this.dtpApplicationTime.Value;
  433. staffRecordEntity.Reason = this.txtReason.Text.Trim();
  434. staffRecordEntity.Suggestion = this.txtSuggestion.Text.Trim();
  435. staffRecordEntity.Remarks = this.txtRemarks.Text.Trim();
  436. if (this._rOPTimeStamp != null)
  437. {
  438. staffRecordEntity.OPTimeStamp = this._rOPTimeStamp.Value;
  439. }
  440. staffRecordEntity.StaffRecordID = this._staffRecordID;
  441. // MODIFY 部门调整直接审批通过 BY 付斌 2018-3-31
  442. staffRecordEntity.ApprovalStatus = 3;
  443. return staffRecordEntity;
  444. }
  445. /// <summary>
  446. /// 清空输入项
  447. /// </summary>
  448. private void InitializationForm()
  449. {
  450. this.dkUserName.Text = "";
  451. this.txtStaffCode.Text = "";
  452. this.txtOrganizationID.Text = "";
  453. this.txtJobs.Text = "";
  454. this.txt_OriginalPost.Text = "";
  455. this.scbTargetOrganization.ClearValue();
  456. this.chkProbation.Checked = false;
  457. this.dkTargetJobs.Text = "";
  458. this.dkPostName.Text = "";
  459. this.dkUserApplicant.Text = "";
  460. this.dtpExProbationEndDate.Value = DateTime.Now;
  461. this.dtpApplicationTime.Value = DateTime.Now;
  462. this.txtReason.Text = "";
  463. this.txtSuggestion.Text = "";
  464. this.txtRemarks.Text = "";
  465. }
  466. /// <summary>
  467. /// 添加员工档案
  468. /// </summary>
  469. /// <returns></returns>
  470. private HRResultEntity SaveStaffInfo()
  471. {
  472. try
  473. {
  474. if (this._editStatus == Constant.FormMode.Add)
  475. {
  476. return HRModuleProxy.Service.SaveTargetOrganizationInfo(this._staffRecordEntity, WCFConstant.FormMode.Add);
  477. }
  478. else if (this._editStatus == Constant.FormMode.Edit)
  479. {
  480. return HRModuleProxy.Service.SaveTargetOrganizationInfo(this._staffRecordEntity, WCFConstant.FormMode.Edit);
  481. }
  482. return new HRResultEntity();
  483. }
  484. catch (Exception ex)
  485. {
  486. throw ex;
  487. }
  488. }
  489. /// <summary>
  490. /// 根据查询条件获取要显示的数据
  491. /// </summary>
  492. /// <returns> 返回查询的结果集</returns>
  493. private DataSet GetDataGridViewInfo()
  494. {
  495. try
  496. {
  497. SearchStaffEntity searchStaffEntity = new SearchStaffEntity();
  498. searchStaffEntity.StaffID = this._userId;
  499. searchStaffEntity.RStaffRecordID = this._staffRecordID;
  500. return WCF.Proxys.HRModuleProxy.Service.SearchHrStaffAndRecord(searchStaffEntity);
  501. }
  502. catch (Exception ex)
  503. {
  504. throw ex;
  505. }
  506. }
  507. #endregion
  508. }
  509. }