F_PM_0103.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_0103.cs
  5. * 2.功能描述:注浆明细条码绑定
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 陈晓野 2015/04/03 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Data;
  13. using System.Reflection;
  14. using System.Text;
  15. using System.Windows.Forms;
  16. using Dongke.IBOSS.PRD.Basics.BaseControls;
  17. using Dongke.IBOSS.PRD.Basics.BaseResources;
  18. using Dongke.IBOSS.PRD.Client.CommonModule;
  19. using Dongke.IBOSS.PRD.Client.Controls;
  20. using Dongke.IBOSS.PRD.WCF.DataModels;
  21. using Dongke.IBOSS.PRD.WCF.Proxys;
  22. namespace Dongke.IBOSS.PRD.Client.PMModule
  23. {
  24. /// <summary>
  25. /// 注浆明细条码绑定
  26. /// </summary>
  27. public partial class F_PM_0103 : DKFormBase
  28. {
  29. #region 成员变量
  30. // 注浆日报ID
  31. private int _dailyId;
  32. // 注浆日期
  33. private DateTime _groutingDate = DateTime.Now.Date;
  34. private bool _canEdit = true;
  35. #endregion
  36. #region 构造函数
  37. /// <summary>
  38. /// 构造函数
  39. /// </summary>
  40. public F_PM_0103()
  41. : this(0)
  42. {
  43. }
  44. /// <summary>
  45. /// 构造函数
  46. /// </summary>
  47. /// <param name="dailyID">注浆日报ID</param>
  48. public F_PM_0103(int dailyID)
  49. {
  50. this.InitializeComponent();
  51. this._dailyId = dailyID;
  52. this.InitializeControls();
  53. }
  54. #endregion
  55. #region 属性
  56. /// <summary>
  57. /// 注浆登记ID
  58. /// </summary>
  59. public List<int> GroutingDailyIDs
  60. {
  61. get;
  62. private set;
  63. }
  64. #endregion
  65. #region 事件
  66. /// <summary>
  67. /// 窗体加载
  68. /// </summary>
  69. private void F_PM_0103_Load(object sender, EventArgs e)
  70. {
  71. try
  72. {
  73. this.lblGroutingDateValue.Text = string.Empty;
  74. DataSet logoInfo = SystemModuleProxy.Service.GetLogoInfo();
  75. if (logoInfo != null && logoInfo.Tables.Count > 0)
  76. {
  77. this.cmbLogo.DataSource = logoInfo.Tables[0];
  78. this.cmbLogo.DisplayMember = "LogoNameCode";
  79. this.cmbLogo.ValueMember = "LogoID";
  80. this.collogo.DataSource = logoInfo.Tables[0].Copy();
  81. this.collogo.DisplayMember = "LogoNameCode";
  82. this.collogo.ValueMember = "LogoID";
  83. }
  84. // 设置列表未注浆原因选项数据源
  85. this.InitializeData();
  86. }
  87. catch (Exception ex)
  88. {
  89. // 对异常进行共通处理
  90. ExceptionManager.HandleEventException(this.ToString(),
  91. 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 tsbtnGrouting_Click(object sender, EventArgs e)
  100. {
  101. try
  102. {
  103. F_PM_0105 frmPM0105 = new F_PM_0105();
  104. //frmPM0105.GroutingDate = this._groutingDate;
  105. DialogResult dialogResult = frmPM0105.ShowDialog();
  106. if (dialogResult != DialogResult.OK)
  107. {
  108. return;
  109. }
  110. this._dailyId = frmPM0105.GroutingDailyID;
  111. this.InitializeData();
  112. }
  113. catch (Exception ex)
  114. {
  115. // 对异常进行共通处理
  116. ExceptionManager.HandleEventException(this.ToString(),
  117. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  118. }
  119. }
  120. /// <summary>
  121. /// 提交选择列内容的修改
  122. /// </summary>
  123. /// <param name="sender"></param>
  124. /// <param name="e"></param>
  125. private void dgvDetail_CurrentCellDirtyStateChanged(object sender, EventArgs e)
  126. {
  127. try
  128. {
  129. if (this.dgvDetail.CurrentRow != null && this.dgvDetail.IsCurrentCellDirty)
  130. {
  131. if ("ScrapFlag".Equals(this.dgvDetail.Columns
  132. [this.dgvDetail.CurrentCell.ColumnIndex].Name))
  133. {
  134. this.dgvDetail.CommitEdit(DataGridViewDataErrorContexts.Commit);
  135. }
  136. //else if ("BarCode".Equals(this.dgvDetail.Columns
  137. // [this.dgvDetail.CurrentCell.ColumnIndex].Name))
  138. //{
  139. // this.dgvDetail.CommitEdit(DataGridViewDataErrorContexts.Commit);
  140. //}
  141. }
  142. }
  143. catch (Exception ex)
  144. {
  145. // 对异常进行共通处理
  146. ExceptionManager.HandleEventException(this.ToString(),
  147. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  148. }
  149. }
  150. /// <summary>
  151. /// 损坯时,不能绑定条码
  152. /// </summary>
  153. private void dgvDetail_CellValueChanged(object sender, DataGridViewCellEventArgs e)
  154. {
  155. if (e.RowIndex < 0)
  156. {
  157. return;
  158. }
  159. try
  160. {
  161. DataGridViewRow dataGridViewRow = this.dgvDetail.Rows[e.RowIndex];
  162. if ("ScrapFlag".Equals(this.dgvDetail.Columns[e.ColumnIndex].Name))
  163. {
  164. // 未绑定时,如果是改变了损坯标识,则对绑定条码进行控制输入
  165. object obarCode = dataGridViewRow.Cells["colOBarCode"].Value;
  166. if (obarCode == null || obarCode == DBNull.Value || string.IsNullOrWhiteSpace(obarCode.ToString()))
  167. {
  168. // 选择了损坯
  169. if (((int)Constant.GroutingScrapFlag.Yes).ToString() ==
  170. dataGridViewRow.Cells["ScrapFlag"].Value.ToString())
  171. {
  172. dataGridViewRow.Cells["BarCode"].ReadOnly = true;
  173. dataGridViewRow.Cells["BarCode"].Value = DBNull.Value;
  174. }
  175. else
  176. {
  177. if (_canEdit)
  178. {
  179. dataGridViewRow.Cells["BarCode"].ReadOnly = false;
  180. }
  181. else
  182. {
  183. dataGridViewRow.Cells["BarCode"].ReadOnly = true;
  184. }
  185. }
  186. this.dgvDetail.IsSetInputColumnsColor = true;
  187. }
  188. }
  189. }
  190. catch (Exception ex)
  191. {
  192. // 对异常进行共通处理
  193. ExceptionManager.HandleEventException(this.ToString(),
  194. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  195. }
  196. }
  197. /// <summary>
  198. /// 排序后设置Grid状态
  199. /// </summary>
  200. /// <param name="sender"></param>
  201. /// <param name="e"></param>
  202. private void dgvDetail_Sorted(object sender, EventArgs e)
  203. {
  204. this.SetEditGrid();
  205. }
  206. /// <summary>
  207. /// 自动列宽
  208. /// </summary>
  209. /// <param name="sender"></param>
  210. /// <param name="e"></param>
  211. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  212. {
  213. this.dgvDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  214. }
  215. /// <summary>
  216. /// 页面关闭
  217. /// </summary>
  218. /// <param name="sender"></param>
  219. /// <param name="e"></param>
  220. private void tsbtnClose_Click(object sender, EventArgs e)
  221. {
  222. this.DialogResult = DialogResult.Cancel;
  223. this.Close();
  224. }
  225. /// <summary>
  226. /// 绑定条码
  227. /// </summary>
  228. /// <param name="sender"></param>
  229. /// <param name="e"></param>
  230. private void txtBarCodeStart_KeyPress(object sender, KeyPressEventArgs e)
  231. {
  232. if (txtBarCodeStart.ReadOnly || !_canEdit)
  233. {
  234. return;
  235. }
  236. if (e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE)
  237. {
  238. this.btnBindBarCode_Click(sender, e);
  239. }
  240. }
  241. /// <summary>
  242. /// 绑定条码
  243. /// </summary>
  244. /// <param name="sender"></param>
  245. /// <param name="e"></param>
  246. private void btnBindBarCode_Click(object sender, EventArgs e)
  247. {
  248. if (!_canEdit)
  249. {
  250. return;
  251. }
  252. try
  253. {
  254. string barcodeBegin = this.txtBarCodeStart.Text.Trim();
  255. if (barcodeBegin.Length <= 0)
  256. {
  257. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_C_003, this.lblBarCodeStart.Text);
  258. this.txtBarCodeStart.Focus();
  259. return;
  260. }
  261. System.Text.RegularExpressions.Match mc =
  262. System.Text.RegularExpressions.Regex.Match(barcodeBegin, @"^([a-zA-Z]*|[a-zA-Z0-9]*[a-zA-Z]+)([0-9]{10,})$");
  263. if (!mc.Success)
  264. {
  265. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_C_005, barcodeBegin);
  266. this.txtBarCodeStart.Focus();
  267. return;
  268. }
  269. string strLetter = mc.Groups[1].Value;
  270. string strDigit = mc.Groups[2].Value;
  271. decimal digit = Convert.ToDecimal(strDigit);
  272. int len = strDigit.Length;
  273. foreach (DataGridViewRow row in this.dgvDetail.Rows)
  274. {
  275. object sf = row.Cells["ScrapFlag"].Value;
  276. if (row.Cells["BarCode"].ReadOnly || sf == null || "1" == sf.ToString())
  277. {
  278. continue;
  279. }
  280. string barcode = strLetter + (digit++).ToString().PadLeft(len, '0');
  281. row.Cells["BarCode"].Value = barcode;
  282. DataRowView dataRow = row.DataBoundItem as DataRowView;
  283. if (dataRow != null)
  284. {
  285. dataRow.EndEdit();
  286. }
  287. }
  288. }
  289. catch (Exception ex)
  290. {
  291. // 对异常进行共通处理
  292. ExceptionManager.HandleEventException(this.ToString(),
  293. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  294. }
  295. }
  296. /// <summary>
  297. /// 清空条码
  298. /// </summary>
  299. /// <param name="sender"></param>
  300. /// <param name="e"></param>
  301. private void btnClearBarCode_Click(object sender, EventArgs e)
  302. {
  303. try
  304. {
  305. this.txtBarCodeStart.Clear();
  306. foreach (DataGridViewRow row in this.dgvDetail.Rows)
  307. {
  308. if (!row.Cells["BarCode"].ReadOnly)
  309. {
  310. row.Cells["BarCode"].Value = DBNull.Value;
  311. }
  312. }
  313. }
  314. catch (Exception ex)
  315. {
  316. // 对异常进行共通处理
  317. ExceptionManager.HandleEventException(this.ToString(),
  318. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  319. }
  320. }
  321. /// <summary>
  322. /// 保存数据
  323. /// </summary>
  324. private void btnSave_Click(object sender, EventArgs e)
  325. {
  326. // 没有注浆数据
  327. if (this.DataSource == null || this._dailyId <= 0)
  328. {
  329. return;
  330. }
  331. try
  332. {
  333. // 验证条码重复
  334. DataTable dtGROUTINGDAILYDETAIL = this.DataSource.Tables[1];
  335. foreach (DataRow row in dtGROUTINGDAILYDETAIL.Rows)
  336. {
  337. string barcode = row["Barcode"].ToString().Trim();
  338. if (string.IsNullOrWhiteSpace(barcode))
  339. {
  340. row["Barcode"] = DBNull.Value;
  341. continue;
  342. }
  343. else
  344. {
  345. row["Barcode"] = barcode;
  346. }
  347. DataRow[] drs = dtGROUTINGDAILYDETAIL.Select("Barcode = '" + barcode
  348. + "' AND GROUTINGDAILYDETAILID <> " + row["GROUTINGDAILYDETAILID"]);
  349. if (drs != null && drs.Length > 0)
  350. {
  351. MessageBox.Show("注浆信息中有重复条码【" + barcode + "】",
  352. this.Text,
  353. MessageBoxButtons.OK,
  354. MessageBoxIcon.Warning);
  355. return;
  356. }
  357. }
  358. ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
  359. {
  360. return PMModuleProxyNew.Service.SetFPM0103Data(this.DataSource);
  361. }
  362. );
  363. if (sre.Status == Constant.ServiceResultStatus.Success)
  364. {
  365. DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_002);
  366. if (this.GroutingDailyIDs == null)
  367. {
  368. this.GroutingDailyIDs = new List<int>();
  369. }
  370. this.GroutingDailyIDs.Add(this._dailyId);
  371. //this.DialogResult = DialogResult.OK;
  372. //this.Close();
  373. this._dailyId = 0;
  374. this.lblGroutingDateValue.Text = string.Empty;
  375. //this.txtGrouting.Clear();
  376. this.txtGrouting.Text = null;
  377. this.txtBarCodeStart.Clear();
  378. this.dgvDetail.DataSource = null;
  379. this.btnSave.Enabled = false;
  380. return;
  381. }
  382. if (sre.Status == Constant.ServiceResultStatus.Other)
  383. {
  384. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_S_004, sre.Message);
  385. }
  386. this.SetEditGrid();
  387. }
  388. catch (Exception ex)
  389. {
  390. this.SetEditGrid();
  391. // 对异常进行共通处理
  392. ExceptionManager.HandleEventException(this.ToString(),
  393. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  394. }
  395. }
  396. /// <summary>
  397. /// 关闭窗体
  398. /// </summary>
  399. private void btnCancel_Click(object sender, EventArgs e)
  400. {
  401. this.DialogResult = DialogResult.Cancel;
  402. this.Close();
  403. }
  404. #endregion
  405. #region 私有方法
  406. /// <summary>
  407. /// 初始化控件
  408. /// </summary>
  409. private void InitializeControls()
  410. {
  411. this.Text = FormTitles.F_PM_0103;
  412. // 功能按钮文本赋值
  413. //this.tsbtnGrouting.Text = ButtonText.TSBTN_;
  414. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  415. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  416. this.btnSave.Text = ButtonText.BTN_SAVE;
  417. this.btnClose.Text = ButtonText.BTN_CLOSE;
  418. this.dgvDetail.AutoGenerateColumns = false;
  419. this.lblGroutingDateValue.Text = string.Empty;
  420. this.btnBindBarCode.Text = ButtonText.BTN_BINDBARCODE;
  421. this.btnClearBarCode.Text = ButtonText.BTN_CLEARBARCODE;
  422. this.txtBarCodeStart.ReadOnly = true;
  423. this.btnBindBarCode.Enabled = false;
  424. this.btnClearBarCode.Enabled = false;
  425. }
  426. /// <summary>
  427. /// 取得注浆日报信息
  428. /// </summary>
  429. private void InitializeData()
  430. {
  431. try
  432. {
  433. if (this._dailyId > 0)
  434. {
  435. this.DataSource = null;
  436. this.dgvDetail.DataSource = null;
  437. this.txtBarCodeStart.Clear();
  438. //this.txtGrouting.Clear();
  439. this.txtGrouting.Text = null;
  440. // 获取成型线类型数据并绑定到控件上
  441. ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
  442. {
  443. return PMModuleProxyNew.Service.GetFPM0103Data(this._dailyId);
  444. }
  445. );
  446. if (sre.Status == Constant.ServiceResultStatus.Other)
  447. {
  448. DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_S_004, sre.Message);
  449. return;
  450. }
  451. if (sre.Status != Constant.ServiceResultStatus.Success)
  452. {
  453. return;
  454. }
  455. _canEdit = ((int)sre.Result == 1);
  456. this.DataSource = sre.Data;
  457. DataRow lineDataRow = sre.Data.Tables[0].Rows[0];
  458. this._groutingDate = Convert.ToDateTime(lineDataRow["GroutingDate"]);
  459. this.lblGroutingDateValue.Text = this._groutingDate.ToString(Constant.S_DATE_YYYY_MM_DD);
  460. if (_canEdit)
  461. {
  462. this.txtGrouting.Text = string.Format("{0}({1})", lineDataRow["GroutingLineCode"], lineDataRow["MouldQuantity"]);
  463. this.txtGrouting.ForeColor = System.Drawing.Color.Black;
  464. }
  465. else
  466. {
  467. this.txtGrouting.Text = string.Format("{0}({1}) {2}", lineDataRow["GroutingLineCode"], lineDataRow["MouldQuantity"], sre.Message);
  468. this.txtGrouting.ForeColor = System.Drawing.Color.Red;
  469. }
  470. this.dgvDetail.DataSource = sre.Data.Tables[1];
  471. this.SetEditGrid();
  472. if (_canEdit)
  473. {
  474. this.btnBindBarCode.Enabled = true;
  475. this.txtBarCodeStart.ReadOnly = false;
  476. }
  477. else
  478. {
  479. this.btnBindBarCode.Enabled = false;
  480. this.txtBarCodeStart.ReadOnly = true;
  481. }
  482. this.btnClearBarCode.Enabled = true;
  483. this.btnSave.Enabled = true;
  484. this.txtBarCodeStart.Focus();
  485. }
  486. }
  487. catch (Exception ex)
  488. {
  489. throw ex;
  490. }
  491. }
  492. /// <summary>
  493. /// 编辑模式下设置Grid编辑状态
  494. /// </summary>
  495. private void SetEditGrid()
  496. {
  497. foreach (DataGridViewRow row in this.dgvDetail.Rows)
  498. {
  499. // 未注浆的,不能编辑
  500. object groutingFlag = row.Cells["GroutingFlag"].Value;
  501. if (groutingFlag == null || ((int)Constant.GroutingFlag.Yes).ToString() != groutingFlag.ToString())
  502. {
  503. row.Cells["BarCode"].ReadOnly = true;
  504. row.Cells["ScrapFlag"].ReadOnly = true;
  505. //row.Cells["Remarks"].ReadOnly = true;
  506. //row.Cells["colLogo"].ReadOnly = true;
  507. continue;
  508. }
  509. // 交坯后,不能编辑
  510. object deliverFlag = row.Cells["DeliverFlag"].Value;
  511. if (deliverFlag != null && "1" == deliverFlag.ToString())
  512. {
  513. row.Cells["BarCode"].ReadOnly = true;
  514. row.Cells["ScrapFlag"].ReadOnly = true;
  515. //row.Cells["Remarks"].ReadOnly = true;
  516. row.Cells["colLogo"].ReadOnly = true;
  517. continue;
  518. }
  519. // 绑定条码后,不能编辑条码
  520. object obarCode = row.Cells["colOBarCode"].Value;
  521. if (obarCode != null && !string.IsNullOrWhiteSpace(obarCode.ToString()))
  522. {
  523. row.Cells["BarCode"].ReadOnly = true;
  524. continue;
  525. }
  526. //object oscrapFlag = row.Cells["colOScrapFlag"].Value;
  527. //if (oscrapFlag != null && ((int)Constant.GroutingScrapFlag.Yes).ToString() == oscrapFlag.ToString())
  528. //{
  529. // row.ReadOnly = true;
  530. // row.Cells["Remarks"].ReadOnly = false;
  531. //}
  532. // 损坯后,不能编辑
  533. if (((int)Constant.GroutingScrapFlag.Yes).ToString() == row.Cells["ScrapFlag"].Value.ToString())
  534. {
  535. row.Cells["BarCode"].Value = DBNull.Value;
  536. row.Cells["BarCode"].ReadOnly = true;
  537. continue;
  538. }
  539. if (!_canEdit)
  540. {
  541. row.Cells["BarCode"].ReadOnly = true;
  542. continue;
  543. }
  544. row.Cells["BarCode"].ReadOnly = false;
  545. }
  546. this.dgvDetail.IsSetInputColumnsColor = true;
  547. }
  548. #endregion
  549. private void btnNGRSetting_Click(object sender, EventArgs e)
  550. {
  551. if (this.cmbLogo.SelectedIndex < 0)
  552. {
  553. return;
  554. }
  555. try
  556. {
  557. foreach (DataGridViewRow row in this.dgvDetail.Rows)
  558. {
  559. if (!row.Cells["colLogo"].ReadOnly)
  560. {
  561. row.Cells["colLogo"].Value = this.cmbLogo.SelectedValue;
  562. DataRowView dataRow = row.DataBoundItem as DataRowView;
  563. if (dataRow != null)
  564. {
  565. dataRow.EndEdit();
  566. }
  567. }
  568. }
  569. }
  570. catch (Exception ex)
  571. {
  572. // 对异常进行共通处理
  573. ExceptionManager.HandleEventException(this.ToString(),
  574. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  575. }
  576. }
  577. /// <summary>
  578. /// 一键绑定条码功能
  579. /// </summary>
  580. /// <param name="sender"></param>
  581. /// <param name="e"></param>
  582. private void btnQuickBindBarCode_Click(object sender, EventArgs e)
  583. {
  584. try
  585. {
  586. DataTable dtDetail = dgvDetail.DataSource as DataTable;
  587. if (dtDetail == null || dtDetail.Rows.Count == 0)
  588. {
  589. return;
  590. }
  591. // 异步处理,获取信息
  592. ClientRequestEntity cre = new ClientRequestEntity();
  593. cre.NameSpace = "F_PM_0108";
  594. cre.Name = "GetBarcodeDraft";
  595. cre.Properties["groutingdate"] = _groutingDate;
  596. // 调用服务器端获取数据集
  597. ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
  598. {
  599. return PMModuleProxyNew.Service.HandleRequest(cre);
  600. }));
  601. if (sre.Data != null && sre.Data.Tables.Count > 0)
  602. {
  603. DataRow[] drBarcodeDraft = null;
  604. foreach (DataRow row in dtDetail.Rows)
  605. {
  606. drBarcodeDraft = sre.Data.Tables[0].Select("groutinglinecode = '" + row["groutinglinecode"]
  607. + "' AND groutingbatchno = " + row["groutingbatchno"]
  608. + " AND groutingmouldcode = '" + row["groutingmouldcode"] + "'");
  609. if (drBarcodeDraft.Length > 0 && (row["GroutingFlag"]+"") == "1" && (row["ScrapFlag"]+"") == "0")
  610. {
  611. row["Barcode"] = drBarcodeDraft[0]["Barcode"];
  612. }
  613. }
  614. }
  615. }
  616. catch (Exception ex)
  617. {
  618. // 对异常进行共通处理
  619. ExceptionManager.HandleEventException(this.ToString(),
  620. MethodBase.GetCurrentMethod().Name, this.Text, ex);
  621. }
  622. }
  623. }
  624. }