F_RPT_030121.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*******************************************************************************
  2. * Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_RPT_030121.cs
  5. * 2.功能描述:回收产品汇总表
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 张庭莲 2023/08/15 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Reflection;
  14. using System.Windows.Forms;
  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.Client.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.DataModels;
  20. using Dongke.IBOSS.PRD.WCF.Proxys;
  21. namespace Dongke.IBOSS.PRD.Client.ReportModule
  22. {
  23. /// <summary>
  24. /// 废弃产品汇总表
  25. /// </summary>
  26. public partial class F_RPT_030121 : DKDockPanelBase
  27. {
  28. #region 成员变量
  29. private static F_RPT_030121 _instance = null;
  30. #endregion
  31. #region 单例模式
  32. /// <summary>
  33. /// 单例模式,防止重复创建窗体
  34. /// </summary>
  35. public static F_RPT_030121 Instance
  36. {
  37. get
  38. {
  39. if (_instance == null)
  40. {
  41. _instance = new F_RPT_030121();
  42. }
  43. return _instance;
  44. }
  45. }
  46. #endregion
  47. #region 构造函数
  48. /// <summary>
  49. ///
  50. /// </summary>
  51. private F_RPT_030121()
  52. {
  53. InitializeComponent();
  54. this.Text = "回收产品汇总表";
  55. //this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  56. //this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  57. //this.dgvSum.AutoGenerateColumns = false;
  58. }
  59. #endregion
  60. #region 控件事件
  61. /// <summary>
  62. /// 关闭
  63. /// </summary>
  64. /// <param name="sender"></param>
  65. /// <param name="e"></param>
  66. private void F_PC_1001_FormClosed(object sender, FormClosedEventArgs e)
  67. {
  68. _instance = null;
  69. }
  70. /// <summary>
  71. /// 画面加载
  72. /// </summary>
  73. /// <param name="sender"></param>
  74. /// <param name="e"></param>
  75. private void F_PC_1001_Load(object sender, System.EventArgs e)
  76. {
  77. try
  78. {
  79. this.dtpStartTime.Value = DateTime.Now.Date;
  80. this.dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  81. }
  82. catch (Exception ex)
  83. {
  84. // 对异常进行共通处理
  85. ExceptionManager.HandleEventException(this.ToString(),
  86. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  87. }
  88. }
  89. /// <summary>
  90. /// 查询
  91. /// </summary>
  92. /// <param name="sender"></param>
  93. /// <param name="e"></param>
  94. private void tsbtnSearch_Click(object sender, EventArgs e)
  95. {
  96. try
  97. {
  98. //this.dgvSum.DataSource = null;
  99. this.QueryDataFromOther();
  100. }
  101. catch (Exception ex)
  102. {
  103. // 对异常进行共通处理
  104. ExceptionManager.HandleEventException(this.ToString(),
  105. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  106. }
  107. }
  108. /// <summary>
  109. /// 清除条件
  110. /// </summary>
  111. /// <param name="sender"></param>
  112. /// <param name="e"></param>
  113. private void tsbtnClearCondition_Click(object sender, EventArgs e)
  114. {
  115. this.dtpEndTime.Value = DateTime.Now.AddMonths(-1);
  116. this.dtpStartTime.Value = DateTime.Now;
  117. //this.scbGoods.ClearValue();
  118. //this.scbGoodsType.ClearValue();
  119. //this.ckcSumType.ClearValue();
  120. //this.dkCProcedureSearchBox.Text = null;
  121. //this.dkCProcedureSearchBox.ProcedureID = null;
  122. //this.dkCProcedureSearchBox.ProcedureIDS = null;
  123. //this.dkCProcedureSearchBox.ProcedureName = null;
  124. }
  125. /// <summary>
  126. /// 自适应列宽
  127. /// </summary>
  128. /// <param name="sender"></param>
  129. /// <param name="e"></param>
  130. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  131. {
  132. this.dgvSum.AutoResizeColumns();
  133. }
  134. /// <summary>
  135. /// 关闭画面
  136. /// </summary>
  137. /// <param name="sender"></param>
  138. /// <param name="e"></param>
  139. private void tsbtnClose_Click(object sender, EventArgs e)
  140. {
  141. this.Close();
  142. }
  143. #endregion
  144. #region 私有方法
  145. /// <summary>
  146. /// 查询数据
  147. /// </summary>
  148. private void QueryDataFromOther()
  149. {
  150. try
  151. {
  152. //this.tsrToolStrip1.Focus();
  153. ClientRequestEntity cre = new ClientRequestEntity();
  154. cre.NameSpace = "R03";
  155. cre.Name = "R030121";
  156. cre.Properties["DateBegin"] = this.dtpStartTime.Value;
  157. cre.Properties["DateEnd"] = this.dtpEndTime.Value;
  158. //cre.Properties["GoodsTypeCode"] = scbGoodsType.SearchedValue + "";
  159. //if (!string.IsNullOrWhiteSpace(this.scbGoods.Text))
  160. //{
  161. // if (this.scbGoods.CheckedPKMember.Contains(","))
  162. // {
  163. // cre.Properties["GoodsIDs"] = scbGoods.CheckedPKMember;
  164. // }
  165. // else
  166. // {
  167. // cre.Properties["GoodsID"] = scbGoods.SearchedPKMember;
  168. // }
  169. //}
  170. //if (!string.IsNullOrWhiteSpace(this.dkCProcedureSearchBox.ProcedureIDS))
  171. //{
  172. // if (this.dkCProcedureSearchBox.ProcedureIDS.Contains(","))
  173. // {
  174. // cre.Properties["ProcedureIDs"] = this.dkCProcedureSearchBox.ProcedureIDS;
  175. // }
  176. // else
  177. // {
  178. // cre.Properties["ProcedureID"] = Convert.ToInt32(dkCProcedureSearchBox.ProcedureIDS);
  179. // }
  180. //}
  181. //cre.Properties["ProcedureIDs"] = this.dkCProcedureSearchBox.ProcedureIDS;
  182. //if (this.ckcSumType.CheckedState == CheckState.Indeterminate)
  183. //{
  184. // cre.Properties["ScrapTypes"] = this.ckcSumType.CheckedValue;
  185. //}
  186. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  187. {
  188. return ReportModuleProxy.Service.DoRequest(cre);
  189. }
  190. );
  191. if (sre.Status == Constant.ServiceResultStatus.Success)
  192. {
  193. //查询成功
  194. this.dgvSum.DataSource = sre.Data.Tables[0];
  195. }
  196. }
  197. catch (Exception ex)
  198. {
  199. throw ex;
  200. }
  201. }
  202. #endregion
  203. }
  204. }