FrmPersonalCenter.cs 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. 
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using LYFZ.Software.MainBusiness.DoorCityProcess;
  11. namespace LYFZ.Software.MainBusiness.InitialSet
  12. {
  13. public partial class FrmPersonalCenter : LYFZ.Software.UI.InitialSet.FrmPersonalCenter
  14. {
  15. public delegate void UpdateControl();
  16. public FrmPersonalCenter()
  17. {
  18. }
  19. #region 加载
  20. protected override void FrmPersonalCenter_Shown(object sender, EventArgs e)
  21. {
  22. try
  23. {
  24. LYFZ.BLL.BaseBLL.BaseBLL_ErpUser userbll = new BLL.BaseBLL.BaseBLL_ErpUser();
  25. string User_EmployeeID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  26. DataTable dt = userbll.GetList("User_EmployeeID='" + User_EmployeeID + "'").Tables[0];
  27. if (dt.Rows.Count > 0)
  28. {
  29. lblUser_Name.Text = dt.Rows[0]["User_Name"].ToString();
  30. lblUser_Account.Text = dt.Rows[0]["User_Account"].ToString();
  31. lblUser_Sex.Text = dt.Rows[0]["User_Sex"].ToString();
  32. lblUser_Telephone.Text = dt.Rows[0]["User_Telephone"].ToString();
  33. lblUser_IsMarried.Text = Convert.ToBoolean(dt.Rows[0]["User_IsMarried"].ToString()) == true ? "已婚" : "未婚";
  34. lblUser_Ethnic.Text = dt.Rows[0]["User_Ethnic"].ToString();
  35. lblUser_Hometown.Text = dt.Rows[0]["User_Hometown"].ToString();
  36. lblUser_JobNumber.Text = dt.Rows[0]["User_JobNumber"].ToString();
  37. lblUser_IdentityCardID.Text = dt.Rows[0]["User_IdentityCardID"].ToString();
  38. lblUser_NowAddress.Text = dt.Rows[0]["User_NowAddress"].ToString();
  39. lblUser_HometownAddress.Text = dt.Rows[0]["User_HometownAddress"].ToString();
  40. System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate()
  41. {
  42. try
  43. {
  44. this.Invoke(new UpdateControl(delegate()
  45. {
  46. if (!string.IsNullOrEmpty(dt.Rows[0]["User_HeadImgePath"].ToString()))
  47. {
  48. picUser_HeadImgePath.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(dt.Rows[0]["User_HeadImgePath"].ToString()));
  49. }
  50. else { this.picUser_HeadImgePath.Image = null; }
  51. if (!string.IsNullOrEmpty(dt.Rows[0]["User_PositiveID"].ToString()))
  52. {
  53. picUser_PositiveID.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(dt.Rows[0]["User_PositiveID"].ToString()));
  54. }
  55. else { this.picUser_PositiveID.Image = null; }
  56. if (!string.IsNullOrEmpty(dt.Rows[0]["User_IDNegative"].ToString()))
  57. {
  58. picUser_IDNegative.Image = PublicCodeClasses.GetImage(PublicCodeClasses.StringToByte(dt.Rows[0]["User_IDNegative"].ToString()));
  59. }
  60. else { this.picUser_IDNegative.Image = null; }
  61. }));
  62. }
  63. catch { }
  64. }));
  65. t.Start();
  66. }
  67. }
  68. catch (Exception ex)
  69. {
  70. MessageBoxCustom.Show(ex.Message);
  71. }
  72. }
  73. #endregion
  74. }
  75. }