F_PC_0501.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PC_0501.cs
  5. * 2.功能描述:成型线变产履历
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 庄天威 2014/09/28 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. namespace Dongke.IBOSS.PRD.Client.PCModule
  21. {
  22. public partial class F_PC_0501 : DockPanelBase
  23. {
  24. #region 成员变量
  25. private static F_PC_0501 _instance;
  26. public GetLineChangeEntity _glcEntity;
  27. #endregion
  28. #region 构造函数
  29. public F_PC_0501()
  30. {
  31. InitializeComponent();
  32. }
  33. #endregion
  34. #region 单例模式
  35. /// <summary>
  36. /// 单例模式,防止重复创建窗体
  37. /// </summary>
  38. public static F_PC_0501 Instance
  39. {
  40. get
  41. {
  42. if (_instance == null)
  43. {
  44. _instance = new F_PC_0501();
  45. }
  46. return _instance;
  47. }
  48. }
  49. #endregion
  50. #region 事件处理
  51. private void F_PC_0501_Load(object sender, EventArgs e)
  52. {
  53. this.Text = FormTitles.F_PC_0501;
  54. }
  55. private void btnSearch_Click(object sender, EventArgs e)
  56. {
  57. try
  58. {
  59. this.BindEntity();
  60. DataSet dsSourse = (DataSet)DoAsync(this.GetGridInfo);
  61. if (dsSourse != null)
  62. {
  63. if (dsSourse.Tables.Count != Constant.INT_IS_ZERO)
  64. {
  65. this.dgvChangeInfo.DataSource = dsSourse.Tables[0];
  66. this.dgvChangeInfo.ReadOnly = true;
  67. if (this.dgvChangeInfo.Rows.Count == Constant.INT_IS_ZERO)
  68. {
  69. // 提示未查找到数据
  70. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  71. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  72. }
  73. }
  74. }
  75. else
  76. {
  77. // 提示未查找到数据
  78. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  79. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  80. }
  81. }
  82. catch(Exception ex)
  83. {
  84. // 对异常进行共通处理
  85. ExceptionManager.HandleEventException(this.ToString(),
  86. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  87. }
  88. }
  89. private void btnClearCondition_Click(object sender, EventArgs e)
  90. {
  91. this.txtBuildingNo.Text = "";
  92. this.txtFloorNo.Text = "";
  93. this.txtGroutingLineNo.Text = "";
  94. this.txtGroutingLineCode.Text = "";
  95. this.txtGoodsCodeB.Text = "";
  96. this.txtGoodsCodeA.Text = "";
  97. this.cblStartTime.Checked = false;
  98. this.cblEndTime.Checked = false;
  99. }
  100. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  101. {
  102. this.dgvChangeInfo.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  103. }
  104. private void tsbtnClose_Click(object sender, EventArgs e)
  105. {
  106. this.Close();
  107. }
  108. private void cblStartTime_CheckedChanged(object sender, EventArgs e)
  109. {
  110. this.dtpStartTime.Enabled = this.cblStartTime.Checked;
  111. }
  112. private void cblEndTime_CheckedChanged(object sender, EventArgs e)
  113. {
  114. this.cblEndTime.Enabled = this.cblEndTime.Checked;
  115. }
  116. #endregion
  117. private void F_PC_0501_FormClosed(object sender, FormClosedEventArgs e)
  118. {
  119. _instance = null;
  120. }
  121. #region 私有方法
  122. private void BindEntity()
  123. {
  124. _glcEntity = new GetLineChangeEntity();
  125. this.dgvChangeInfo.AutoGenerateColumns = false;
  126. _glcEntity.BuildingNo = this.txtBuildingNo.Text.Trim();
  127. _glcEntity.FloorNo = this.txtFloorNo.Text.Trim();
  128. _glcEntity.GroutingLineNo = this.txtGroutingLineNo.Text.Trim();
  129. _glcEntity.GroutingLineCode = this.txtGroutingLineCode.Text.Trim();
  130. _glcEntity.GoodsCodeB = this.txtGoodsCodeB.Text.Trim();
  131. _glcEntity.GoodSCodeA = this.txtGoodsCodeA.Text.Trim();
  132. if (this.cblStartTime.Checked)
  133. {
  134. _glcEntity.BeginDate = this.dtpStartTime.Value.Date;
  135. }
  136. if (this.cblEndTime.Checked)
  137. {
  138. _glcEntity.EndDate = this.dtpEndTime.Value.Date;
  139. }
  140. }
  141. private DataSet GetGridInfo()
  142. {
  143. return PCModuleProxy.Service.GetLineChange(this._glcEntity);
  144. }
  145. #endregion
  146. }
  147. }