F_RPT_080110.cs 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. /*******************************************************************************
  2. * Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_RPT_080110.cs
  5. * 2.功能描述:半成品检验判级明细表
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 冯林勇 2022/09/12 1.00 新建
  9. *******************************************************************************/
  10. using Dongke.IBOSS.PRD.Basics.BaseResources;
  11. using Dongke.IBOSS.PRD.Basics.DockPanel;
  12. using Dongke.IBOSS.PRD.Client.CommonModule;
  13. using Dongke.IBOSS.PRD.WCF.DataModels;
  14. using Dongke.IBOSS.PRD.WCF.Proxys;
  15. using System;
  16. using System.Data;
  17. using System.Windows.Forms;
  18. using System.Linq;
  19. using System.Collections.Generic;
  20. using Dongke.IBOSS.PRD.Client.Controls;
  21. namespace Dongke.IBOSS.PRD.Client.ReportModule
  22. {
  23. /// <summary>
  24. /// 半检登记明细表
  25. /// </summary>
  26. public partial class F_RPT_080110 : DKDockPanelBase
  27. {
  28. #region 成员变量
  29. //单例模式
  30. private static F_RPT_080110 _instance;
  31. SemiCheckEntity _entity;
  32. #endregion
  33. #region 构造函数
  34. /// <summary>
  35. /// 废弃一览构造
  36. /// </summary>
  37. public F_RPT_080110()
  38. {
  39. InitializeComponent();
  40. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  41. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  42. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  43. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  44. }
  45. #endregion
  46. #region 单例模式
  47. /// <summary>
  48. /// 单例模式,防止重复创建窗体
  49. /// </summary>
  50. public static F_RPT_080110 Instance
  51. {
  52. get
  53. {
  54. if (_instance == null)
  55. {
  56. _instance = new F_RPT_080110();
  57. }
  58. return _instance;
  59. }
  60. }
  61. #endregion
  62. #region 事件
  63. /// <summary>
  64. /// 窗体加载
  65. /// </summary>
  66. /// <param name="sender"></param>
  67. /// <param name="e"></param>
  68. private void F_PM_2201_Load(object sender, EventArgs e)
  69. {
  70. try
  71. {
  72. // 加载权限
  73. FormPermissionManager.FormPermissionControl(this.Name, this,
  74. Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  75. Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  76. this.dgvSemiCheck.AutoGenerateColumns = false;
  77. // 设置日期控件默认值
  78. this.txtSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  79. this.txtSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  80. //下拉框绑定判断等级
  81. BindJudgmentLevel();
  82. //下拉框绑定登记工序
  83. BindRegisterTheOperation();
  84. //下拉框绑定登记状态
  85. BindRegistrationStatus();
  86. }
  87. catch (Exception ex)
  88. {
  89. // 对异常进行共通处理
  90. ExceptionManager.HandleEventException(this.ToString(),
  91. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  92. }
  93. }
  94. /// <summary>
  95. /// 查询事件
  96. /// </summary>
  97. /// <param name="sender"></param>
  98. /// <param name="e"></param>
  99. private void btnSearch_Click(object sender, EventArgs e)
  100. {
  101. try
  102. {
  103. this.dgvSemiCheck.DataSource = null;
  104. ClientRequestEntity cre = new ClientRequestEntity();
  105. cre.Properties["GoodsCode"] = this.txtGoodsCode.Text; //产品编号
  106. cre.Properties["GoodsTypeCode"] = this.scbGoodsType.Text; //产品类别
  107. cre.Properties["PROCEDUREID"] = this.scbRegisterTheOperation.SelectedValue;//登记工序
  108. cre.Properties["GROUTINGLINECODE"] = this.txtGroutingLineCode.Text; //成型线编码
  109. cre.Properties["GOODSLEVELID"] = this.scbJudgmentLevel.SelectedValue; //判定等级
  110. string state = this.scbRegistrationStatus.Text; //登记状态
  111. if (state == "有效")
  112. {
  113. cre.Properties["VALUEFLAG"] = "1";
  114. }
  115. else if (state == "历史")
  116. {
  117. cre.Properties["VALUEFLAG"] = "0";
  118. }
  119. else
  120. {
  121. cre.Properties["VALUEFLAG"] = "2";
  122. }
  123. cre.Properties["SemiCheckDateTimeStart"] = this.txtSemiCheckDateTimeStart.Value; //半检时间
  124. cre.Properties["SemiCheckDateTimeEnd"] = this.txtSemiCheckDateTimeEnd.Value; //半检时间
  125. cre.NameSpace = "R04";
  126. cre.Name = "F_RPT_080110_Seach";
  127. ServiceResultEntity dsSemiCheck = ReportModuleProxy.Service.DoRequest(cre);
  128. if (dsSemiCheck.Data != null && dsSemiCheck.Data.Tables.Count > 0 && dsSemiCheck.Data.Tables[0].Rows.Count > 0)
  129. {
  130. this.dgvSemiCheck.DataSource = (dsSemiCheck).Data.Tables[Constant.INT_IS_ZERO];
  131. this.dgvSemiCheck.ReadOnly = true;
  132. this.dgvSemiCheck.Rows[0].Selected = true;
  133. }
  134. else
  135. {
  136. // 提示未查找到数据
  137. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  138. MessageBoxButtons.OK, MessageBoxIcon.Information);
  139. }
  140. }
  141. catch (Exception ex)
  142. {
  143. // 对异常进行共通处理
  144. ExceptionManager.HandleEventException(this.ToString(),
  145. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  146. }
  147. }
  148. /// <summary>
  149. /// 清空条件
  150. /// </summary>
  151. /// <param name="sender"></param>
  152. /// <param name="e"></param>
  153. private void btnClearCondition_Click(object sender, EventArgs e)
  154. {
  155. this.scbJudgmentLevel.SelectedIndex = 3;
  156. this.scbRegisterTheOperation.SelectedIndex = 3;
  157. this.txtGroutingLineCode.Text = "";
  158. this.scbRegistrationStatus.SelectedValue = 0;
  159. this.scbGoodsType.ClearValue();
  160. this.txtGoodsCode.Text = string.Empty;
  161. this.txtSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  162. this.txtSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  163. }
  164. /// <summary>
  165. /// 绑定判定等级下拉框
  166. /// </summary>
  167. /// <param name="sender"></param>
  168. /// <param name="e"></param>
  169. private void BindJudgmentLevel()
  170. {
  171. ClientRequestEntity cre = new ClientRequestEntity();
  172. cre.NameSpace = "R04";
  173. cre.Name = "F_RPT_080110";
  174. ServiceResultEntity sre = ReportModuleProxy.Service.DoRequest(cre);
  175. if (sre == null || sre.Data == null ||
  176. sre.Data.Tables.Count == 0 ||
  177. sre.Data.Tables[0].Rows.Count == 0)
  178. {
  179. return;
  180. }
  181. else
  182. {
  183. DataTable dtKilnInfo = sre.Data.Tables[Constant.INT_IS_ZERO];
  184. DataRow row = dtKilnInfo.NewRow();
  185. row["GOODSLEVELTYPEID"] = 0;
  186. row["GOODSLEVELTYPENAME"] = "全部";
  187. dtKilnInfo.Rows.Add(row);
  188. this.scbJudgmentLevel.DisplayMember = "GOODSLEVELTYPENAME";
  189. this.scbJudgmentLevel.ValueMember = "GOODSLEVELTYPEID";
  190. this.scbJudgmentLevel.DataSource = dtKilnInfo;
  191. this.scbJudgmentLevel.SelectedIndex = 3;
  192. }
  193. }
  194. /// <summary>
  195. /// 绑定登记状态下拉框
  196. /// </summary>
  197. /// <param name="sender"></param>
  198. /// <param name="e"></param>
  199. private void BindRegistrationStatus()
  200. {
  201. Dictionary<int, string> dic = new Dictionary<int, string>()
  202. {
  203. {0,"全部" },
  204. {1,"有效" },
  205. {2,"历史" },
  206. };
  207. this.scbRegistrationStatus.ValueMember = "Key";
  208. this.scbRegistrationStatus.DisplayMember = "Value";
  209. this.scbRegistrationStatus.DataSource = new BindingSource() { DataSource = dic };
  210. this.scbRegistrationStatus.SelectedIndex = 0;
  211. }
  212. /// <summary>
  213. /// 绑定登记工序下拉框
  214. /// </summary>
  215. /// <param name="sender"></param>
  216. /// <param name="e"></param>
  217. private void BindRegisterTheOperation()
  218. {
  219. ClientRequestEntity cre = new ClientRequestEntity();
  220. cre.NameSpace = "R04";
  221. cre.Name = "F_RPT_080110_2";
  222. ServiceResultEntity sre = ReportModuleProxy.Service.DoRequest(cre);
  223. if (sre == null || sre.Data == null ||
  224. sre.Data.Tables.Count == 0 ||
  225. sre.Data.Tables[0].Rows.Count == 0)
  226. {
  227. return;
  228. }
  229. else
  230. {
  231. DataTable dtKilnInfo = sre.Data.Tables[Constant.INT_IS_ZERO];
  232. DataRow row = dtKilnInfo.NewRow();
  233. row["PROCEDUREID"] = 0;
  234. row["PROCEDURENAME"] = "全部";
  235. dtKilnInfo.Rows.Add(row);
  236. this.scbRegisterTheOperation.DisplayMember = "PROCEDURENAME";
  237. this.scbRegisterTheOperation.ValueMember = "PROCEDUREID";
  238. this.scbRegisterTheOperation.DataSource = dtKilnInfo;
  239. this.scbRegisterTheOperation.SelectedIndex = 3;
  240. }
  241. }
  242. /// <summary>
  243. /// 关闭一览窗体
  244. /// </summary>
  245. /// <param name="sender"></param>
  246. /// <param name="e"></param>
  247. private void tsbtnClose_Click(object sender, EventArgs e)
  248. {
  249. this.Close();
  250. }
  251. /// <summary>
  252. /// 窗体关闭事件
  253. /// </summary>
  254. /// <param name="sender"></param>
  255. /// <param name="e"></param>
  256. private void F_PM_2201_FormClosed(object sender, FormClosedEventArgs e)
  257. {
  258. _instance = null;
  259. }
  260. /// <summary>
  261. /// 自动列宽
  262. /// </summary>
  263. /// <param name="sender"></param>
  264. /// <param name="e"></param>
  265. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  266. {
  267. this.dgvSemiCheck.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  268. }
  269. /// <summary>
  270. /// 半检时间复选框改变事件
  271. /// </summary>
  272. /// <param name="sender"></param>
  273. /// <param name="e"></param>
  274. private void cbSemiCheck_CheckedChanged(object sender, EventArgs e)
  275. {
  276. }
  277. #endregion
  278. #region 私有方法
  279. /// <summary>
  280. /// 根据界面查询条件获取数据集
  281. /// </summary>
  282. private DataSet GetSemiCheck(SemiCheckEntity _entity)
  283. {
  284. try
  285. {
  286. ServiceResultEntity resultEntity = ReportModuleProxy.Service.GetRPT080108IData(_entity);
  287. return resultEntity.Data;
  288. }
  289. catch (Exception ex)
  290. {
  291. throw ex;
  292. }
  293. }
  294. #endregion
  295. }
  296. }