F_RPT_080118.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*******************************************************************************
  2. * 类的信息:
  3. * 1.程序名称:F_RPT_080118.cs
  4. * 2.功能描述:QC检验计划分析明细表
  5. * 编辑履历:
  6. * 作者 日期 版本 修改内容
  7. * 李士越 2024/6/17 1.00 新建
  8. *******************************************************************************/
  9. using System;
  10. using System.Data;
  11. using System.Text;
  12. using System.Windows.Forms;
  13. using Dongke.IBOSS.PRD.Basics.BaseResources;
  14. using Dongke.IBOSS.PRD.Basics.DockPanel;
  15. using Dongke.IBOSS.PRD.Client.CommonModule;
  16. using Dongke.IBOSS.PRD.Client.Controls;
  17. using Dongke.IBOSS.PRD.Client.DataModels;
  18. using Dongke.IBOSS.PRD.WCF.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.Proxys;
  20. using System.Collections.Generic;
  21. namespace Dongke.IBOSS.PRD.Client.ReportModule
  22. {
  23. /// <summary>
  24. /// QC检验计划分析明细表
  25. /// </summary>
  26. public partial class F_RPT_080118 : DKDockPanelBase
  27. {
  28. #region 成员变量
  29. // 窗体的单例模式
  30. private static F_RPT_080118 _instance;
  31. #endregion
  32. #region 构造函数
  33. public F_RPT_080118()
  34. {
  35. InitializeComponent();
  36. // 窗体显示的Title
  37. this.Text = "裸瓷非工序撤销明细表";
  38. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  39. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  40. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  41. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  42. this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS;
  43. }
  44. #endregion
  45. #region 单例模式
  46. /// <summary>
  47. /// 单例模式,防止重复创建窗体
  48. /// </summary>
  49. public static F_RPT_080118 Instance
  50. {
  51. get
  52. {
  53. if (_instance == null || _instance.IsDisposed)
  54. {
  55. _instance = new F_RPT_080118();
  56. }
  57. return _instance;
  58. }
  59. }
  60. #endregion
  61. #region 事件处理
  62. /// <summary>
  63. /// 窗体加载事件
  64. /// </summary>
  65. /// <param name="sender"></param>
  66. /// <param name="e"></param>
  67. private void F_RPT_080118_Load(object sender, EventArgs e)
  68. {
  69. try
  70. {
  71. // 加载权限
  72. FormPermissionManager.FormPermissionControl(this.Name, this,
  73. LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  74. LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  75. // 设置表格不自动创建列
  76. this.dgvlc.AutoGenerateColumns = false;
  77. // 注浆时间
  78. this.dtpStartTime.Value = DateTime.Now.Date;
  79. this.dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  80. }
  81. catch (Exception ex)
  82. {
  83. // 对异常进行共通处理
  84. ExceptionManager.HandleEventException(this.ToString(),
  85. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  86. }
  87. }
  88. /// <summary>
  89. /// 窗体关闭事件
  90. /// </summary>
  91. /// <param name="sender"></param>
  92. /// <param name="e"></param>
  93. private void F_RPT_080118_FormClosed(object sender, FormClosedEventArgs e)
  94. {
  95. _instance = null;
  96. }
  97. /// <summary>
  98. /// 关闭按钮
  99. /// </summary>
  100. /// <param name="sender"></param>
  101. /// <param name="e"></param>
  102. private void tsbtnClose_Click(object sender, EventArgs e)
  103. {
  104. this.Close();
  105. }
  106. /// <summary>
  107. /// 自动适应列宽
  108. /// </summary>
  109. /// <param name="sender"></param>
  110. /// <param name="e"></param>
  111. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  112. {
  113. this.dgvlc.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  114. }
  115. /// <summary>
  116. /// 查询按钮事件
  117. /// </summary>
  118. /// <param name="sender"></param>
  119. /// <param name="e"></param>
  120. private void btnSearch_Click(object sender, EventArgs e)
  121. {
  122. try
  123. {
  124. this.btnSearch.Focus();
  125. //QC检验计划分析明细汇总表
  126. //创建查询连接
  127. ServiceResultEntity sreByid = DoAsync<ServiceResultEntity>(() =>
  128. {
  129. ClientRequestEntity cre = new ClientRequestEntity();
  130. cre.NameSpace = "F_RPT_080118";
  131. cre.Name = "GetLuociData";
  132. cre.Properties["startdata"] = dtpStartTime.Value;
  133. cre.Properties["enddata"] = dtpEndTime.Value;
  134. return SystemModuleProxy.Service.DoRequest(cre);
  135. });
  136. //没有数据
  137. if (sreByid.Data.Tables[0].Rows.Count == 0)
  138. {
  139. //调用弹窗提示
  140. meaasge();
  141. }
  142. //清空页面数据
  143. this.dgvlc.DataSource = null;
  144. this.dgvlc.DataSource = sreByid.Data.Tables[0];
  145. }
  146. catch (Exception ex)
  147. {
  148. this.btnSearch.Enabled = true;
  149. // 对异常进行共通处理
  150. ExceptionManager.HandleEventException(this.ToString(),
  151. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  152. }
  153. }
  154. /// <summary>
  155. /// 弹窗提示
  156. /// </summary>
  157. private void meaasge()
  158. { // 提示未查找到数据
  159. MessageBox.Show("根据查询条件,没有相应的数据", this.Text,
  160. MessageBoxButtons.OK, MessageBoxIcon.Information);
  161. }
  162. /// <summary>
  163. /// 清空条件按钮事件
  164. /// </summary>
  165. /// <param name="sender"></param>
  166. /// <param name="e"></param>
  167. private void btnClearCondition_Click(object sender, EventArgs e)
  168. {
  169. // 注浆时间
  170. this.dtpStartTime.Value = DateTime.Now.Date;
  171. this.dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  172. }
  173. #endregion
  174. #region 私有方法
  175. /// <summary>
  176. /// 查询对象
  177. /// </summary>
  178. public class readdata
  179. {
  180. /// <summary>
  181. /// 主键
  182. /// </summary>
  183. public string GoodsID { get; set; }
  184. /// <summary>
  185. /// 开始时间
  186. /// </summary>
  187. public string startdata { get; set; }
  188. /// <summary>
  189. /// 结束时间
  190. /// </summary>
  191. public string enddata { get; set; }
  192. /// <summary>
  193. /// 班次
  194. /// </summary>
  195. public string classes { get; set; }
  196. /// <summary>
  197. /// 大小件 总计
  198. /// </summary>
  199. public string configtype { get; set; }
  200. }
  201. #endregion
  202. }
  203. }