F_PM_0108.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*******************************************************************************
  2. * Copyright(c) 2015 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_0108.cs
  5. * 2.功能描述:取消某天某批次注浆登记
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 秦祺 2025/07/28 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Reflection;
  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.Client.Controls;
  18. using Dongke.IBOSS.PRD.WCF.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.Proxys;
  20. namespace Dongke.IBOSS.PRD.Client.PMModule
  21. {
  22. /// <summary>
  23. /// 取消某天某批次注浆登记
  24. /// </summary>
  25. public partial class F_PM_0108 : DKFormBase
  26. {
  27. #region 成员变量
  28. private DataSet _data = null;
  29. #endregion
  30. #region 构造函数
  31. /// <summary>
  32. /// 构造函数
  33. /// </summary>
  34. public F_PM_0108()
  35. {
  36. this.InitializeComponent();
  37. // 为各个控件文本赋值
  38. this.InitializeControls();
  39. }
  40. #endregion
  41. #region 属性
  42. /// <summary>
  43. /// 注浆日报ID
  44. /// </summary>
  45. public string GroutingLineCode
  46. {
  47. get;
  48. private set;
  49. }
  50. /// <summary>
  51. /// 是否在开模报损中使用
  52. /// </summary>
  53. public bool IsBarCodeScrapReasonUseFlag
  54. {
  55. get;
  56. set;
  57. }
  58. #endregion
  59. #region 控件事件
  60. /// <summary>
  61. /// 页面Load事件
  62. /// </summary>
  63. /// <param name="sender"></param>
  64. /// <param name="e"></param>
  65. private void F_PM_0108_Load(object sender, EventArgs e)
  66. {
  67. }
  68. /// <summary>
  69. /// 查询按钮按下事件
  70. /// </summary>
  71. /// <param name="sender"></param>
  72. /// <param name="e"></param>
  73. private void btnSearch_Click(object sender, System.EventArgs e)
  74. {
  75. string glcode = this.txtGroutingLineCode.Text.Trim();
  76. string pici = this.txtpici.Text.Trim();
  77. if (string.IsNullOrWhiteSpace(glcode))
  78. {
  79. MessageBox.Show("请输入成型线编码",this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  80. this.txtGroutingLineCode.Focus();
  81. return;
  82. }
  83. if (string.IsNullOrWhiteSpace(pici))
  84. {
  85. MessageBox.Show("请输入批次", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  86. this.txtpici.Focus();
  87. return;
  88. }
  89. try
  90. {
  91. ClientRequestEntity cre = new ClientRequestEntity();
  92. cre.NameSpace = "F_PM_0108";
  93. cre.Name = "CheckFPM0108GLCode";
  94. cre.Properties["glcode"] = glcode;
  95. cre.Properties["pici"] = pici;
  96. cre.Properties["txtGroutingDateBegin"] = this.txtGroutingDateBegin.Text;
  97. // 根据注浆日期、成型线获取所有可注浆模具信息
  98. ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
  99. {
  100. return PMModuleProxyNew.Service.HandleRequest(cre);
  101. }
  102. );
  103. // 异常情况处理
  104. if (sre.Status == Constant.ServiceResultStatus.Success)
  105. {
  106. _data = sre.Data;
  107. DataRow dataRow = _data.Tables[0].Rows[0];
  108. this.txtTextBox1.Text =
  109. $"成型线编码 :{dataRow["GroutingLineCode"]} " + Environment.NewLine + Environment.NewLine +
  110. $"注浆日期:{(dataRow["GroutingDate"] as DateTime?)?.ToString("yyyy-MM-dd")?? dataRow["GroutingDate"]+""} " + Environment.NewLine + Environment.NewLine +
  111. $"注浆批次:{dataRow["GroutingBatchNo"]} " + Environment.NewLine + Environment.NewLine +
  112. $"成型工号 :{dataRow["usercode"]} "
  113. ;
  114. this.btnOK.Enabled = true;
  115. return;
  116. }
  117. _data = null;
  118. this.btnOK.Enabled = false;
  119. MessageBox.Show(sre.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  120. }
  121. catch (Exception ex)
  122. {
  123. // 对异常进行共通处理
  124. ExceptionManager.HandleEventException(this.ToString(),
  125. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  126. }
  127. }
  128. /// <summary>
  129. /// 确定按钮按下事件
  130. /// </summary>
  131. /// <param name="sender"></param>
  132. /// <param name="e"></param>
  133. private void btnOK_Click(object sender, System.EventArgs e)
  134. {
  135. if (_data == null)
  136. {
  137. return;
  138. }
  139. try
  140. {
  141. ClientRequestEntity cre = new ClientRequestEntity();
  142. cre.NameSpace = "F_PM_0108";
  143. cre.Name = "SetFPM0108GLCode";
  144. cre.Data = _data;
  145. // 根据注浆日期、成型线获取所有可注浆模具信息
  146. ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
  147. {
  148. return PMModuleProxyNew.Service.HandleRequest(cre);
  149. }
  150. );
  151. // 异常情况处理
  152. if (sre.Status == Constant.ServiceResultStatus.Success)
  153. {
  154. DialogResult dr = MessageBox.Show("撤销成功,是否关闭画面", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  155. if (dr == DialogResult.Yes)
  156. {
  157. this.Close();
  158. }
  159. _data = null;
  160. this.txtGroutingLineCode.Clear();
  161. this.txtTextBox1.Clear();
  162. this.btnOK.Enabled = false;
  163. return;
  164. }
  165. MessageBox.Show(sre.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  166. }
  167. catch (Exception ex)
  168. {
  169. // 对异常进行共通处理
  170. ExceptionManager.HandleEventException(this.ToString(),
  171. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  172. }
  173. }
  174. /// <summary>
  175. /// 关闭按钮按下事件
  176. /// </summary>
  177. /// <param name="sender"></param>
  178. /// <param name="e"></param>
  179. private void btnClose_Click(object sender, System.EventArgs e)
  180. {
  181. this.DialogResult = DialogResult.Cancel;
  182. this.Close();
  183. }
  184. #endregion
  185. #region 私有方法/函数
  186. /// <summary>
  187. /// 初始化控件
  188. /// </summary>
  189. private void InitializeControls()
  190. {
  191. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  192. this.btnOK.Text = ButtonText.BTN_OK;
  193. this.btnCancel.Text = ButtonText.BTN_CANCEL;
  194. }
  195. #endregion
  196. private void txtGroutingLineCode_KeyPress(object sender, KeyPressEventArgs e)
  197. {
  198. if (e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE)
  199. {
  200. btnSearch_Click(null, null);
  201. }
  202. }
  203. }
  204. }