F_RPT_030112.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. /*******************************************************************************
  2. * Copyright(c) 2015 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_RPT_030102_1.cs
  5. * 2.功能描述:产成品交接汇总表
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 袁新成 2015/4/14 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Text;
  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.Client.Controls;
  18. using Dongke.IBOSS.PRD.Client.DataModels;
  19. using Dongke.IBOSS.PRD.WCF.DataModels;
  20. using Dongke.IBOSS.PRD.WCF.Proxys;
  21. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  22. namespace Dongke.IBOSS.PRD.Client.ReportModule
  23. {
  24. public partial class F_RPT_030112 : DKDockPanelBase
  25. {
  26. #region 成员变量
  27. // 窗体的单例模式
  28. private static F_RPT_030112 _instance;
  29. //实体类
  30. private RPT030102_SE _rptse = null;
  31. private RPT030102_SE _rptse1 = null;
  32. // 存储查询条件
  33. private SearchFinishedProductEntity _orderEntity = null;
  34. //private SearchFinishedProductEntity _orderEntity2 = null;
  35. private SearchFinishedProductEntity _orderCRE = null;
  36. #endregion
  37. #region 构造函数
  38. public F_RPT_030112()
  39. {
  40. InitializeComponent();
  41. // 窗体显示的Title
  42. this.Text = FormTitles.F_RPT_030112;
  43. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  44. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  45. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  46. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  47. this.gbxCondition.Text = Constant.LABEL_QUERY_CONDITIONS;
  48. }
  49. #endregion
  50. #region 单例模式
  51. /// <summary>
  52. /// 单例模式,防止重复创建窗体
  53. /// </summary>
  54. public static F_RPT_030112 Instance
  55. {
  56. get
  57. {
  58. if (_instance == null || _instance.IsDisposed)
  59. {
  60. _instance = new F_RPT_030112();
  61. }
  62. return _instance;
  63. }
  64. }
  65. #endregion
  66. #region 事件处理
  67. /// <summary>
  68. /// 窗体加载事件
  69. /// </summary>
  70. /// <param name="sender"></param>
  71. /// <param name="e"></param>
  72. private void F_RPT_030102_1_Load(object sender, EventArgs e)
  73. {
  74. try
  75. {
  76. // 加载权限
  77. FormPermissionManager.FormPermissionControl(this.Name, this,
  78. LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  79. LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  80. // 设置表格不自动创建列
  81. this.dgvOrder.AutoGenerateColumns = false;
  82. this.dgvOrderDetail.AutoGenerateColumns = false;
  83. //this.dtpStartTime.Enabled = false;
  84. //this.dtpEndTime.Enabled = false;
  85. this.dtpStartTime.Value = DateTime.Now.Date;
  86. this.dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  87. this.chkTestMouldFlag.AllItemCheck();
  88. }
  89. catch (Exception ex)
  90. {
  91. // 对异常进行共通处理
  92. ExceptionManager.HandleEventException(this.ToString(),
  93. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  94. }
  95. }
  96. /// <summary>
  97. /// 窗体关闭事件
  98. /// </summary>
  99. /// <param name="sender"></param>
  100. /// <param name="e"></param>
  101. private void F_RPT_030102_1_FormClosed(object sender, FormClosedEventArgs e)
  102. {
  103. _instance = null;
  104. }
  105. /// <summary>
  106. /// 关闭按钮
  107. /// </summary>
  108. /// <param name="sender"></param>
  109. /// <param name="e"></param>
  110. private void tsbtnClose_Click(object sender, EventArgs e)
  111. {
  112. this.Close();
  113. }
  114. /// <summary>
  115. /// 自动适应列宽
  116. /// </summary>
  117. /// <param name="sender"></param>
  118. /// <param name="e"></param>
  119. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  120. {
  121. if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_ZERO)
  122. {
  123. this.dgvOrder.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  124. }
  125. else if(this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_ONE)
  126. {
  127. this.dgvOrderDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  128. }
  129. else if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_FOUR)
  130. {
  131. this.dgvlc.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  132. }
  133. else if (this.tblScrapTotalModule.SelectedIndex == Constant.INT_IS_FIVE)
  134. {
  135. this.dgvlcDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  136. }
  137. }
  138. /// <summary>
  139. /// 查询按钮事件
  140. /// </summary>
  141. /// <param name="sender"></param>
  142. /// <param name="e"></param>
  143. private void btnSearch_Click(object sender, EventArgs e)
  144. {
  145. try
  146. {
  147. GetOrderEntityFromLayout();// 设置查询实体类
  148. if (this.tblScrapTotalModule.SelectedIndex == 0)//交接汇总查询
  149. {
  150. //this._orderEntity2 = this._orderEntity;
  151. //this.dgvOrder.DataSource = null;
  152. //this.dgvOrder.DataSource = this.GetSearchTotalData();
  153. _orderCRE = this._orderEntity;
  154. this.GetSearchTotalData();
  155. }
  156. else if (this.tblScrapTotalModule.SelectedIndex == 1)//交接明细查询
  157. {
  158. this.dgvOrderDetail.DataSource = null;
  159. this.dgvOrderDetail.DataSource = this.GetSearchDetailData();
  160. }
  161. else if (this.tblScrapTotalModule.SelectedIndex == 2)//交接数量查询
  162. {
  163. this.dgvNum.DataSource = null;
  164. ClientRequestEntity cre = new ClientRequestEntity();
  165. cre.NameSpace = "R03";
  166. cre.Name = "R030112Num";
  167. cre.Properties["OrderNo"] = this.txtOrderNo.Text.Trim();
  168. cre.Properties["FHUserCode"] = this.txtFHUserCode.Text.Trim();
  169. if (this.chkDateTime.Checked)
  170. {
  171. cre.Properties["FHTimeStart"] = this.dtpStartTime.Value;
  172. cre.Properties["FHTimeEnd"] = this.dtpEndTime.Value;
  173. }
  174. cre.Properties["GoodsTypeCode"] = scbGoodsType.SearchedValue + "";
  175. cre.Properties["GoodsCode"] = this.txtGoodsCode.Text.Trim();
  176. cre.Properties["GoodsModel"] = this.txtGoodsModel.Text.Trim();
  177. cre.Properties["LogoIDS"] = this.dkLogoSearchBox1.LogoIDS;
  178. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  179. if (testMouldFlags.Length == 1)
  180. {
  181. cre.Properties["TestMouldFlag"] = testMouldFlags[0].ToString();
  182. }
  183. ServiceResultEntity resultEntity = DoAsync<ServiceResultEntity>(() =>
  184. {
  185. return ReportModuleProxy.Service.DoRequest(cre);
  186. });
  187. if (resultEntity == null || resultEntity.Data == null ||
  188. resultEntity.Data.Tables.Count == 0 ||
  189. resultEntity.Data.Tables[0].Rows.Count == 0)
  190. {
  191. this.dgvNum.AutoResizeColumns();
  192. return;
  193. }
  194. else
  195. {
  196. this.dgvNum.DataSource = resultEntity.Data.Tables[0];
  197. this.dgvNum.ReadOnly = true;
  198. this.dgvNum.Rows[0].Selected = true;
  199. this.dgvNum.AutoResizeColumns();
  200. }
  201. }
  202. else if (this.tblScrapTotalModule.SelectedIndex == 3)//型号数量查询
  203. {
  204. this.dgvGoodsNum.DataSource = null;
  205. ClientRequestEntity cre = new ClientRequestEntity();
  206. cre.NameSpace = "R03";
  207. cre.Name = "R030112GoodsNum";
  208. cre.Properties["OrderNo"] = this.txtOrderNo.Text.Trim();
  209. cre.Properties["FHUserCode"] = this.txtFHUserCode.Text.Trim();
  210. if (this.chkDateTime.Checked)
  211. {
  212. cre.Properties["FHTimeStart"] = this.dtpStartTime.Value;
  213. cre.Properties["FHTimeEnd"] = this.dtpEndTime.Value;
  214. }
  215. cre.Properties["GoodsTypeCode"] = scbGoodsType.SearchedValue + "";
  216. cre.Properties["GoodsCode"] = this.txtGoodsCode.Text.Trim();
  217. cre.Properties["GoodsModel"] = this.txtGoodsModel.Text.Trim();
  218. cre.Properties["LogoIDS"] = this.dkLogoSearchBox1.LogoIDS;
  219. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  220. if (testMouldFlags.Length == 1)
  221. {
  222. cre.Properties["TestMouldFlag"] = testMouldFlags[0].ToString();
  223. }
  224. ServiceResultEntity resultEntity = DoAsync<ServiceResultEntity>(() =>
  225. {
  226. return ReportModuleProxy.Service.DoRequest(cre);
  227. });
  228. if (resultEntity == null || resultEntity.Data == null ||
  229. resultEntity.Data.Tables.Count == 0 ||
  230. resultEntity.Data.Tables[0].Rows.Count == 0)
  231. {
  232. this.dgvGoodsNum.AutoResizeColumns();
  233. return;
  234. }
  235. else
  236. {
  237. this.dgvGoodsNum.DataSource = resultEntity.Data.Tables[0];
  238. this.dgvGoodsNum.ReadOnly = true;
  239. this.dgvGoodsNum.Rows[0].Selected = true;
  240. this.dgvGoodsNum.AutoResizeColumns();
  241. }
  242. }
  243. else if (this.tblScrapTotalModule.SelectedIndex == 4)//裸瓷交接汇总 add by qq 20250605
  244. {
  245. this.dgvlc.DataSource = null;
  246. ClientRequestEntity cre = new ClientRequestEntity();
  247. cre.NameSpace = "R03";
  248. cre.Name = "LCData";
  249. cre.Properties["FHUserCode"] = this.txtFHUserCode.Text.Trim();
  250. if (this.chkDateTime.Checked)
  251. {
  252. cre.Properties["FHTimeStart"] = this.dtpStartTime.Value;
  253. cre.Properties["FHTimeEnd"] = this.dtpEndTime.Value;
  254. }
  255. cre.Properties["GoodsTypeCode"] = scbGoodsType.SearchedValue + "";
  256. cre.Properties["GoodsCode"] = this.txtGoodsCode.Text.Trim();
  257. cre.Properties["GoodsModel"] = this.txtGoodsModel.Text.Trim();
  258. cre.Properties["LogoIDS"] = this.dkLogoSearchBox1.LogoIDS;
  259. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  260. if (testMouldFlags.Length == 1)
  261. {
  262. cre.Properties["TestMouldFlag"] = testMouldFlags[0].ToString();
  263. }
  264. ServiceResultEntity resultEntity = DoAsync<ServiceResultEntity>(() =>
  265. {
  266. return ReportModuleProxy.Service.DoRequest(cre);
  267. });
  268. if (resultEntity == null || resultEntity.Data == null ||
  269. resultEntity.Data.Tables.Count == 0 ||
  270. resultEntity.Data.Tables[0].Rows.Count == 0)
  271. {
  272. this.dgvlc.AutoResizeColumns();
  273. return;
  274. }
  275. else
  276. {
  277. this.dgvlc.DataSource = resultEntity.Data.Tables[0];
  278. this.dgvlc.ReadOnly = true;
  279. this.dgvlc.Rows[0].Selected = true;
  280. this.dgvlc.AutoResizeColumns();
  281. }
  282. }
  283. else if (this.tblScrapTotalModule.SelectedIndex == 5)//裸瓷交接明细表 add by qq 20250605
  284. {
  285. this.dgvlcDetail.DataSource = null;
  286. ClientRequestEntity cre = new ClientRequestEntity();
  287. cre.NameSpace = "R03";
  288. cre.Name = "LCDetail";
  289. cre.Properties["FHUserCode"] = this.txtFHUserCode.Text.Trim();
  290. if (this.chkDateTime.Checked)
  291. {
  292. cre.Properties["FHTimeStart"] = this.dtpStartTime.Value;
  293. cre.Properties["FHTimeEnd"] = this.dtpEndTime.Value;
  294. }
  295. cre.Properties["GoodsTypeCode"] = scbGoodsType.SearchedValue + "";
  296. cre.Properties["GoodsCode"] = this.txtGoodsCode.Text.Trim();
  297. cre.Properties["GoodsModel"] = this.txtGoodsModel.Text.Trim();
  298. cre.Properties["LogoIDS"] = this.dkLogoSearchBox1.LogoIDS;
  299. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  300. if (testMouldFlags.Length == 1)
  301. {
  302. cre.Properties["TestMouldFlag"] = testMouldFlags[0].ToString();
  303. }
  304. ServiceResultEntity resultEntity = DoAsync<ServiceResultEntity>(() =>
  305. {
  306. return ReportModuleProxy.Service.DoRequest(cre);
  307. });
  308. if (resultEntity == null || resultEntity.Data == null ||
  309. resultEntity.Data.Tables.Count == 0 ||
  310. resultEntity.Data.Tables[0].Rows.Count == 0)
  311. {
  312. this.dgvlcDetail.AutoResizeColumns();
  313. return;
  314. }
  315. else
  316. {
  317. this.dgvlcDetail.DataSource = resultEntity.Data.Tables[0];
  318. this.dgvlcDetail.ReadOnly = true;
  319. this.dgvlcDetail.Rows[0].Selected = true;
  320. this.dgvlcDetail.AutoResizeColumns();
  321. }
  322. }
  323. }
  324. catch (Exception ex)
  325. {
  326. this.btnSearch.Enabled = true;
  327. // 对异常进行共通处理
  328. ExceptionManager.HandleEventException(this.ToString(),
  329. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  330. }
  331. }
  332. /// <summary>
  333. /// 清空条件按钮事件
  334. /// </summary>
  335. /// <param name="sender"></param>
  336. /// <param name="e"></param>
  337. private void btnClearCondition_Click(object sender, EventArgs e)
  338. {
  339. this.txtOrderNo.Clear();
  340. this.txtFHUserCode.Clear();
  341. this.chkDateTime.Checked = false;
  342. this.dtpStartTime.Value = DateTime.Now.Date;
  343. this.dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  344. this.scbGoodsType.ClearValue();
  345. this.txtGoodsCode.Clear();
  346. this.dkLogoSearchBox1.ClearControl();
  347. this.chkTestMouldFlag.AllItemCheck();
  348. }
  349. /// <summary>
  350. /// 双击单元格事件
  351. /// </summary>
  352. /// <param name="sender"></param>
  353. /// <param name="e"></param>
  354. private void dgvScrapTotalModule_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  355. {
  356. try
  357. {
  358. //判断是否为空
  359. if (this.dgvOrder.CurrentRow == null)
  360. {
  361. return;
  362. }
  363. //获取数据信息
  364. DataRowView row = dgvOrder.CurrentRow.DataBoundItem as DataRowView;
  365. //this._orderEntity = _orderCRE;
  366. if (row["fhorderid"] == DBNull.Value)
  367. {
  368. this._orderCRE.OrderID = null;
  369. }
  370. else
  371. {
  372. this._orderCRE.OrderID = Convert.ToInt32(row["fhorderid"]);
  373. }
  374. if (row["goodsid"] == DBNull.Value)
  375. {
  376. this._orderCRE.GoodsID = null;
  377. }
  378. else
  379. {
  380. this._orderCRE.GoodsID = Convert.ToInt32(row["goodsid"]);
  381. }
  382. if (row["logoid"] == DBNull.Value)
  383. {
  384. this._orderCRE.LogoID = null;
  385. }
  386. else
  387. {
  388. this._orderCRE.LogoID = Convert.ToInt32(row["logoid"]);
  389. }
  390. this.dgvOrderDetail.DataSource = null;
  391. this.tblScrapTotalModule.SelectTab(1);
  392. this.dgvOrderDetail.DataSource = GetSearchDetailDataByDouble();
  393. }
  394. catch (Exception ex)
  395. {
  396. this.btnSearch.Enabled = true;
  397. this.btnClearCondition.Enabled = true;
  398. // 对异常进行共通处理
  399. ExceptionManager.HandleEventException(this.ToString(),
  400. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  401. }
  402. }
  403. /// <summary>
  404. /// 复选框按钮事件
  405. /// </summary>
  406. /// <param name="sender"></param>
  407. /// <param name="e"></param>
  408. private void chkDateTime_CheckedChanged(object sender, EventArgs e)
  409. {
  410. this.dtpStartTime.Enabled = chkDateTime.Checked;
  411. this.dtpEndTime.Enabled = chkDateTime.Checked;
  412. }
  413. #endregion
  414. #region 私有方法
  415. /// <summary>
  416. /// 搜索条件
  417. /// </summary>
  418. /// <returns></returns>
  419. private SearchFinishedProductEntity GetOrderEntityFromLayout()
  420. {
  421. this._orderEntity = new SearchFinishedProductEntity();
  422. this._orderEntity.OrderNo = this.txtOrderNo.Text.Trim();
  423. this._orderEntity.FHUserCode = this.txtFHUserCode.Text.Trim();
  424. if (this.chkDateTime.Checked)
  425. {
  426. this._orderEntity.FHTimeStart = this.dtpStartTime.Value;
  427. this._orderEntity.FHTimeEnd = this.dtpEndTime.Value;
  428. }
  429. this._orderEntity.GoodsTypeCode = scbGoodsType.SearchedValue + "";
  430. this._orderEntity.GoodsCode = this.txtGoodsCode.Text.Trim();
  431. this._orderEntity.BarCode = this.txtBarcode.Text.Trim();
  432. this._orderEntity.GoodsModel = this.txtGoodsModel.Text.Trim();
  433. this._orderEntity.LogoIDS = this.dkLogoSearchBox1.LogoIDS;
  434. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  435. if (testMouldFlags.Length == 1)
  436. {
  437. _orderEntity.TestMouldFlag = testMouldFlags[0].ToString();
  438. }
  439. return this._orderEntity;
  440. }
  441. /// <summary>
  442. /// 明细搜索条件
  443. /// </summary>
  444. /// <returns></returns>
  445. private void CreateSearchConditionDetail()
  446. {
  447. this._rptse = new RPT030102_SE();
  448. this._rptse.ProductionLineID = this._rptse1.ProductionLineID;
  449. this._rptse.GoodsTypeCode = this._rptse1.GoodsTypeCode;
  450. this._rptse.GoodsCode = this._rptse1.GoodsCode;
  451. this._rptse.ProcedureIDS = this._rptse1.ProcedureIDS;
  452. this._rptse.ScrapDateStart = this._rptse1.ScrapDateStart;
  453. this._rptse.ScrapDateEnd = this._rptse1.ScrapDateEnd;
  454. this._rptse.ResponProcedureIDS = this._rptse1.ResponProcedureIDS;
  455. this._rptse.ResponUserIDS = this._rptse1.ResponUserIDS;
  456. this._rptse.CreatUser = this._rptse1.CreatUser;
  457. this._rptse.AuditUser = this._rptse1.AuditUser;
  458. this._rptse.SpecialRepairFlag = this._rptse1.SpecialRepairFlag;
  459. }
  460. /// <summary>
  461. /// 查询损坏汇总表
  462. /// </summary>
  463. private DataTable GetSearchTotalData()
  464. {
  465. try
  466. {
  467. //// 调用服务器端获取数据集
  468. //ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  469. //{
  470. // return ReportModuleProxy.Service.GetRPT0030112SData(this._orderEntity);
  471. //}
  472. //);
  473. //if (sre.Status == Constant.ServiceResultStatus.Success)
  474. //{
  475. // if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  476. // {
  477. // // 提示未查找到数据
  478. // MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  479. // MessageBoxButtons.OK, MessageBoxIcon.Warning);
  480. // //清空数据
  481. // return null;
  482. // }
  483. // return sre.Data.Tables[0];
  484. //}
  485. this.dgvOrder.DataSource = null;
  486. ClientRequestEntity cre = new ClientRequestEntity();
  487. cre.NameSpace = "R03";
  488. cre.Name = "R030112Sum";
  489. cre.Properties["OrderNo"] = this.txtOrderNo.Text.Trim();
  490. cre.Properties["FHUserCode"] = this.txtFHUserCode.Text.Trim();
  491. if (this.chkDateTime.Checked)
  492. {
  493. cre.Properties["FHTimeStart"] = this.dtpStartTime.Value;
  494. cre.Properties["FHTimeEnd"] = this.dtpEndTime.Value;
  495. }
  496. cre.Properties["GoodsTypeCode"] = scbGoodsType.SearchedValue + "";
  497. cre.Properties["GoodsCode"] = this.txtGoodsCode.Text.Trim();
  498. cre.Properties["GoodsModel"] = this.txtGoodsModel.Text.Trim();
  499. cre.Properties["LogoIDS"] = this.dkLogoSearchBox1.LogoIDS;
  500. object[] testMouldFlags = this.chkTestMouldFlag.SelectedValues;
  501. if (testMouldFlags.Length == 1)
  502. {
  503. cre.Properties["TestMouldFlag"] = testMouldFlags[0].ToString();
  504. }
  505. ServiceResultEntity resultEntity = DoAsync<ServiceResultEntity>(() =>
  506. {
  507. return ReportModuleProxy.Service.DoRequest(cre);
  508. });
  509. if (resultEntity == null || resultEntity.Data == null ||
  510. resultEntity.Data.Tables.Count == 0 ||
  511. resultEntity.Data.Tables[0].Rows.Count == 0)
  512. {
  513. this.dgvOrder.AutoResizeColumns();
  514. return null;
  515. }
  516. else
  517. {
  518. this.dgvOrder.DataSource = resultEntity.Data.Tables[0];
  519. this.dgvOrder.ReadOnly = true;
  520. this.dgvOrder.Rows[0].Selected = true;
  521. this.dgvOrder.AutoResizeColumns();
  522. }
  523. return null;
  524. }
  525. catch (Exception ex)
  526. {
  527. throw ex;
  528. }
  529. }
  530. /// <summary>
  531. /// 查询损坏明细表
  532. /// </summary>
  533. private DataTable GetSearchDetailData()
  534. {
  535. try
  536. {
  537. // 调用服务器端获取数据集
  538. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  539. {
  540. return ReportModuleProxy.Service.GetRPT0030112DetailSData(this._orderEntity);
  541. }
  542. );
  543. if (sre.Status == Constant.ServiceResultStatus.Success)
  544. {
  545. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  546. {
  547. // 提示未查找到数据
  548. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  549. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  550. //清空数据
  551. return null;
  552. }
  553. return sre.Data.Tables[0];
  554. }
  555. return null;
  556. }
  557. catch (Exception ex)
  558. {
  559. throw ex;
  560. }
  561. }
  562. /// <summary>
  563. /// 查询损坏明细表
  564. /// </summary>
  565. private DataTable GetSearchDetailDataByDouble()
  566. {
  567. try
  568. {
  569. // 调用服务器端获取数据集
  570. ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
  571. {
  572. return ReportModuleProxy.Service.GetRPT0030112DetailSData(this._orderCRE);
  573. }
  574. );
  575. if (sre.Status == Constant.ServiceResultStatus.Success)
  576. {
  577. if (sre.Data.Tables[0].Rows.Count <= Constant.INT_IS_ZERO)
  578. {
  579. // 提示未查找到数据
  580. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  581. MessageBoxButtons.OK, MessageBoxIcon.Warning);
  582. //清空数据
  583. return null;
  584. }
  585. return sre.Data.Tables[0];
  586. }
  587. return null;
  588. }
  589. catch (Exception ex)
  590. {
  591. throw ex;
  592. }
  593. }
  594. #endregion
  595. private void txtBarcode_TextChanged(object sender, EventArgs e)
  596. {
  597. }
  598. }
  599. }