F_PM_2201.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. /*******************************************************************************
  2. * Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_2201.cs
  5. * 2.功能描述:半成品检验一览
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2016/06/23 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  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.WCF.DataModels;
  17. using Dongke.IBOSS.PRD.WCF.Proxys;
  18. using Dongke.IBOSS.PRD.WCF.Proxys.PMModuleService;
  19. using Dongke.IBOSS.PRD.WCF.DataModels.PMModule;
  20. namespace Dongke.IBOSS.PRD.Client.PMModule
  21. {
  22. /// <summary>
  23. /// 半成品检验一览
  24. /// </summary>
  25. public partial class F_PM_2201 : DockPanelBase
  26. {
  27. #region 成员变量
  28. //单例模式
  29. private static F_PM_2201 _instance;
  30. #endregion
  31. #region 构造函数
  32. /// <summary>
  33. /// 废弃一览构造
  34. /// </summary>
  35. public F_PM_2201()
  36. {
  37. InitializeComponent();
  38. this.Text = FormTitles.F_PM_2201;
  39. this.tsbtnSemiCheck.Text = ButtonText.TSBTN_SEMICHECK;
  40. this.tsbtnReSemiCheck.Text = ButtonText.TSBTN_RESEMICHECK;
  41. this.tsbtnBackReSemiCheck.Text = ButtonText.TSBTN_BACKRESEMICHECK;
  42. this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
  43. this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
  44. this.btnSearch.Text = ButtonText.BTN_SEARCH;
  45. this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
  46. }
  47. #endregion
  48. #region 单例模式
  49. /// <summary>
  50. /// 单例模式,防止重复创建窗体
  51. /// </summary>
  52. public static F_PM_2201 Instance
  53. {
  54. get
  55. {
  56. if (_instance == null)
  57. {
  58. _instance = new F_PM_2201();
  59. }
  60. return _instance;
  61. }
  62. }
  63. #endregion
  64. #region 事件
  65. /// <summary>
  66. /// 打开新建窗体事件
  67. /// </summary>
  68. /// <param name="sender"></param>
  69. /// <param name="e"></param>
  70. private void tsbtnSemiCheck_Click(object sender, EventArgs e)
  71. {
  72. try
  73. {
  74. F_PM_2202 frmFPM2202 = new F_PM_2202(0, "半检登记");
  75. DialogResult dialogresult = frmFPM2202.ShowDialog();
  76. if (dialogresult.Equals(DialogResult.OK))
  77. {
  78. btnSearch_Click(sender, e);
  79. }
  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 btnSearch_Click(object sender, EventArgs e)
  94. {
  95. try
  96. {
  97. DataSet dsSemiCheck = (DataSet)DoAsync(new AsyncMethod(() =>
  98. {
  99. return this.GetSemiCheck();
  100. }));
  101. if (dsSemiCheck != null)
  102. {
  103. if (dsSemiCheck.Tables[0].Rows.Count != Constant.INT_IS_ZERO)
  104. {
  105. this.dgvSemiCheck.DataSource = ((DataSet)dsSemiCheck).Tables[Constant.INT_IS_ZERO];
  106. this.dgvSemiCheck.ReadOnly = true;
  107. this.dgvSemiCheck.Rows[0].Selected = true;
  108. }
  109. else
  110. {
  111. this.dgvSemiCheck.DataSource = null;
  112. this.dgvSemiCheckDefect.DataSource = null;
  113. // 提示未查找到数据
  114. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  115. MessageBoxButtons.OK, MessageBoxIcon.Information);
  116. }
  117. }
  118. else
  119. {
  120. this.dgvSemiCheck.DataSource = null;
  121. this.dgvSemiCheckDefect.DataSource = null;
  122. // 提示未查找到数据
  123. MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
  124. MessageBoxButtons.OK, MessageBoxIcon.Information);
  125. }
  126. }
  127. catch (Exception ex)
  128. {
  129. // 对异常进行共通处理
  130. ExceptionManager.HandleEventException(this.ToString(),
  131. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  132. }
  133. }
  134. /// <summary>
  135. /// 时间有效性切换
  136. /// </summary>
  137. /// <param name="sender"></param>
  138. /// <param name="e"></param>
  139. private void cbCDateTime_CheckedChanged(object sender, EventArgs e)
  140. {
  141. this.txtCDateTimeStart.Enabled = this.cbCDateTime.Checked;
  142. this.txtCDateTimeEnd.Enabled = this.cbCDateTime.Checked;
  143. }
  144. /// <summary>
  145. /// 清空条件
  146. /// </summary>
  147. /// <param name="sender"></param>
  148. /// <param name="e"></param>
  149. private void btnClearCondition_Click(object sender, EventArgs e)
  150. {
  151. this.dkCProcedureSearchBox.ClearControl();
  152. this.cbCDateTime.Checked = false;
  153. //this.txtCDateTimeStart.Value = DateTime.Now;
  154. //this.txtCDateTimeEnd.Value = DateTime.Now;
  155. this.txtCUserCode.Text = string.Empty;
  156. this.scbGoodsType.ClearValue();
  157. this.txtGoodsCode.Text = string.Empty;
  158. this.txtGroutingUserCode.Text = string.Empty;
  159. this.cbGroutingDate.Checked = false;
  160. //this.txtGroutingDateTimeStart.Value = DateTime.Now;
  161. //this.txtGroutingDateTimeEnd.Value = DateTime.Now;
  162. this.cbDeliveryDate.Checked = false;
  163. //this.txtDeliveryDateTimeStart.Value = DateTime.Now;
  164. //this.txtDeliveryDateTimeEnd.Value = DateTime.Now;
  165. // this.chkSemiCheckType.SelectedValues = null;
  166. this.chkSemiCheckType.SelectedValues = new object[] { -1 };
  167. this.cbSemiCheck.Checked = true;
  168. //this.txtSemiCheckDateTimeStart.Value = DateTime.Now;
  169. //this.txtSemiCheckDateTimeEnd.Value = DateTime.Now;
  170. this.txtSemiCheckUserCode.Text = string.Empty;
  171. this.dkRProcedureSearchBox.ClearControl();
  172. this.txtReworkUserCode.Text = string.Empty;
  173. this.chkReSemiCheckType.SelectedValues = new object[] { -1 };
  174. this.cbReSemiCheck.Checked = false;
  175. //this.txtReSemiCheckDateTimeStart.Value = DateTime.Now;
  176. //this.txtReSemiCheckDateTimeEnd.Value = DateTime.Now;
  177. this.txtReSemiCheckUserCode.Text = string.Empty;
  178. this.chkVYes.Checked = false;
  179. this.chkVNo.Checked = true;
  180. this.cbBackOutTime.Checked = false;
  181. //this.txtBackOutTimeStart.Value = DateTime.Now;
  182. //this.txtBackOutTimeEnd.Value = DateTime.Now;
  183. this.txtBackOutUserCode.Text = string.Empty;
  184. this.txtBarCode.Text = string.Empty;
  185. // 设置日期控件默认值
  186. this.txtCDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  187. this.txtCDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  188. this.txtGroutingDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  189. this.txtGroutingDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  190. this.txtSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  191. this.txtSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  192. this.txtReSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  193. this.txtReSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  194. this.txtBackOutTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  195. this.txtBackOutTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  196. this.txtDeliveryDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  197. this.txtDeliveryDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  198. }
  199. /// <summary>
  200. /// 编辑窗体打开
  201. /// </summary>
  202. /// <param name="sender"></param>
  203. /// <param name="e"></param>
  204. private void tsbtnReSemiCheck_Click(object sender, EventArgs e)
  205. {
  206. try
  207. {
  208. F_PM_2204 frmFPM2204 = new F_PM_2204(0, "复检登记");
  209. DialogResult dialogresult = frmFPM2204.ShowDialog();
  210. if (dialogresult.Equals(DialogResult.OK))
  211. {
  212. btnSearch_Click(sender, e);
  213. }
  214. }
  215. catch (Exception ex)
  216. {
  217. // 对异常进行共通处理
  218. ExceptionManager.HandleEventException(this.ToString(),
  219. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  220. }
  221. }
  222. /// <summary>
  223. /// 编辑窗体打开
  224. /// </summary>
  225. /// <param name="sender"></param>
  226. /// <param name="e"></param>
  227. private void dgvScrapProduct_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  228. {
  229. try
  230. {
  231. //DataGridViewRow currentRow = this.dgvScrapProduct.CurrentRow;
  232. //if (currentRow != null)
  233. //{
  234. // string barCode = currentRow.Cells["BarCode"].Value.ToString();
  235. // int SPId = Convert.ToInt32(currentRow.Cells["ScrapProductID"].Value.ToString());
  236. // F_PM_1102 frmFPM1102 = new F_PM_1102(Constant.FormMode.Edit, barCode, SPId, this.tsbtnApprover.Visible);
  237. // DialogResult dialogresult = frmFPM1102.ShowDialog();
  238. // if (dialogresult.Equals(DialogResult.OK))
  239. // {
  240. // this.dgvScrapProduct.DataSource = null;
  241. // object obScrapResult = DoAsync(new AsyncMethod(GetScrapProduct));
  242. // if (obScrapResult != null)
  243. // {
  244. // DataSet dsScrap = (DataSet)obScrapResult;
  245. // if (dsScrap.Tables.Count != Constant.INT_IS_ZERO)
  246. // {
  247. // this.dgvScrapProduct.DataSource = dsScrap.Tables[Constant.INT_IS_ZERO];
  248. // this.dgvScrapProduct.ReadOnly = true;
  249. // }
  250. // }
  251. // }
  252. //}
  253. //else
  254. //{
  255. // MessageBox.Show(Messages.MSG_CMN_W020, this.Text,
  256. // MessageBoxButtons.OK, MessageBoxIcon.Warning);
  257. //}
  258. }
  259. catch (Exception ex)
  260. {
  261. // 对异常进行共通处理
  262. ExceptionManager.HandleEventException(this.ToString(),
  263. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  264. }
  265. }
  266. /// <summary>
  267. /// 关闭一览窗体
  268. /// </summary>
  269. /// <param name="sender"></param>
  270. /// <param name="e"></param>
  271. private void tsbtnClose_Click(object sender, EventArgs e)
  272. {
  273. this.Close();
  274. }
  275. /// <summary>
  276. /// 窗体关闭事件
  277. /// </summary>
  278. /// <param name="sender"></param>
  279. /// <param name="e"></param>
  280. private void F_PM_2201_FormClosed(object sender, FormClosedEventArgs e)
  281. {
  282. _instance = null;
  283. }
  284. /// <summary>
  285. /// 自动列宽
  286. /// </summary>
  287. /// <param name="sender"></param>
  288. /// <param name="e"></param>
  289. private void tsbtnAdaptive_Click(object sender, EventArgs e)
  290. {
  291. this.dgvSemiCheck.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  292. this.dgvSemiCheckDefect.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
  293. }
  294. /// <summary>
  295. /// 审批按钮事件
  296. /// </summary>
  297. /// <param name="sender"></param>
  298. /// <param name="e"></param>
  299. private void tsbtnApprover_Click(object sender, EventArgs e)
  300. {
  301. try
  302. {
  303. //DataGridViewRow currentRow = this.dgvScrapProduct.CurrentRow;
  304. //if (currentRow != null)
  305. //{
  306. // string barCode = currentRow.Cells["BarCode"].Value.ToString();
  307. // int ScrapProductID = Convert.ToInt32(currentRow.Cells["ScrapProductID"].Value);
  308. // string GoodsLevelTypeID = currentRow.Cells["GoodsLevelTypeID"].Value.ToString();
  309. // if (GoodsLevelTypeID != _goodsLevelTypeID.ToString())
  310. // {
  311. // return;
  312. // }
  313. // F_PM_1103 frmFPM1103 = new F_PM_1103(barCode, 0, ScrapProductID);
  314. // DialogResult dialogresult = frmFPM1103.ShowDialog();
  315. // if (dialogresult.Equals(DialogResult.OK))
  316. // {
  317. // this.dgvScrapProduct.DataSource = null;
  318. // object obScrapResult = DoAsync(new AsyncMethod(GetScrapProduct));
  319. // if (obScrapResult != null)
  320. // {
  321. // DataSet dsScrap = (DataSet)obScrapResult;
  322. // if (dsScrap.Tables.Count != Constant.INT_IS_ZERO)
  323. // {
  324. // this.dgvScrapProduct.DataSource = dsScrap.Tables[Constant.INT_IS_ZERO];
  325. // this.dgvScrapProduct.ReadOnly = true;
  326. // }
  327. // }
  328. // }
  329. //}
  330. //else
  331. //{
  332. // MessageBox.Show(Messages.MSG_CMN_W020, this.Text,
  333. // MessageBoxButtons.OK, MessageBoxIcon.Warning);
  334. //}
  335. }
  336. catch (Exception ex)
  337. {
  338. // 对异常进行共通处理
  339. ExceptionManager.HandleEventException(this.ToString(),
  340. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  341. }
  342. }
  343. /// <summary>
  344. /// 窗体加载
  345. /// </summary>
  346. /// <param name="sender"></param>
  347. /// <param name="e"></param>
  348. private void F_PM_2201_Load(object sender, EventArgs e)
  349. {
  350. try
  351. {
  352. // 加载权限
  353. FormPermissionManager.FormPermissionControl(this.Name, this,
  354. Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
  355. Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
  356. this.dgvSemiCheck.AutoGenerateColumns = false;
  357. this.dgvSemiCheckDefect.AutoGenerateColumns = false;
  358. // 设置日期控件默认值
  359. this.txtCDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  360. this.txtCDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  361. this.txtGroutingDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  362. this.txtGroutingDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  363. this.txtSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  364. this.txtSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  365. this.txtReSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  366. this.txtReSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  367. this.txtBackOutTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  368. this.txtBackOutTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  369. this.txtDeliveryDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
  370. this.txtDeliveryDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
  371. // 加载半检,复检状态数据源
  372. DataSet dsGetSemiCheckType = SystemModuleProxy.Service.GetSemiCheckType();
  373. if (dsGetSemiCheckType != null && dsGetSemiCheckType.Tables[0].Rows.Count > 0)
  374. {
  375. DataRow[] drSemiCheckType = dsGetSemiCheckType.Tables[0].Select("Semichecktype=1");
  376. if (drSemiCheckType.Length > 0)
  377. {
  378. this.chkSemiCheckType.ValueMember = "Semichecktypeid";
  379. this.chkSemiCheckType.DisplayMember = "Semichecktypename";
  380. this.chkSemiCheckType.DataSource = drSemiCheckType.CopyToDataTable();
  381. }
  382. DataRow[] drReSemiCheckType = dsGetSemiCheckType.Tables[0].Select("Semichecktype=2");
  383. if (drReSemiCheckType.Length > 0)
  384. {
  385. this.chkReSemiCheckType.ValueMember = "Semichecktypeid";
  386. this.chkReSemiCheckType.DisplayMember = "Semichecktypename";
  387. this.chkReSemiCheckType.DataSource = drReSemiCheckType.CopyToDataTable();
  388. }
  389. }
  390. }
  391. catch (Exception ex)
  392. {
  393. // 对异常进行共通处理
  394. ExceptionManager.HandleEventException(this.ToString(),
  395. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  396. }
  397. }
  398. /// <summary>
  399. /// 注浆时间复选框改变事件
  400. /// </summary>
  401. /// <param name="sender"></param>
  402. /// <param name="e"></param>
  403. private void cbGroutingDate_CheckedChanged(object sender, EventArgs e)
  404. {
  405. this.txtGroutingDateTimeStart.Enabled = this.cbGroutingDate.Checked;
  406. this.txtGroutingDateTimeEnd.Enabled = this.cbGroutingDate.Checked;
  407. }
  408. /// <summary>
  409. /// 半检时间复选框改变事件
  410. /// </summary>
  411. /// <param name="sender"></param>
  412. /// <param name="e"></param>
  413. private void cbSemiCheck_CheckedChanged(object sender, EventArgs e)
  414. {
  415. this.txtSemiCheckDateTimeStart.Enabled = this.cbSemiCheck.Checked;
  416. this.txtSemiCheckDateTimeEnd.Enabled = this.cbSemiCheck.Checked;
  417. }
  418. /// <summary>
  419. /// 复检时间复选框改变事件
  420. /// </summary>
  421. /// <param name="sender"></param>
  422. /// <param name="e"></param>
  423. private void cbReSemiCheck_CheckedChanged(object sender, EventArgs e)
  424. {
  425. this.txtReSemiCheckDateTimeStart.Enabled = this.cbReSemiCheck.Checked;
  426. this.txtReSemiCheckDateTimeEnd.Enabled = this.cbReSemiCheck.Checked;
  427. }
  428. /// <summary>
  429. /// 撤销时间复选框改变事件
  430. /// </summary>
  431. /// <param name="sender"></param>
  432. /// <param name="e"></param>
  433. private void cbBackOutTime_CheckedChanged(object sender, EventArgs e)
  434. {
  435. this.txtBackOutTimeStart.Enabled = this.cbBackOutTime.Checked;
  436. this.txtBackOutTimeEnd.Enabled = this.cbBackOutTime.Checked;
  437. }
  438. private void cbDeliveryDate_CheckedChanged(object sender, EventArgs e)
  439. {
  440. this.txtDeliveryDateTimeStart.Enabled = this.cbDeliveryDate.Checked;
  441. this.txtDeliveryDateTimeEnd.Enabled = this.cbDeliveryDate.Checked;
  442. }
  443. /// <summary>
  444. /// 选定项改变事件
  445. /// </summary>
  446. /// <param name="sender"></param>
  447. /// <param name="e"></param>
  448. private void dgvSemiCheck_SelectionChanged(object sender, EventArgs e)
  449. {
  450. try
  451. {
  452. if (this.dgvSemiCheck.CurrentCell != null)
  453. {
  454. if (!this.txtBarCode.ReadOnly)
  455. {
  456. this.dgvSemiCheckDefect.DataSource = null;
  457. int semiCheckID = Convert.ToInt32(this.dgvSemiCheck.Rows[this.dgvSemiCheck.CurrentCell.RowIndex].Cells["SemiCheckID"].Value.ToString());
  458. DataSet dsSemiCheckDefect = (DataSet)DoAsync(new AsyncMethod(() =>
  459. {
  460. return PMModuleProxy.Service.GetSemiCheckDefect(semiCheckID);
  461. }));
  462. if (dsSemiCheckDefect != null && dsSemiCheckDefect.Tables.Count > Constant.INT_IS_ZERO
  463. && dsSemiCheckDefect.Tables[0].Rows.Count > Constant.INT_IS_ZERO)
  464. {
  465. this.dgvSemiCheckDefect.DataSource = dsSemiCheckDefect.Tables[0];
  466. }
  467. this.dgvSemiCheck.Focus();
  468. }
  469. }
  470. }
  471. catch (Exception ex)
  472. {
  473. // 对异常进行共通处理
  474. ExceptionManager.HandleEventException(this.ToString(),
  475. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  476. }
  477. }
  478. /// <summary>
  479. /// 撤销复检按钮事件
  480. /// </summary>
  481. /// <param name="sender"></param>
  482. /// <param name="e"></param>
  483. private void tsbtnBackReSemiCheck_Click(object sender, EventArgs e)
  484. {
  485. try
  486. {
  487. F_PM_2205 frmFPM2205 = new F_PM_2205(0, "撤销复检");
  488. DialogResult dialogresult = frmFPM2205.ShowDialog();
  489. if (dialogresult.Equals(DialogResult.OK))
  490. {
  491. btnSearch_Click(sender, e);
  492. }
  493. }
  494. catch (Exception ex)
  495. {
  496. // 对异常进行共通处理
  497. ExceptionManager.HandleEventException(this.ToString(),
  498. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  499. }
  500. }
  501. #endregion
  502. #region 私有方法
  503. /// <summary>
  504. /// 根据界面查询条件获取数据集
  505. /// </summary>
  506. private DataSet GetSemiCheck()
  507. {
  508. try
  509. {
  510. SemiCheckEntity entity = new SemiCheckEntity();
  511. entity.CProcedureIDS = this.dkCProcedureSearchBox.ProcedureIDS;
  512. if (cbCDateTime.Checked)
  513. {
  514. entity.CDateTimeStart = this.txtCDateTimeStart.Value;// DateTime.Parse(this.txtCDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  515. entity.CDateTimeEnd = this.txtCDateTimeEnd.Value;// DateTime.Parse(this.txtCDateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  516. }
  517. entity.CUserCode = this.txtCUserCode.Text.Trim();
  518. entity.GoodsTypeCode = scbGoodsType.SearchedValue + "";
  519. entity.GoodsCode = this.txtGoodsCode.Text.Trim();
  520. entity.GroutingUserCode = this.txtGroutingUserCode.Text.Trim();
  521. if (cbGroutingDate.Checked)
  522. {
  523. entity.GroutingDateTimeStart = this.txtGroutingDateTimeStart.Value;// DateTime.Parse(this.txtGroutingDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  524. entity.GroutingDateTimeEnd = this.txtGroutingDateTimeEnd.Value;// DateTime.Parse(this.txtGroutingDateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  525. }
  526. if (cbDeliveryDate.Checked)
  527. {
  528. entity.DeliveryDateTimeStart = this.txtDeliveryDateTimeStart.Value;// DateTime.Parse(this.txtDeliveryDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  529. entity.DeliveryDateTimeEnd = this.txtDeliveryDateTimeEnd.Value;// DateTime.Parse(this.txtDeliveryDateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  530. }
  531. object[] objSemiCheckType = this.chkSemiCheckType.SelectedValues;
  532. string strSemiCheckType = "";
  533. if (objSemiCheckType.Length > 0)
  534. {
  535. for (int i = 0; i < objSemiCheckType.Length; i++)
  536. {
  537. strSemiCheckType += objSemiCheckType[i].ToString() + ",";
  538. }
  539. strSemiCheckType = strSemiCheckType.TrimEnd(',');
  540. }
  541. entity.SemiCheckType = strSemiCheckType;
  542. if (cbSemiCheck.Checked)
  543. {
  544. entity.SemiCheckDateTimeStart = this.txtSemiCheckDateTimeStart.Value;// DateTime.Parse(this.txtSemiCheckDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  545. entity.SemiCheckDateTimeEnd = this.txtSemiCheckDateTimeEnd.Value;// DateTime.Parse(this.txtSemiCheckDateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  546. }
  547. entity.SemiCheckUserCode = this.txtSemiCheckUserCode.Text.Trim();
  548. entity.RProcedureIDS = this.dkRProcedureSearchBox.ProcedureIDS;
  549. entity.ReworkUserCode = this.txtReworkUserCode.Text.Trim();
  550. object[] objReSemiCheckType = this.chkReSemiCheckType.SelectedValues;
  551. string strReSemiCheckType = "";
  552. if (objReSemiCheckType.Length > 0)
  553. {
  554. for (int i = 0; i < objReSemiCheckType.Length; i++)
  555. {
  556. strReSemiCheckType += objReSemiCheckType[i].ToString() + ",";
  557. }
  558. strReSemiCheckType = strReSemiCheckType.TrimEnd(',');
  559. }
  560. entity.ReSemiCheckType = strReSemiCheckType;
  561. if (cbReSemiCheck.Checked)
  562. {
  563. entity.ReSemiCheckDateTimeStart = this.txtReSemiCheckDateTimeStart.Value;// DateTime.Parse(this.txtReSemiCheckDateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  564. entity.ReSemiCheckDateTimeEnd = this.txtReSemiCheckDateTimeEnd.Value;// DateTime.Parse(this.txtReSemiCheckDateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  565. }
  566. entity.ReSemiCheckUserCode = this.txtReSemiCheckUserCode.Text.Trim();
  567. string strBackOutFlag = "";
  568. if (chkVYes.Checked)
  569. {
  570. strBackOutFlag = "1,";
  571. }
  572. if (chkVNo.Checked)
  573. {
  574. strBackOutFlag += "0";
  575. }
  576. entity.BackOutFlag = strBackOutFlag.TrimEnd(',');
  577. if (cbBackOutTime.Checked)
  578. {
  579. entity.BackOutTimeStart = this.txtBackOutTimeStart.Value;// DateTime.Parse(this.txtBackOutTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  580. entity.BackOutTimeEnd = this.txtBackOutTimeEnd.Value;// DateTime.Parse(this.txtBackOutTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  581. }
  582. entity.BackOutUserCode = this.txtBackOutUserCode.Text.Trim();
  583. entity.BarCode = this.txtBarCode.Text.Trim();
  584. return PMModuleProxy.Service.GetSemiCheck(entity);
  585. }
  586. catch (Exception ex)
  587. {
  588. throw ex;
  589. }
  590. }
  591. #endregion
  592. }
  593. }