F_PM_0105.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. /*******************************************************************************
  2. * Copyright(c) 2015 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_0105.cs
  5. * 2.功能描述:能绑定条码的注浆登记选择画面
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 欧阳涛 2015/03/27 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_0105 : DKFormBase
  26. {
  27. #region 成员变量
  28. #endregion
  29. #region 构造函数
  30. /// <summary>
  31. /// 构造函数
  32. /// </summary>
  33. public F_PM_0105()
  34. {
  35. this.InitializeComponent();
  36. // 为各个控件文本赋值
  37. this.InitializeControls();
  38. }
  39. #endregion
  40. #region 属性
  41. /// <summary>
  42. /// 注浆日报ID
  43. /// </summary>
  44. public int GroutingDailyID
  45. {
  46. get;
  47. private set;
  48. }
  49. /// <summary>
  50. /// 注浆日期
  51. /// </summary>
  52. public DateTime GroutingDate
  53. {
  54. get
  55. {
  56. return this.dtpGroutingDate.Value.Date;
  57. }
  58. set
  59. {
  60. this.dtpGroutingDate.Value = value;
  61. }
  62. }
  63. /// <summary>
  64. /// 是否在开模报损中使用
  65. /// </summary>
  66. public bool IsBarCodeScrapReasonUseFlag
  67. {
  68. get;
  69. set;
  70. }
  71. #endregion
  72. #region 控件事件
  73. /// <summary>
  74. /// 页面Load事件
  75. /// </summary>
  76. /// <param name="sender"></param>
  77. /// <param name="e"></param>
  78. private void F_PM_0105_Load(object sender, EventArgs e)
  79. {
  80. }
  81. /// <summary>
  82. /// 查询按钮按下事件
  83. /// </summary>
  84. /// <param name="sender"></param>
  85. /// <param name="e"></param>
  86. private void btnSearch_Click(object sender, System.EventArgs e)
  87. {
  88. try
  89. {
  90. FPM0104_SE se = new FPM0104_SE();
  91. se.GroutingDate = this.dtpGroutingDate.Value.Date;
  92. se.GroutingLineCode = this.txtGroutingLineCode.Text;
  93. se.GroutingLineName = this.txtGroutingLineName.Text;
  94. se.GroutingUserCode = this.txtUserCode.Text;
  95. se.IsBarCodeScrapReasonUseFlag = IsBarCodeScrapReasonUseFlag;
  96. if (this.txtGroutingBatchNo.DataValue.HasValue)
  97. {
  98. se.GroutingBatchNo = System.Convert.ToInt32(this.txtGroutingBatchNo.DataValue);
  99. }
  100. // 根据注浆日期、成型线获取所有可注浆模具信息
  101. ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
  102. {
  103. return PMModuleProxyNew.Service.GetFPM0105SData(se);
  104. }
  105. );
  106. this.dgvGroutingDaily.DataSource = null;
  107. // 异常情况处理
  108. if (sre.Status == Constant.ServiceResultStatus.Success)
  109. {
  110. this.dgvGroutingDaily.DataSource = sre.Data.Tables[0];
  111. }
  112. else if (sre.Status == Constant.ServiceResultStatus.Other)
  113. {
  114. if (sre.OtherStatus == -1)
  115. {
  116. MessageBox.Show(sre.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  117. }
  118. }
  119. }
  120. catch (Exception ex)
  121. {
  122. // 对异常进行共通处理
  123. ExceptionManager.HandleEventException(this.ToString(),
  124. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  125. }
  126. }
  127. /// <summary>
  128. /// 确定按钮按下事件
  129. /// </summary>
  130. /// <param name="sender"></param>
  131. /// <param name="e"></param>
  132. private void btnOK_Click(object sender, System.EventArgs e)
  133. {
  134. try
  135. {
  136. if (this.dgvGroutingDaily.CurrentRow == null)
  137. {
  138. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_C_001);
  139. return;
  140. }
  141. this.GroutingDailyID = Convert.ToInt32(this.dgvGroutingDaily.CurrentRow.Cells["colGroutingDailyID"].Value);
  142. this.DialogResult = DialogResult.OK;
  143. this.Close();
  144. }
  145. catch (Exception ex)
  146. {
  147. // 对异常进行共通处理
  148. ExceptionManager.HandleEventException(this.ToString(),
  149. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  150. }
  151. }
  152. /// <summary>
  153. /// 双击单元格
  154. /// </summary>
  155. /// <param name="sender"></param>
  156. /// <param name="e"></param>
  157. private void dgvGroutingDaily_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  158. {
  159. try
  160. {
  161. if (this.dgvGroutingDaily.CurrentRow == null)
  162. {
  163. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_C_001);
  164. return;
  165. }
  166. this.GroutingDailyID = Convert.ToInt32(this.dgvGroutingDaily.CurrentRow.Cells["colGroutingDailyID"].Value);
  167. this.DialogResult = DialogResult.OK;
  168. this.Close();
  169. }
  170. catch (Exception ex)
  171. {
  172. // 对异常进行共通处理
  173. ExceptionManager.HandleEventException(this.ToString(),
  174. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  175. }
  176. }
  177. /// <summary>
  178. /// 关闭按钮按下事件
  179. /// </summary>
  180. /// <param name="sender"></param>
  181. /// <param name="e"></param>
  182. private void btnClose_Click(object sender, System.EventArgs e)
  183. {
  184. this.DialogResult = DialogResult.Cancel;
  185. this.Close();
  186. }
  187. #endregion
  188. #region 私有方法/函数
  189. /// <summary>
  190. /// 初始化控件
  191. /// </summary>
  192. private void InitializeControls()
  193. {
  194. this.Text = FormTitles.F_PM_0105;
  195. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  196. this.btnOK.Text = ButtonText.BTN_OK;
  197. this.btnCancel.Text = ButtonText.BTN_CANCEL;
  198. // 取客户端当天日期
  199. this.dtpGroutingDate.Value = DateTime.Now.Date;
  200. this.dgvGroutingDaily.AutoGenerateColumns = false;
  201. this.dgvGroutingDaily.ReadOnly = true;
  202. }
  203. #endregion
  204. private void btnClearCondition_Click(object sender, EventArgs e)
  205. {
  206. this.txtGroutingBatchNo.Clear();
  207. this.txtGroutingLineCode.Clear();
  208. this.txtUserCode.Clear();
  209. this.txtGroutingLineName.Clear();
  210. this.dtpGroutingDate.Value = DateTime.Now.Date;
  211. }
  212. private void btnAdaptive_Click(object sender, EventArgs e)
  213. {
  214. this.dgvGroutingDaily.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  215. }
  216. }
  217. }