姜永辉 пре 4 месеци
родитељ
комит
52f2fd64b5
1 измењених фајлова са 66 додато и 66 уклоњено
  1. 66 66
      DK.Client/PMModule/F_PM_2105.cs

+ 66 - 66
DK.Client/PMModule/F_PM_2105.cs

@@ -378,72 +378,72 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
         /// <param name="e"></param>
         private void btnUpdateUserCode_Click(object sender, EventArgs e)
         {
-            //string groutingUserCode = this.txtGroutingUserCode.Text.Trim();
-            //int? goodsid = this.dkGoodsCode.GoodsID;
-            //try
-            //{
-
-            //    if (this._groutingDailyID == null)
-            //    {
-            //        // 提示信息
-            //        MessageBox.Show("请先查询注浆信息!",
-            //             this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-            //        return;
-            //    }
-
-            //    if (string.IsNullOrWhiteSpace(groutingUserCode) )
-            //    {
-            //        // 提示信息
-            //        MessageBox.Show("请填写成型工号!",
-            //             this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-            //        return;
-            //    }
-
-            //    string GroutingDailyDetailIDs = "";
-            //    DataTable dt = this.dgvGroutingDaily.DataSource as DataTable;
-            //    if (dt != null && dt.Rows.Count > 0)
-            //    {
-            //        //dt.AcceptChanges();
-            //        for (int i = 0; i < dt.Rows.Count; i++)
-            //        {
-            //            if (Convert.ToInt32(dt.Rows[i]["Sel"]) == 1)
-            //            {
-            //                GroutingDailyDetailIDs += dt.Rows[i]["GroutingDailyDetailID"].ToString() + ",";
-            //            }
-            //        }
-            //        GroutingDailyDetailIDs = GroutingDailyDetailIDs.TrimEnd(',');
-            //    }
-            //    ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
-            //    {
-            //        return PCModuleProxy.Service.SetFPM2105DataGroutingUserCode(this._groutingLineID, this._groutingDailyID, GroutingDailyDetailIDs, Convert.ToDateTime(this._groutingDate), this.txtGroutingUserCode.Text.Trim(), this.dkGoodsCode.GoodsID);
-            //    }
-            //    );
-            //    if (sre.Status == Constant.ServiceResultStatus.Success)
-            //    {
-            //        DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_002);
-            //        this.DialogResult = DialogResult.OK;
-            //        this._groutingDailyID = null;
-            //        this._groutingDate = null;
-            //        this.dgvGroutingDaily.DataSource = null;
-            //        this.txtGroutingUserCode.Text = string.Empty;
-            //        this.dkGoodsCode.ClearControl();
-            //        this.scbGroutingLine.ClearValue();
-            //        this.txtGroutingDate.Value = DateTime.Now.Date;
-            //        //this.Close();
-            //        return;
-            //    }
-
-            //    if (sre.Status == Constant.ServiceResultStatus.Other)
-            //    {
-            //        DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_S_004, sre.Message);
-            //    }
-            //}
-            //catch (Exception ex)
-            //{
-            //    // 对异常进行共通处理
-            //    ExceptionManager.HandleEventException(this.ToString(),
-            //        MethodBase.GetCurrentMethod().Name, this.Text, ex);
-            //}
+            string groutingUserCode = this.txtGroutingUserCode.Text.Trim();
+            int? goodsid = this.dkGoodsCode.GoodsID;
+            try
+            {
+
+                if (this._groutingDailyID == null)
+                {
+                    // 提示信息
+                    MessageBox.Show("请先查询注浆信息!",
+                         this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    return;
+                }
+
+                if (string.IsNullOrWhiteSpace(groutingUserCode))
+                {
+                    // 提示信息
+                    MessageBox.Show("请填写成型工号!",
+                         this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    return;
+                }
+
+                string GroutingDailyDetailIDs = "";
+                DataTable dt = this.dgvGroutingDaily.DataSource as DataTable;
+                if (dt != null && dt.Rows.Count > 0)
+                {
+                    //dt.AcceptChanges();
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        if (Convert.ToInt32(dt.Rows[i]["Sel"]) == 1)
+                        {
+                            GroutingDailyDetailIDs += dt.Rows[i]["GroutingDailyDetailID"].ToString() + ",";
+                        }
+                    }
+                    GroutingDailyDetailIDs = GroutingDailyDetailIDs.TrimEnd(',');
+                }
+                ServiceResultEntity sre = this.DoAsync<ServiceResultEntity>(() =>
+                {
+                    return PCModuleProxy.Service.SetFPM2105DataGroutingUserCode(this._groutingLineID, this._groutingDailyID, GroutingDailyDetailIDs, Convert.ToDateTime(this._groutingDate), this.txtGroutingUserCode.Text.Trim(), this.dkGoodsCode.GoodsID);
+                }
+                );
+                if (sre.Status == Constant.ServiceResultStatus.Success)
+                {
+                    DKMessageBox.ShowDialog(this, DKMessageCode.I_CMN_S_002);
+                    this.DialogResult = DialogResult.OK;
+                    this._groutingDailyID = null;
+                    this._groutingDate = null;
+                    this.dgvGroutingDaily.DataSource = null;
+                    this.txtGroutingUserCode.Text = string.Empty;
+                    this.dkGoodsCode.ClearControl();
+                    this.scbGroutingLine.ClearValue();
+                    this.txtGroutingDate.Value = DateTime.Now.Date;
+                    //this.Close();
+                    return;
+                }
+
+                if (sre.Status == Constant.ServiceResultStatus.Other)
+                {
+                    DKMessageBox.ShowDialog(this, DKMessageCode.W_CMN_S_004, sre.Message);
+                }
+            }
+            catch (Exception ex)
+            {
+                // 对异常进行共通处理
+                ExceptionManager.HandleEventException(this.ToString(),
+                    MethodBase.GetCurrentMethod().Name, this.Text, ex);
+            }
         }
     }
 }