F_PM_0107.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_0107.cs
  5. * 2.功能描述:成型线管理
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2015/09/15 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.BaseResources;
  15. using Dongke.IBOSS.PRD.Basics.DockPanel;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.WCF.DataModels;
  18. using Dongke.IBOSS.PRD.WCF.Proxys;
  19. using Dongke.IBOSS.PRD.WCF.Proxys.PCModuleService;
  20. using Dongke.WinForm.Controls;
  21. namespace Dongke.IBOSS.PRD.Client.PMModule
  22. {
  23. public partial class F_PM_0107 : FormDialog
  24. {
  25. #region 成员变量
  26. #endregion
  27. #region 构造函数
  28. /// <summary>
  29. /// 构造函数
  30. /// </summary>
  31. public F_PM_0107()
  32. {
  33. InitializeComponent();
  34. // 标题
  35. Text = FormTitles.F_PM_0107;
  36. // 按钮
  37. btnReStart.Text = ButtonText.BTN_RESTART;
  38. btnClose.Text = ButtonText.BTN_CLOSE;
  39. }
  40. #endregion
  41. #region 事件处理
  42. /// <summary>
  43. /// 页面加载事件
  44. /// </summary>
  45. /// <param name="sender"></param>
  46. /// <param name="e"></param>
  47. private void F_PC_0104_Load(object sender, EventArgs e)
  48. {
  49. try
  50. {
  51. // 获取3#高压注浆线数据
  52. GetGroutingLine3Data();
  53. }
  54. catch (Exception ex)
  55. {
  56. // 对异常进行共通处理
  57. ExceptionManager.HandleEventException(ToString(),
  58. System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
  59. }
  60. }
  61. /// <summary>
  62. /// 重启按钮点击事件
  63. /// </summary>
  64. /// <param name="sender"></param>
  65. /// <param name="e"></param>
  66. private void btnReStart_Click(object sender, EventArgs e)
  67. {
  68. try
  69. {
  70. if (dgvGroutingLine.CurrentRow == null)
  71. {
  72. return;
  73. }
  74. DataRow row = (dgvGroutingLine.CurrentRow.DataBoundItem as DataRowView).Row;
  75. DialogResult drs = MessageBox.Show(
  76. string.Format("请确认是否重启高压注浆线【{0}】?确定后注浆批次号将增加,注浆批次序号将重置。", row["H_LineCode"]),
  77. Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
  78. if (drs == DialogResult.No)
  79. {
  80. return;
  81. }
  82. // 异步处理
  83. ClientRequestEntity cre = new ClientRequestEntity();
  84. cre.NameSpace = "F_PM_0107";
  85. cre.Name = "SaveGroutingLine3";
  86. cre.Properties["GroutingLineID"] = row["GroutingLineID"];
  87. cre.Properties["H_BatchNo"] = row["H_BatchNo"];
  88. ServiceResultEntity sre = null;
  89. DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }, out sre);
  90. if (sre.Status == Constant.ServiceResultStatus.Success)
  91. {
  92. if (sre.OtherStatus > 0)
  93. {
  94. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "高压注浆线", "重启"), Text,
  95. MessageBoxButtons.OK, MessageBoxIcon.Information);
  96. // 获取3#高压注浆线数据
  97. GetGroutingLine3Data();
  98. }
  99. else if (sre.OtherStatus < 0 && !string.IsNullOrEmpty(sre.Message))
  100. {
  101. MessageBox.Show(string.Format(Messages.MSG_CMN_W007, sre.Message), Text,
  102. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  103. }
  104. else
  105. {
  106. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "高压注浆线", "重启"), Text,
  107. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  108. }
  109. }
  110. else
  111. {
  112. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "高压注浆线", "重启"), Text,
  113. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  114. }
  115. }
  116. catch (Exception ex)
  117. {
  118. // 对异常进行共通处理
  119. ExceptionManager.HandleEventException(ToString(),
  120. System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
  121. }
  122. }
  123. /// <summary>
  124. /// 关闭按钮点击事件
  125. /// </summary>
  126. /// <param name="sender"></param>
  127. /// <param name="e"></param>
  128. private void btnClose_Click(object sender, EventArgs e)
  129. {
  130. Close();
  131. }
  132. #endregion
  133. #region 私有方法
  134. /// <summary>
  135. /// 获取3#高压注浆线数据
  136. /// </summary>
  137. private void GetGroutingLine3Data()
  138. {
  139. try
  140. {
  141. // 异步处理
  142. ClientRequestEntity cre = new ClientRequestEntity();
  143. cre.NameSpace = "F_PM_0107";
  144. cre.Name = "GetGroutingLine3";
  145. ServiceResultEntity sre = null;
  146. DoAsync(() => { return PMModuleProxyNew.Service.HandleRequest(cre); }, out sre);
  147. if (sre.Status == Constant.ServiceResultStatus.Success)
  148. {
  149. if (sre.Data != null && sre.Data.Tables.Count > 0)
  150. {
  151. dgvGroutingLine.DataSource = sre.Data.Tables[0];
  152. }
  153. }
  154. dgvGroutingLine.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  155. }
  156. catch (Exception ex)
  157. {
  158. throw ex;
  159. }
  160. }
  161. #endregion
  162. }
  163. }