F_HR_0102.cs 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_HR_0102.cs
  5. * 2.功能描述:新建/编辑员工档案
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2014/09/12 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Drawing.Drawing2D;
  15. using System.Drawing.Imaging;
  16. using System.IO;
  17. using System.Windows.Forms;
  18. using Dongke.IBOSS.PRD.Basics.BaseControls;
  19. using Dongke.IBOSS.PRD.Basics.BaseResources;
  20. using Dongke.IBOSS.PRD.Client.CommonModule;
  21. using Dongke.IBOSS.PRD.Client.DataModels;
  22. using Dongke.IBOSS.PRD.WCF.DataModels;
  23. using Dongke.IBOSS.PRD.WCF.Proxys;
  24. using Dongke.IBOSS.PRD.WCF.Proxys.HRModuleService;
  25. namespace Dongke.IBOSS.PRD.Client.HRModule
  26. {
  27. /// <summary>
  28. /// 新建/编辑员工档案
  29. /// </summary>
  30. public partial class F_HR_0102 : FormBase
  31. {
  32. #region 成员变量
  33. // 页面传过来员工ID
  34. private int _staffID;
  35. // 用户实体类
  36. private StaffEntity _staffEntity;
  37. // 编辑状态
  38. private Constant.FormMode _editStatus;
  39. // 新建的员工ID集合
  40. private List<int> _staffIDList = new List<int>();
  41. // 时间戳
  42. private DateTime _optimestamp;
  43. // 图片字节集
  44. private List<byte[]> _PicByte = new List<byte[]>();
  45. // 缩略图片字节集
  46. private List<byte[]> _smallByte = new List<byte[]>();
  47. // 图片实体集合
  48. private List<StaffPhotoEntity> _imgList = new List<StaffPhotoEntity>();
  49. // 已存在的图片实体集合(修改)
  50. private List<StaffPhotoEntity> _updateImgList = new List<StaffPhotoEntity>();
  51. #endregion
  52. #region 构造函数
  53. public F_HR_0102()
  54. {
  55. InitializeComponent();
  56. }
  57. /// <summary>
  58. /// 构造函数
  59. /// </summary>
  60. /// <param name="frmStatus">窗体状态</param>
  61. public F_HR_0102(Constant.FormMode frmStatus)
  62. {
  63. InitializeComponent();
  64. _editStatus = frmStatus;
  65. // 设置窗口标题,当为新建状态时显示新建员工,当为编辑状态时显示编辑员工
  66. if (frmStatus == Constant.FormMode.Add)
  67. {
  68. this.Text = FormTitles.F_HR_0102_ADD;
  69. }
  70. else if (frmStatus == Constant.FormMode.Edit)
  71. {
  72. this.Text = FormTitles.F_HR_0102_EDIT;
  73. this.txtStaffCode.Enabled = false;
  74. }
  75. // 工具栏按钮文本赋值
  76. this.btnSave.Text = ButtonText.BTN_SAVE;
  77. this.btnCancel.Text = ButtonText.BTN_CLOSE;
  78. this.btnUpload.Text = ButtonText.BTN_UPLOAD;
  79. this.btnDelete.Text = ButtonText.BTN_DELETE;
  80. #region 绑定数据源
  81. // 性别
  82. DataTable dtT_SYS_Gender = (DataTable)DoAsync(new BaseAsyncMethod(GetSystemParameterByName));
  83. this.dropGender.DisplayMember = "GenderName";
  84. this.dropGender.ValueMember = "GenderCode";
  85. this.dropGender.DataSource = dtT_SYS_Gender;
  86. // 婚姻状况
  87. DataTable dtT_SYS_MaritalStatus = (DataTable)DoAsync(new BaseAsyncMethod(GetSystemParameterByNameMaritalStatu));
  88. this.dropMaritalStatus.DisplayMember = "maritalstatusname";
  89. this.dropMaritalStatus.ValueMember = "maritalstatusid";
  90. this.dropMaritalStatus.DataSource = dtT_SYS_MaritalStatus;
  91. // 民族
  92. DataTable dtT_SYS_National = (DataTable)DoAsync(new BaseAsyncMethod(GetSystemParameterByNameNational));
  93. this.dropNational.DisplayMember = "nationalname";
  94. this.dropNational.ValueMember = "nationalid";
  95. this.dropNational.DataSource = dtT_SYS_National;
  96. // 学历
  97. DataTable dtT_SYS_Educational = (DataTable)DoAsync(new BaseAsyncMethod(GetSystemParameterByNameEducational));
  98. this.dropEducational.DisplayMember = "educationalname";
  99. this.dropEducational.ValueMember = "educationalid";
  100. this.dropEducational.DataSource = dtT_SYS_Educational;
  101. #endregion
  102. }
  103. #endregion
  104. #region 属性
  105. /// <summary>
  106. /// 页面传过来的员工ID
  107. /// </summary>
  108. public int StaffID
  109. {
  110. get
  111. {
  112. return this._staffID;
  113. }
  114. set
  115. {
  116. this._staffID = value;
  117. }
  118. }
  119. /// <summary>
  120. /// 员工ID集合
  121. /// </summary>
  122. public List<int> StaffIDList
  123. {
  124. get
  125. {
  126. return _staffIDList;
  127. }
  128. set
  129. {
  130. _staffIDList = value;
  131. }
  132. }
  133. /// <summary>
  134. /// 时间戳
  135. /// </summary>
  136. public DateTime PTimeStamp
  137. {
  138. get
  139. {
  140. return _optimestamp;
  141. }
  142. set
  143. {
  144. _optimestamp = value;
  145. }
  146. }
  147. #endregion
  148. #region 按钮事件
  149. /// <summary>
  150. /// 保存按钮事件
  151. /// </summary>
  152. /// <param name="sender"></param>
  153. /// <param name="e"></param>
  154. private void btnSave_Click(object sender, EventArgs e)
  155. {
  156. try
  157. {
  158. // 验证输入是否正确
  159. if (!this.CheckInputValidity())
  160. {
  161. return;
  162. }
  163. this._staffEntity = this.SetStaffEntity();
  164. if (this._editStatus == Constant.FormMode.Add)
  165. {
  166. if (this.txtStaffCode.Text.Trim() != string.Empty)
  167. {
  168. // 判断是否存在重复的员工编号
  169. DataSet staffCodeData = (DataSet)DoAsync(new BaseAsyncMethod(this.IsExistsStaffCode));
  170. if (staffCodeData.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  171. {
  172. MessageBox.Show(string.Format(Messages.MSG_CMN_W011, this.txtStaffCode.Text.Trim(), "员工编码"),
  173. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  174. this.txtStaffCode.Focus();
  175. return;
  176. }
  177. }
  178. // 新建用户,返回新建的员工ID
  179. this.btnSave.Enabled = false;
  180. this.btnCancel.Enabled = false;
  181. HRResultEntity returnStaff = (HRResultEntity)DoAsync(new BaseAsyncMethod(this.AddStaffInfo));
  182. this.btnSave.Enabled = true;
  183. this.btnCancel.Enabled = true;
  184. if (returnStaff.OperateStatus > Constant.INT_IS_ZERO)
  185. {
  186. // 提示信息
  187. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "新建员工", "保存"),
  188. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  189. this._staffIDList.Add(returnStaff.HRStaffID);
  190. this.InitializationForm();
  191. }
  192. else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_THREE)
  193. {
  194. // 提示信息
  195. MessageBox.Show(string.Format(Messages.MSG_CMN_W012, "新建员工", "保存"),
  196. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  197. }
  198. else
  199. {
  200. // 提示信息
  201. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "新建员工", "保存"),
  202. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  203. }
  204. }
  205. else
  206. {
  207. this.btnSave.Enabled = false;
  208. this.btnCancel.Enabled = false;
  209. this._staffEntity.StaffID = StaffID;
  210. this._staffEntity.OPTimeStamp = PTimeStamp;
  211. HRResultEntity returnStaff = (HRResultEntity)DoAsync(new BaseAsyncMethod(this.EditStaffInfo));
  212. this.btnSave.Enabled = true;
  213. this.btnCancel.Enabled = true;
  214. if (returnStaff.OperateStatus > Constant.INT_IS_ZERO)
  215. {
  216. // 提示信息
  217. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "编辑员工", "保存"),
  218. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  219. //this._staffIDList.Add(returnStaff.HRStaffID);
  220. this.InitializationForm();
  221. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  222. }
  223. else if (returnStaff.OperateStatus == Constant.INT_IS_NEGATIE_THREE)
  224. {
  225. // 提示信息
  226. MessageBox.Show(string.Format(Messages.MSG_CMN_W012, "编辑员工", "保存"),
  227. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  228. }
  229. else
  230. {
  231. // 提示信息
  232. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "编辑员工", "保存"),
  233. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  234. }
  235. }
  236. }
  237. catch (Exception ex)
  238. {
  239. this.btnSave.Enabled = true;
  240. this.btnCancel.Enabled = true;
  241. // 对异常进行共通处理
  242. ExceptionManager.HandleEventException(this.ToString(),
  243. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  244. }
  245. }
  246. /// <summary>
  247. /// 窗体加载事件
  248. /// </summary>
  249. /// <param name="sender"></param>
  250. /// <param name="e"></param>
  251. private void F_HR_0102_Load(object sender, EventArgs e)
  252. {
  253. try
  254. {
  255. // 加载权限
  256. FormPermissionManager.FormPermissionControl(this.Name, this,
  257. LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData, LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  258. #region 绑定工种职务数据源
  259. this.dropJobs.DisplayMember = "JOBSNAME";
  260. this.dropJobs.ValueMember = "JOBSID";
  261. this.dropJobs.DataSource = (DataTable)DoAsync(new BaseAsyncMethod(this.GetJobsData));
  262. this.droppost.DisplayMember = "POSTNAME";
  263. this.droppost.ValueMember = "POSTID";
  264. this.droppost.DataSource = (DataTable)DoAsync(new BaseAsyncMethod(this.GetPostData));
  265. #endregion
  266. // 获取用户信息数据集
  267. DataSet dsGetRowData = (DataSet)DoAsync(new BaseAsyncMethod(this.GetRowData));
  268. if (dsGetRowData != null && dsGetRowData.Tables.Count > Constant.INT_IS_ZERO)
  269. {
  270. // 编辑数据 给页面所有项赋值
  271. if (this._editStatus == Constant.FormMode.Edit && dsGetRowData.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  272. {
  273. DataRow staffData = dsGetRowData.Tables[0].Rows[0];
  274. this.txtStaffCode.Text = staffData["StaffCode"].ToString();
  275. this.txtStaffCode.Enabled = false;
  276. this.txtStaffName.Text = staffData["StaffName"].ToString();
  277. this.txtIDCardNo.Text = staffData["IDCardNo"].ToString();
  278. if (staffData["Birthday"] != DBNull.Value)
  279. this.txtBirthday.Value = Convert.ToDateTime(staffData["Birthday"]);
  280. this.dropGender.SelectedValue = staffData["Gender"].ToString();
  281. this.dropMaritalStatus.SelectedValue = staffData["MaritalStatus"].ToString();
  282. this.txtHomeTown.Text = staffData["HomeTown"].ToString();
  283. this.txtPolicitalStatus.Text = staffData["PolicitalStatus"].ToString();
  284. this.dropNational.SelectedValue = staffData["National"].ToString();
  285. this.dropEducational.SelectedValue = staffData["Educational"].ToString();
  286. this.txtGraduated.Text = staffData["Graduated"].ToString();
  287. this.txtSpecialField.Text = staffData["SpecialField"].ToString();
  288. this.txtTelephone.Text = staffData["Telephone"].ToString();
  289. this.txtHeight.Text = staffData["Height"].ToString();
  290. this.txtBloodGroup.Text = staffData["BloodGroup"].ToString();
  291. this.txtEmail.Text = staffData["Email"].ToString();
  292. this.txtWeight.Text = staffData["Weight"].ToString();
  293. if (staffData["JoinPartyDate"] != DBNull.Value)
  294. {
  295. this.cbJoinPartyDate.Checked = true;
  296. this.txtJoinPartyDate.Enabled = true;
  297. this.txtJoinPartyDate.Value = Convert.ToDateTime(staffData["JoinPartyDate"]);
  298. }
  299. this.txtOpeningBank.Text = staffData["OpeningBank"].ToString();
  300. this.txtAccountNo.Text = staffData["AccountNo"].ToString();
  301. this.chkLaidOff.Checked = Convert.ToBoolean(Convert.ToInt32(staffData["LaidOff"]));
  302. this.chkDisability.Checked = Convert.ToBoolean(Convert.ToInt32(staffData["Disability"]));
  303. this.txtAddress.Text = staffData["Address"].ToString();
  304. this.txtRemarks.Text = staffData["Remarks"].ToString();
  305. this.PTimeStamp = Convert.ToDateTime(staffData["OPTimeStamp"]);
  306. if (staffData["staffstatusname"] != DBNull.Value)
  307. {
  308. this.lblStaffStatusName.Text = staffData["staffstatusname"].ToString();
  309. }
  310. //this.dkOrganizationSearch.Text = staffData["organizationname"].ToString();
  311. //this.dkOrganizationSearch.OrganizationID = Convert.ToInt32(staffData["OrganizationID"]);
  312. this.scbOrganization.InitValue(staffData["organizationname"].ToString()
  313. , Convert.ToInt32(staffData["OrganizationID"]));
  314. this.dropJobs.SelectedValue = staffData["Jobs"].ToString();
  315. this.droppost.SelectedValue = staffData["Post"].ToString();
  316. //if (staffData["StaffStatus"].ToString() != Constant.INT_IS_ZERO.ToString())
  317. // {
  318. // //入职后才有的三个属性
  319. // if (staffData["jobsname"] != DBNull.Value)
  320. // {
  321. // this.lblJobsName.Text = staffData["jobsname"].ToString();
  322. // }
  323. // if (staffData["organizationname"] != DBNull.Value)
  324. // {
  325. // this.lblOrganizationName.Text = staffData["organizationname"].ToString();
  326. // }
  327. // if (staffData["postname"] != DBNull.Value)
  328. // {
  329. // this.lblPostName.Text = staffData["postname"].ToString();
  330. // }
  331. // }
  332. }
  333. DataSet dsImg = (DataSet)DoAsync(new BaseAsyncMethod(this.GetImageByStaffId));
  334. BindByteImage(dsImg);
  335. }
  336. }
  337. catch (Exception ex)
  338. {
  339. // 对异常进行共通处理
  340. ExceptionManager.HandleEventException(this.ToString(),
  341. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  342. }
  343. }
  344. /// <summary>
  345. /// 上传图片
  346. /// </summary>
  347. /// <param name="sender"></param>
  348. /// <param name="e"></param>
  349. private void btnUpload_Click(object sender, EventArgs e)
  350. {
  351. try
  352. {
  353. this.odlgFile.Filter = Constant.FILTER_PIC;
  354. this.odlgFile.FilterIndex = Constant.INT_IS_ZERO;
  355. this.odlgFile.RestoreDirectory = true;
  356. this.odlgFile.Title = "选择员工图片";
  357. this.odlgFile.FileName = null;
  358. this.odlgFile.RestoreDirectory = true;
  359. if (this.odlgFile.ShowDialog() == DialogResult.OK)
  360. {
  361. FileInfo file = new FileInfo(odlgFile.FileName);
  362. if (Constant.UPLOAD_PIC_MAX_SIZE < file.Length)
  363. {
  364. MessageBox.Show(string.Format(Messages.MSG_CMN_W013, "员工图片", "大小", "1M"),
  365. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  366. }
  367. else
  368. {
  369. Image PicImage = Image.FromStream(file.OpenRead());
  370. this.pic.Image = PicImage;
  371. //_PicByte.Add(ImageToByte(PicImage));
  372. //GetThumbnail(file);
  373. //BindImg();
  374. }
  375. }
  376. }
  377. catch (Exception ex)
  378. {
  379. // 对异常进行共通处理
  380. ExceptionManager.HandleEventException(this.ToString(),
  381. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  382. }
  383. }
  384. /// <summary>
  385. /// 删除图片按钮事件
  386. /// </summary>
  387. /// <param name="sender"></param>
  388. /// <param name="e"></param>
  389. private void btnDelete_Click(object sender, EventArgs e)
  390. {
  391. try
  392. {
  393. this.pic.Image = Dongke.IBOSS.PRD.Client.HRModule.Properties.Resources.nopic;
  394. }
  395. catch (Exception ex)
  396. {
  397. // 对异常进行共通处理
  398. ExceptionManager.HandleEventException(this.ToString(),
  399. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  400. }
  401. //foreach (ListViewItem lvSelect in lvPic.SelectedItems)
  402. //{
  403. // int index = lvSelect.Index;
  404. // if (index < Constant.INT_IS_ZERO)
  405. // {
  406. // index = Constant.INT_IS_ZERO;
  407. // }
  408. // this.ilPic.Images.RemoveAt(index);
  409. // this._PicByte.RemoveAt(index);
  410. // this._smallByte.RemoveAt(index);
  411. // this.lvPic.Items.RemoveAt(index);
  412. // if (index < this._imgList.Count)
  413. // {
  414. // if (this._imgList[index].StaffPhotoID != Constant.INT_IS_ZERO)
  415. // {
  416. // StaffPhotoEntity deleteImgEntity = this._imgList[index];
  417. // this._imgList[index].ValueFlag = Constant.INT_IS_ZERO;
  418. // this._updateImgList.Add(deleteImgEntity);
  419. // this._imgList.RemoveAt(index);
  420. // }
  421. // }
  422. //}
  423. //BindImg();
  424. }
  425. /// <summary>
  426. /// 取消按钮
  427. /// </summary>
  428. /// <param name="sender"></param>
  429. /// <param name="e"></param>
  430. private void btnCancel_Click(object sender, EventArgs e)
  431. {
  432. if (this._staffIDList != null && this._staffIDList.Count > 0)
  433. {
  434. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  435. }
  436. else
  437. {
  438. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  439. }
  440. }
  441. /// <summary>
  442. /// 身份证号离开事件
  443. /// </summary>
  444. /// <param name="sender"></param>
  445. /// <param name="e"></param>
  446. private void txtIDCardNo_Leave(object sender, EventArgs e)
  447. {
  448. try
  449. {
  450. if (this.txtIDCardNo.Text.Trim() != string.Empty)
  451. {
  452. string BirStr = this.txtIDCardNo.Text.Substring(6, 8);
  453. DateTime BirDate = Convert.ToDateTime(BirStr.Substring(0, 4) + "/" + BirStr.Substring(4, 2)
  454. + "/" + BirStr.Substring(6, 2));
  455. this.txtBirthday.Text = BirDate.ToString();
  456. }
  457. }
  458. catch
  459. {
  460. this.txtIDCardNo.Focus();
  461. // 提示信息
  462. MessageBox.Show("身份证号不合法,请重新输入!",
  463. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  464. }
  465. }
  466. /// <summary>
  467. /// 入党日期选中改变事件
  468. /// </summary>
  469. /// <param name="sender"></param>
  470. /// <param name="e"></param>
  471. private void cbJoinPartyDate_CheckedChanged(object sender, EventArgs e)
  472. {
  473. this.txtJoinPartyDate.Enabled = this.cbJoinPartyDate.Checked;
  474. }
  475. #endregion
  476. #region 私有方法
  477. /// <summary>
  478. /// 验证输入格式是否正确
  479. /// </summary>
  480. /// <returns></returns>
  481. private bool CheckInputValidity()
  482. {
  483. if (string.IsNullOrEmpty(this.txtStaffCode.Text.Trim()))
  484. {
  485. this.txtStaffCode.IsMustInput = true;
  486. this.txtStaffCode.Focus();
  487. return false;
  488. }
  489. this.txtStaffCode.IsMustInput = false;
  490. if (string.IsNullOrEmpty(this.txtStaffName.Text.Trim()))
  491. {
  492. this.txtStaffName.IsMustInput = true;
  493. this.txtStaffName.Focus();
  494. return false;
  495. }
  496. this.txtStaffName.IsMustInput = false;
  497. if (this.dropGender.SelectedValue == null || this.dropGender.SelectedValue.ToString() == string.Empty)
  498. {
  499. this.dropGender.IsMustInput = true;
  500. this.dropGender.Focus();
  501. return false;
  502. }
  503. this.dropGender.IsMustInput = false;
  504. if (this.dropMaritalStatus.SelectedValue == null || this.dropMaritalStatus.SelectedValue.ToString() == string.Empty)
  505. {
  506. this.dropMaritalStatus.IsMustInput = true;
  507. this.dropMaritalStatus.Focus();
  508. return false;
  509. }
  510. this.dropMaritalStatus.IsMustInput = false;
  511. if (this.dropEducational.SelectedValue == null || this.dropEducational.SelectedValue.ToString() == string.Empty)
  512. {
  513. this.dropEducational.IsMustInput = true;
  514. this.dropEducational.Focus();
  515. return false;
  516. }
  517. this.dropEducational.IsMustInput = false;
  518. if (this.dropNational.SelectedValue == null || this.dropNational.SelectedValue.ToString() == string.Empty)
  519. {
  520. this.dropNational.IsMustInput = true;
  521. this.dropNational.Focus();
  522. return false;
  523. }
  524. //所属部门
  525. if (this.scbOrganization.SearchedPKMember == 0)
  526. {
  527. // 提示信息
  528. MessageBox.Show(string.Format(Messages.MSG_CMN_W005, "所属部门"),
  529. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  530. this.scbOrganization.Focus();
  531. return false;
  532. }
  533. //工种
  534. if (this.dropJobs.SelectedValue == null || this.dropJobs.SelectedValue.ToString() == string.Empty)
  535. {
  536. this.dropJobs.IsMustInput = true;
  537. this.dropJobs.Focus();
  538. return false;
  539. }
  540. //职务
  541. if (this.droppost.SelectedValue == null || this.droppost.SelectedValue.ToString() == string.Empty)
  542. {
  543. this.droppost.IsMustInput = true;
  544. this.droppost.Focus();
  545. return false;
  546. }
  547. this.dropNational.IsMustInput = false;
  548. return true;
  549. }
  550. /// <summary>
  551. /// 根据页面输入值,给员工对象实体赋值
  552. /// </summary>
  553. /// <returns></returns>
  554. private StaffEntity SetStaffEntity()
  555. {
  556. StaffEntity staffEntity = new StaffEntity();
  557. staffEntity.StaffCode = this.txtStaffCode.Text.Trim();
  558. staffEntity.StaffName = this.txtStaffName.Text.Trim();
  559. staffEntity.IDCardNo = this.txtIDCardNo.Text;
  560. if (!txtBirthday.Text.Trim().Contains("1900"))
  561. staffEntity.Birthday = txtBirthday.Value;
  562. staffEntity.Gender = dropGender.SelectedValue.ToString();
  563. staffEntity.MaritalStatus = Convert.ToInt32(dropMaritalStatus.SelectedValue);
  564. staffEntity.HomeTown = txtHomeTown.Text.Trim();
  565. staffEntity.PolicitalStatus = txtPolicitalStatus.Text.Trim();
  566. staffEntity.National = Convert.ToInt32(dropNational.SelectedValue);
  567. staffEntity.Educational = Convert.ToInt32(dropEducational.SelectedValue);
  568. staffEntity.Graduated = txtGraduated.Text.Trim();
  569. staffEntity.SpecialField = txtSpecialField.Text.Trim();
  570. staffEntity.Telephone = txtTelephone.Text.Trim();
  571. staffEntity.Height = txtHeight.Text.Trim() == "" ? Constant.INT_IS_ZERO : Convert.ToDecimal(txtHeight.Text);
  572. staffEntity.BloodGroup = txtBloodGroup.Text.Trim();
  573. staffEntity.Weight = txtWeight.Text.Trim() == "" ? Constant.INT_IS_ZERO : Convert.ToDecimal(txtWeight.Text);
  574. staffEntity.Address = txtAddress.Text;
  575. staffEntity.LaidOff = chkLaidOff.Checked;
  576. staffEntity.Disability = chkDisability.Checked;
  577. if (!txtJoinPartyDate.Text.Trim().Contains("1900"))
  578. staffEntity.JoinPartyDate = txtJoinPartyDate.Value;
  579. staffEntity.Email = txtEmail.Text.Trim();
  580. staffEntity.OpeningBank = txtOpeningBank.Text.Trim();
  581. staffEntity.AccountNo = txtAccountNo.Text.Trim();
  582. staffEntity.Remarks = txtRemarks.Text.Trim();
  583. // 员工档案新建保存后,直接是入职状态
  584. //staffEntity.StaffStatus = Constant.INT_IS_ZERO;
  585. staffEntity.StaffStatus = Constant.INT_IS_TWO;
  586. staffEntity.ValueFlag = true;
  587. //所属部门
  588. staffEntity.OrganizationID = scbOrganization.SearchedPKMember;
  589. //职务
  590. staffEntity.Post = Convert.ToInt32(droppost.SelectedValue);
  591. //原工种
  592. staffEntity.Jobs = Convert.ToInt32(dropJobs.SelectedValue);
  593. return staffEntity;
  594. }
  595. /// <summary>
  596. /// 清空输入项
  597. /// </summary>
  598. private void InitializationForm()
  599. {
  600. this.scbOrganization.ClearValue();
  601. this.dropJobs.Text = "";
  602. this.dropJobs.SelectedValue = null;
  603. this.dropJobs.SelectedText = null;
  604. this.droppost.Text = "";
  605. this.droppost.SelectedValue = null;
  606. this.droppost.SelectedText = null;
  607. this.txtStaffCode.Text = "";
  608. this.txtStaffName.Text = "";
  609. this.txtIDCardNo.Text = "";
  610. this.txtBirthday.Value = new DateTime(1900, 1, 1);
  611. this.dropGender.Text = "";
  612. this.dropGender.SelectedValue = null;
  613. this.dropGender.SelectedText = null;
  614. this.dropMaritalStatus.Text = "";
  615. this.dropMaritalStatus.SelectedValue = null;
  616. this.dropMaritalStatus.SelectedText = null;
  617. this.txtHomeTown.Text = "";
  618. this.txtPolicitalStatus.Text = "";
  619. this.dropNational.Text = "";
  620. this.dropNational.SelectedValue = null;
  621. this.dropNational.SelectedText = null;
  622. this.dropEducational.Text = "";
  623. this.dropEducational.SelectedValue = null;
  624. this.dropEducational.SelectedText = null;
  625. this.txtGraduated.Text = "";
  626. this.txtSpecialField.Text = "";
  627. this.txtTelephone.Text = "";
  628. this.txtHeight.Text = "";
  629. this.txtBloodGroup.Text = "";
  630. this.txtEmail.Text = "";
  631. this.txtWeight.Text = "";
  632. this.txtJoinPartyDate.Value = new DateTime(1900, 1, 1);
  633. this.txtOpeningBank.Text = "";
  634. this.txtAccountNo.Text = "";
  635. this.chkLaidOff.Checked = false;
  636. this.chkDisability.Checked = false;
  637. this.txtAddress.Text = "";
  638. this.txtRemarks.Text = "";
  639. this.pic.Image = Dongke.IBOSS.PRD.Client.HRModule.Properties.Resources.nopic;
  640. /*
  641. foreach (ListViewItem lvSelect in lvPic.SelectedItems)
  642. {
  643. int index = lvSelect.Index;
  644. if (index < Constant.INT_IS_ZERO)
  645. {
  646. index = Constant.INT_IS_ZERO;
  647. }
  648. this.ilPic.Images.RemoveAt(index);
  649. this._PicByte.RemoveAt(index);
  650. this._smallByte.RemoveAt(index);
  651. this.lvPic.Items.RemoveAt(index);
  652. if (index < this._imgList.Count)
  653. {
  654. if (this._imgList[index].StaffPhotoID != Constant.INT_IS_ZERO)
  655. {
  656. StaffPhotoEntity deleteImgEntity = this._imgList[index];
  657. this._imgList[index].ValueFlag = Constant.INT_IS_ZERO;
  658. this._updateImgList.Add(deleteImgEntity);
  659. this._imgList.RemoveAt(index);
  660. }
  661. }
  662. }*/
  663. //BindImg();
  664. //this.lvPic.Items.Clear();
  665. }
  666. /// <summary>
  667. /// 编辑员工档案
  668. /// </summary>
  669. /// <returns></returns>
  670. private HRResultEntity EditStaffInfo()
  671. {
  672. try
  673. {
  674. /*
  675. //首先将未修改的图片从集合中删除
  676. for (int i = 0; i < _imgList.Count; i++)
  677. {
  678. this._PicByte.RemoveAt(Constant.INT_IS_ZERO);
  679. _smallByte.RemoveAt(Constant.INT_IS_ZERO);
  680. }
  681. _imgList.Clear();
  682. //循环插入图片
  683. for (int i = 0; i < _PicByte.Count; i++)
  684. {
  685. StaffPhotoEntity imgEntity = new StaffPhotoEntity();
  686. imgEntity.ValueFlag = Constant.INT_IS_ONE;
  687. byte[] buffer = _PicByte[i];
  688. imgEntity.Photo = buffer;
  689. imgEntity.Thumbnail = _smallByte[i];
  690. this._imgList.Add(imgEntity);
  691. }
  692. //如果是编辑模式,有被删除的图片,那么要把这些图片也加入到集合中
  693. if (_updateImgList.Count != 0)
  694. {
  695. for (int i = Constant.INT_IS_ZERO; i < _updateImgList.Count; i++)
  696. {
  697. StaffPhotoEntity updateImgEntity = _updateImgList[i];
  698. _imgList.Add(updateImgEntity);
  699. }
  700. }
  701. */
  702. List<StaffPhotoEntity> staffPhoto = new List<StaffPhotoEntity>();
  703. #region Image to byte
  704. byte[] data = null;
  705. using (MemoryStream ms = new MemoryStream())
  706. {
  707. using (Bitmap Bitmap = new Bitmap(this.pic.Image))
  708. {
  709. Bitmap.Save(ms, ImageFormat.Jpeg);
  710. ms.Position = 0;
  711. data = new byte[ms.Length];
  712. ms.Read(data, 0, Convert.ToInt32(ms.Length));
  713. ms.Flush();
  714. }
  715. }
  716. #endregion
  717. staffPhoto.Add(new StaffPhotoEntity() { Photo = data });
  718. return HRModuleProxy.Service.EditStaffInfo(_staffEntity, staffPhoto);
  719. }
  720. catch (Exception ex)
  721. {
  722. throw ex;
  723. }
  724. }
  725. /// <summary>
  726. /// 添加员工档案
  727. /// </summary>
  728. /// <returns></returns>
  729. private object AddStaffInfo()
  730. {
  731. try
  732. {
  733. /*
  734. //首先将未修改的图片从集合中删除
  735. for (int i = 0; i < _imgList.Count; i++)
  736. {
  737. _PicByte.RemoveAt(Constant.INT_IS_ZERO);
  738. _smallByte.RemoveAt(Constant.INT_IS_ZERO);
  739. }
  740. _imgList.Clear();
  741. //循环插入图片
  742. for (int i = 0; i < _PicByte.Count; i++)
  743. {
  744. StaffPhotoEntity imgEntity = new StaffPhotoEntity();
  745. imgEntity.ValueFlag = Constant.INT_IS_ONE;
  746. byte[] buffer = _PicByte[i];
  747. imgEntity.Photo = buffer;
  748. imgEntity.Thumbnail = _smallByte[i];
  749. _imgList.Add(imgEntity);
  750. }
  751. //如果是编辑模式,有被删除的图片,那么要把这些图片也加入到集合中
  752. if (_updateImgList.Count != Constant.INT_IS_ZERO)
  753. {
  754. for (int i = 0; i < _updateImgList.Count; i++)
  755. {
  756. StaffPhotoEntity updateImgEntity = _updateImgList[i];
  757. this._imgList.Add(updateImgEntity);
  758. }
  759. }*/
  760. List<StaffPhotoEntity> staffPhoto = new List<StaffPhotoEntity>();
  761. #region Image to byte
  762. byte[] data = null;
  763. using (MemoryStream ms = new MemoryStream())
  764. {
  765. using (Bitmap Bitmap = new Bitmap(this.pic.Image))
  766. {
  767. Bitmap.Save(ms, ImageFormat.Jpeg);
  768. ms.Position = 0;
  769. data = new byte[ms.Length];
  770. ms.Read(data, 0, Convert.ToInt32(ms.Length));
  771. ms.Flush();
  772. }
  773. }
  774. #endregion
  775. staffPhoto.Add(new StaffPhotoEntity() { Photo = data });
  776. return HRModuleProxy.Service.AddStaffInfo(_staffEntity, staffPhoto);
  777. }
  778. catch (Exception ex)
  779. {
  780. throw ex;
  781. }
  782. }
  783. /// <summary>
  784. /// 是否存在相同的员工编码
  785. /// </summary>
  786. /// <returns></returns>
  787. private DataSet IsExistsStaffCode()
  788. {
  789. try
  790. {
  791. return HRModuleProxy.Service.IsExistsStaffCode(this.txtStaffCode.Text);
  792. }
  793. catch (Exception ex)
  794. {
  795. throw ex;
  796. }
  797. }
  798. /// <summary>
  799. /// 获取明细数据
  800. /// </summary>
  801. /// <returns></returns>
  802. private DataSet GetRowData()
  803. {
  804. try
  805. {
  806. return HRModuleProxy.Service.GetRowData(StaffID);
  807. }
  808. catch (Exception ex)
  809. {
  810. throw ex;
  811. }
  812. }
  813. /// <summary>
  814. /// 获取员工图片
  815. /// </summary>
  816. /// <returns></returns>
  817. private DataSet GetImageByStaffId()
  818. {
  819. try
  820. {
  821. return HRModuleProxy.Service.GetImageByStaffId(StaffID);
  822. }
  823. catch (Exception ex)
  824. {
  825. throw ex;
  826. }
  827. }
  828. /// <summary>
  829. /// 将图片文件转换成二进制
  830. /// </summary>
  831. /// <param name="img"></param>
  832. /// <returns></returns>
  833. public static byte[] ImageToByte(Image img)
  834. {
  835. byte[] smallbuffer = null;
  836. using (MemoryStream ms = new MemoryStream())
  837. {
  838. img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
  839. ms.Position = Constant.INT_IS_ZERO;
  840. smallbuffer = new byte[ms.Length];
  841. ms.Read(smallbuffer, Constant.INT_IS_ZERO, Convert.ToInt32(ms.Length));
  842. ms.Flush();
  843. }
  844. return smallbuffer;
  845. }
  846. /// <SUMMARY>
  847. /// 重绘缩略图并把缩略图转为二进制储存
  848. /// </SUMMARY>
  849. /// <PARAM name="sourceFile">图片源路径</PARAM>
  850. /// <PARAM name="destHeight">缩放后图片高度</PARAM>
  851. /// <PARAM name="destWidth">缩放后图片宽度</PARAM>
  852. /// <RETURNS></RETURNS>
  853. public void GetThumbnail(FileInfo sourceFile)
  854. {
  855. Image imgSource = Image.FromStream(sourceFile.OpenRead());
  856. ImageFormat thisFormat = imgSource.RawFormat;
  857. int sW = 0, sH = 0;
  858. // 按比例缩放
  859. int sWidth = imgSource.Width;
  860. int sHeight = imgSource.Height;
  861. int destWidth = 100;
  862. int destHeight = getSmallImageHeight(sWidth, sHeight, destWidth);
  863. if (sHeight > destHeight || sWidth > destWidth)
  864. {
  865. if ((sWidth * destHeight) > (sHeight * destWidth))
  866. {
  867. sW = destWidth;
  868. sH = (destWidth * sHeight) / sWidth;
  869. }
  870. else
  871. {
  872. sH = destHeight;
  873. sW = (sWidth * destHeight) / sHeight;
  874. }
  875. }
  876. else
  877. {
  878. sW = sWidth;
  879. sH = sHeight;
  880. }
  881. Bitmap outBmp = new Bitmap(destWidth, destHeight);
  882. Graphics g = Graphics.FromImage(outBmp);
  883. g.Clear(Color.Black);
  884. // 设置画布的描绘质量
  885. g.CompositingQuality = CompositingQuality.HighQuality;
  886. g.SmoothingMode = SmoothingMode.HighQuality;
  887. g.InterpolationMode = InterpolationMode.HighQualityBicubic;
  888. g.DrawImage(imgSource, new Rectangle((destWidth - sW) / 2, (destHeight - sH) / 2, sW, sH), 0, 0, imgSource.Width, imgSource.Height, GraphicsUnit.Pixel);
  889. g.Dispose();
  890. //将重绘的图片转为二进制并保存
  891. Image image = (Image)outBmp;
  892. byte[] smallbuffer = ImageToByte(image);
  893. _smallByte.Add(smallbuffer);
  894. imgSource.Dispose();
  895. outBmp.Dispose();
  896. }
  897. /// <summary>
  898. /// 绑定缩略图到控件中
  899. /// </summary>
  900. protected void BindImg()
  901. {
  902. //每次绑定要清空数据源
  903. this.ilPic.Images.Clear();
  904. //将缩略图二进制集合中的数据转换成图片文件
  905. List<Image> LSImageList = new List<Image>();
  906. foreach (byte[] smallby in _smallByte)
  907. {
  908. LSImageList.Add(byteArrayToImage(smallby));
  909. }
  910. //添加数据源
  911. foreach (Image img in LSImageList)
  912. {
  913. ilPic.Images.Add(img);
  914. }
  915. //this.ilPic.ImageSize = new Size(100, 100);
  916. //this.lvPic.LargeImageList = this.ilPic;
  917. //this.lvPic.BeginUpdate();
  918. ////清空列表的数据源
  919. //lvPic.Items.Clear();
  920. ////添加列表的数据源
  921. //for (int i = 0; i < ilPic.Images.Count; i++)
  922. //{
  923. // ListViewItem lvi = new ListViewItem();
  924. // lvi.ImageIndex = i;
  925. // this.lvPic.Items.Add(lvi);
  926. //}
  927. //this.lvPic.EndUpdate();
  928. }
  929. /// <summary>
  930. /// 根据原图片宽高比获取缩略图的高(根据宽)
  931. /// </summary>
  932. /// <param name="BigWidth"></param>
  933. /// <param name="BigHeight"></param>
  934. /// <param name="SmallWidth"></param>
  935. /// <returns></returns>
  936. protected int getSmallImageHeight(int BigWidth, int BigHeight, int SmallWidth)
  937. {
  938. decimal scale = Convert.ToDecimal(BigWidth) / Convert.ToDecimal(BigHeight);
  939. return Convert.ToInt32(SmallWidth / scale);
  940. }
  941. /// <summary>
  942. /// 将数据库中的二进制转换成图片
  943. /// </summary>
  944. /// <param name="data"></param>
  945. /// <returns></returns>
  946. public static Image byteArrayToImage(object data)
  947. {
  948. System.IO.MemoryStream ms = new System.IO.MemoryStream((byte[])data);
  949. System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
  950. return returnImage;
  951. }
  952. /// <summary>
  953. /// 绑定并显示图片
  954. /// </summary>
  955. /// <param name="ImageData"></param>
  956. protected void BindByteImage(DataSet ImageData)
  957. {
  958. foreach (DataRow dr in ImageData.Tables[0].Rows)
  959. {
  960. //将数据库中的缩略图取出
  961. //_smallByte.Add((byte[])dr[2]);
  962. //_PicByte.Add((byte[])dr[3]);
  963. MemoryStream ms = new MemoryStream((byte[])dr[3]);
  964. Image img = Image.FromStream(ms);
  965. this.pic.Image = img;
  966. //绑定实体到修改图片集合中
  967. StaffPhotoEntity imgEntity = new StaffPhotoEntity();
  968. imgEntity.StaffPhotoID = Convert.ToInt32(dr[0]);
  969. imgEntity.StaffID = Convert.ToInt32(dr[1]);
  970. imgEntity.Thumbnail = (byte[])dr[2];
  971. imgEntity.Photo = (byte[])dr[3];
  972. imgEntity.AccountID = Convert.ToInt32(dr[4]);
  973. imgEntity.ValueFlag = Convert.ToInt32(dr[5]);
  974. imgEntity.CreateTime = Convert.ToDateTime(dr[6]);
  975. imgEntity.CreateUserID = Convert.ToInt32(dr[7]);
  976. imgEntity.UpdateTime = Convert.ToDateTime(dr[8]);
  977. imgEntity.UpdateUserID = Convert.ToInt32(dr[9]);
  978. imgEntity.OPTimeStamp = Convert.ToDateTime(dr[10]);
  979. _imgList.Add(imgEntity);
  980. }
  981. //绑定缩略图
  982. //BindImg();
  983. }
  984. /// <summary>
  985. /// 获取性别数据源
  986. /// </summary>
  987. /// <returns></returns>
  988. private DataTable GetSystemParameterByName()
  989. {
  990. DataTable dtSystemParameterByName = null;
  991. try
  992. {
  993. dtSystemParameterByName = LogInUserInfo.CurrentUser.GetSystemParameterByName(Constant.SysCacheTable.TP_SYS_Gender, "displayno ASC");
  994. }
  995. catch (Exception ex)
  996. {
  997. // 对异常进行共通处理
  998. ExceptionManager.HandleEventException(this.ToString(),
  999. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  1000. }
  1001. return dtSystemParameterByName;
  1002. }
  1003. /// <summary>
  1004. /// 获取婚姻状况数据源
  1005. /// </summary>
  1006. /// <returns></returns>
  1007. private DataTable GetSystemParameterByNameMaritalStatu()
  1008. {
  1009. DataTable dtSystemParameterByName = null;
  1010. try
  1011. {
  1012. dtSystemParameterByName = LogInUserInfo.CurrentUser.GetSystemParameterByName(Constant.SysCacheTable.TP_SYS_MaritalStatus, "displayno ASC");
  1013. }
  1014. catch (Exception ex)
  1015. {
  1016. // 对异常进行共通处理
  1017. ExceptionManager.HandleEventException(this.ToString(),
  1018. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  1019. }
  1020. return dtSystemParameterByName;
  1021. }
  1022. /// <summary>
  1023. /// 获取民族数据源
  1024. /// </summary>
  1025. /// <returns></returns>
  1026. private DataTable GetSystemParameterByNameNational()
  1027. {
  1028. DataTable dtSystemParameterByName = null;
  1029. try
  1030. {
  1031. return LogInUserInfo.CurrentUser.GetSystemParameterByName(Constant.SysCacheTable.TP_SYS_National, "displayno ASC");
  1032. }
  1033. catch (Exception ex)
  1034. {
  1035. // 对异常进行共通处理
  1036. ExceptionManager.HandleEventException(this.ToString(),
  1037. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  1038. }
  1039. return dtSystemParameterByName;
  1040. }
  1041. /// <summary>
  1042. /// 获取学历数据源
  1043. /// </summary>
  1044. /// <returns></returns>
  1045. private DataTable GetSystemParameterByNameEducational()
  1046. {
  1047. DataTable dtSystemParameterByName = null;
  1048. try
  1049. {
  1050. dtSystemParameterByName = LogInUserInfo.CurrentUser.GetSystemParameterByName(Constant.SysCacheTable.TP_SYS_Educational, "displayno ASC");
  1051. }
  1052. catch (Exception ex)
  1053. {
  1054. // 对异常进行共通处理
  1055. ExceptionManager.HandleEventException(this.ToString(),
  1056. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  1057. }
  1058. return dtSystemParameterByName;
  1059. }
  1060. /// <summary>
  1061. /// 获取工种数据
  1062. /// </summary>
  1063. /// <returns></returns>
  1064. private DataTable GetJobsData()
  1065. {
  1066. DataTable returntJobsData = null;
  1067. try
  1068. {
  1069. returntJobsData = SystemModuleProxy.Service.GetJobsData(0).Tables[0];
  1070. }
  1071. catch (Exception ex)
  1072. {
  1073. // 对异常进行共通处理
  1074. ExceptionManager.HandleEventException(this.ToString(),
  1075. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  1076. }
  1077. return returntJobsData;
  1078. }
  1079. /// <summary>
  1080. /// 获取职务数据
  1081. /// </summary>
  1082. /// <returns></returns>
  1083. private DataTable GetPostData()
  1084. {
  1085. DataTable returntPostData = null;
  1086. try
  1087. {
  1088. returntPostData = SystemModuleProxy.Service.GetPostData(0).Tables[0];
  1089. }
  1090. catch (Exception ex)
  1091. {
  1092. // 对异常进行共通处理
  1093. ExceptionManager.HandleEventException(this.ToString(),
  1094. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  1095. }
  1096. return returntPostData;
  1097. }
  1098. #endregion
  1099. }
  1100. }