F_SYS_0211.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*******************************************************************************
  2. * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_SYS_0211.cs
  5. * 2.功能描述:更新履历
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2017/9/8 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Windows.Forms;
  12. using Dongke.IBOSS.PRD.Basics.BaseResources;
  13. using Dongke.IBOSS.PRD.Client.CommonModule;
  14. using Dongke.IBOSS.PRD.Client.Controls;
  15. using Dongke.IBOSS.PRD.Client.DataModels;
  16. using Dongke.IBOSS.PRD.WCF.DataModels;
  17. using Dongke.IBOSS.PRD.WCF.Proxys;
  18. namespace Dongke.IBOSS.PRD.Client
  19. {
  20. public partial class F_SYS_0211 : DKDockPanelBase
  21. {
  22. #region 成员变量
  23. // 窗体的单例模式
  24. private static F_SYS_0211 _instance;
  25. #endregion
  26. #region 构造函数
  27. public F_SYS_0211()
  28. {
  29. InitializeComponent();
  30. // 窗体显示的Title
  31. this.Text = "更新履历";
  32. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  33. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  34. this.dgvReportModule.IsOpenMergeCellFlag = true;
  35. this.dgvReportModule.MergeOnlyColumn = "version";
  36. this.dgvReportModule.MergeColumnNames = new System.Collections.Generic.List<string>();
  37. this.dgvReportModule.MergeColumnNames.Add("version");
  38. this.dgvReportModule.MergeColumnNames.Add("releasedate");
  39. this.dgvReportModule.MergeColumnNames.Add("upgradetime");
  40. }
  41. #endregion
  42. #region 单例模式
  43. /// <summary>
  44. /// 单例模式,防止重复创建窗体
  45. /// </summary>
  46. public static F_SYS_0211 Instance
  47. {
  48. get
  49. {
  50. if (_instance == null || _instance.IsDisposed)
  51. {
  52. _instance = new F_SYS_0211();
  53. }
  54. return _instance;
  55. }
  56. }
  57. #endregion
  58. #region 事件处理
  59. /// <summary>
  60. /// 窗体加载事件
  61. /// </summary>
  62. /// <param name="sender"></param>
  63. /// <param name="e"></param>
  64. private void F_SYS_0211_Load(object sender, EventArgs e)
  65. {
  66. try
  67. {
  68. // 加载权限
  69. FormPermissionManager.FormPermissionControl(this.Name, this,
  70. LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  71. LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  72. // 设置表格不自动创建列
  73. this.dgvReportModule.AutoGenerateColumns = false;
  74. ClientRequestEntity cre = new ClientRequestEntity();
  75. cre.NameSpace = "SYS02";
  76. cre.Name = "GetSYS0211";
  77. // 调用服务器端获取数据集(DataSet)DoAsync(new BaseAsyncMethod(GetSystemData));
  78. ServiceResultEntity sre = (ServiceResultEntity)DoAsync(() =>
  79. {
  80. return CommonModuleProxy.Service.DoRequest(cre);
  81. }
  82. );
  83. if (sre.Status == Constant.ServiceResultStatus.Success)
  84. {
  85. this.dgvReportModule.DataSource = sre.Data.Tables[0];
  86. }
  87. }
  88. catch (Exception ex)
  89. {
  90. // 对异常进行共通处理
  91. ExceptionManager.HandleEventException(this.ToString(),
  92. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  93. }
  94. }
  95. /// <summary>
  96. /// 窗体关闭事件
  97. /// </summary>
  98. /// <param name="sender"></param>
  99. /// <param name="e"></param>
  100. private void F_SYS_0211_FormClosed(object sender, FormClosedEventArgs e)
  101. {
  102. _instance = null;
  103. }
  104. /// <summary>
  105. /// 关闭按钮
  106. /// </summary>
  107. /// <param name="sender"></param>
  108. /// <param name="e"></param>
  109. private void tsbtnClose_Click(object sender, EventArgs e)
  110. {
  111. this.Close();
  112. }
  113. /// <summary>
  114. /// 自动适应列宽
  115. /// </summary>
  116. /// <param name="sender"></param>
  117. /// <param name="e"></param>
  118. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  119. {
  120. this.dgvReportModule.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  121. }
  122. #endregion
  123. #region 私有方法
  124. #endregion
  125. }
  126. }