F_PM_2109.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:F_PM_2102.cs
  5. * 2.功能描述:新增盘点单
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王鑫 2015/05/13 1.00 新建
  9. *******************************************************************************/
  10. using System;
  11. using System.Data;
  12. using System.Reflection;
  13. using System.Text;
  14. using System.Windows.Forms;
  15. using Dongke.IBOSS.PRD.Basics.BaseControls;
  16. using Dongke.IBOSS.PRD.Basics.BaseResources;
  17. using Dongke.IBOSS.PRD.Client.CommonModule;
  18. using Dongke.IBOSS.PRD.Client.Controls;
  19. using Dongke.IBOSS.PRD.WCF.DataModels;
  20. using Dongke.IBOSS.PRD.WCF.Proxys;
  21. namespace Dongke.IBOSS.PRD.Client.PMModule
  22. {
  23. public partial class F_PM_2109 : DKFormBase
  24. {
  25. #region 构造函数
  26. public F_PM_2109()
  27. {
  28. InitializeComponent();
  29. this.btnClose.Text = ButtonText.BTN_CLOSE;
  30. this.btnSave.Text = ButtonText.BTN_SAVE;
  31. }
  32. #endregion
  33. #region 事件
  34. /// <summary>
  35. /// 关闭按钮事件
  36. /// </summary>
  37. /// <param name="sender"></param>
  38. /// <param name="e"></param>
  39. private void tsbtnClose_Click(object sender, EventArgs e)
  40. {
  41. this.Close();
  42. }
  43. /// <summary>
  44. /// 窗体加载事件
  45. /// </summary>
  46. /// <param name="sender"></param>
  47. /// <param name="e"></param>
  48. private void F_PM_2102_Load(object sender, EventArgs e)
  49. {
  50. this.dtpUpdateTimeStart.Value = DateTime.Now.Date;
  51. this.dtpUpdateTimeEnd.Value = DateTime.Now.Date;
  52. }
  53. /// <summary>
  54. /// 保存按钮事件
  55. /// </summary>
  56. /// <param name="sender"></param>
  57. /// <param name="e"></param>
  58. private void btnSave_Click(object sender, EventArgs e)
  59. {
  60. try
  61. {
  62. DialogResult dialogResult
  63. = MessageBox.Show("确认是否清除符合条件的在产产品?",
  64. this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  65. if (dialogResult.Equals(DialogResult.No))
  66. {
  67. return;
  68. }
  69. RPT010401_SE se = new RPT010401_SE();
  70. se.ProductionLineIDS = dkproductionLineSearchBox.ProductionLineIDS;
  71. se.ProcedureIDS = dkProcedureSearchBox.ProcedureIDS;
  72. se.UpdateTimeStart = DateTime.Parse(this.dtpUpdateTimeStart.Value.ToString("yyyy-MM-dd") + " 0:0:0");
  73. se.UpdateTimeEnd = DateTime.Parse(this.dtpUpdateTimeEnd.Value.ToString("yyyy-MM-dd") + " 23:59:59");
  74. se.inscrapflag = 0;// this.chkInScrapFlag.Checked ? 1 : 0;//是否清除报损待审产品
  75. se.IsReworkFlag = 0;// this.chkIsReworkFlag.Checked ? 1 : 0;//是否清除返工产品
  76. // 清除
  77. int result = (int)DoAsync(() =>
  78. {
  79. return PMModuleProxy.Service.SaveClearAllInproduction(se);
  80. });
  81. if (result > Constant.INT_IS_ZERO)
  82. {
  83. MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "在产产品", "批量清除数据"),
  84. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  85. // 刷新窗口数据
  86. this.DialogResult = DialogResult.OK;
  87. }
  88. else
  89. {
  90. MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "在产产品", "批量清除数据"),
  91. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  92. return;
  93. }
  94. }
  95. catch (Exception ex)
  96. {
  97. // 对异常进行共通处理
  98. ExceptionManager.HandleEventException(this.ToString(),
  99. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  100. }
  101. }
  102. #endregion
  103. }
  104. }