From fbe33a615f1c4e798a0f8e58163e68c3ce789614 Mon Sep 17 00:00:00 2001
From: lg <123456>
Date: 星期四, 20 十一月 2025 10:17:49 +0800
Subject: [PATCH] 初始化标准版

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs |  127 +++++++++++++++++++++++++++++++++---------
 1 files changed, 100 insertions(+), 27 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs
index d30aee1..897b18c 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmAql1.cs
@@ -7,6 +7,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Linq;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm.QC
@@ -57,6 +58,7 @@
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "foneChecked", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -125,7 +127,7 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -139,6 +141,7 @@
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
+                    ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
                     if (xtraTabControl1.SelectedTabPageIndex == 0)
                     {
                         getPageList(this.pageBar1.CurrentPage);
@@ -146,11 +149,12 @@
                     else
                         Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                 }
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                else
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -187,7 +191,7 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -200,6 +204,7 @@
                 List<GridView> gridViews = new List<GridView>();
                 gridViews.Add(gvMx1);
                 gridViews.Add(gvMx2);
+                gridViews.Add(gvMx3);
                 UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gridViews);
             }
         }
@@ -215,9 +220,11 @@
             List<GridView> gridViews = new List<GridView>();
             gridViews.Add(gvMx1);
             gridViews.Add(gvMx2);
+            gridViews.Add(gvMx3);
             UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+            UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
             txt_createDate.Text = DateTime.Now.ToString("G");
             txt_fversion.Text = "1";
         }
@@ -231,14 +238,14 @@
             toolBarMenu1.isSetBtn = false;
             if (string.IsNullOrEmpty(txt_sampleSizeNo.Text.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鏍囧噯缂栫爜涓嶈兘涓虹┖锛�");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("鏍囧噯缂栫爜涓嶈兘涓虹┖锛�");
                 txt_sampleSizeNo.Focus();
                 return;
             }
 
             if (string.IsNullOrEmpty(txt_sampleSizeName.Text.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鏍囧噯鍚嶇О涓嶈兘涓虹┖锛�");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("鏍囧噯鍚嶇О涓嶈兘涓虹┖锛�");
                 txt_sampleSizeName.Focus();
                 return;
             }
@@ -248,6 +255,9 @@
             gvMx2.CloseEditor();
             gvMx2.PostEditor();
             gvMx2.UpdateCurrentRow();
+            gvMx3.CloseEditor();
+            gvMx3.PostEditor();
+            gvMx3.UpdateCurrentRow();
             try
             {
                 var qmaql2 = new List<MesQmAql2>();
@@ -323,14 +333,40 @@
                         });
                     }
                 }
+                var qmaql4 = new List<MesQmAql4>();
+                for (var i = 0; i < gvMx3.DataRowCount; i++)
+                {
+                    var row = gvMx3.GetDataRow(i);
+                    if (row != null)
+                    {
+                        if (string.IsNullOrEmpty(row["FacLevel"].ToString()))
+                        {
+                            MsgHelper.ShowError("鎷掓敹璐ㄩ噺姘村钩涓嶈兘涓虹┖锛�");
+                            return;
+                        }
+                        qmaql4.Add(new MesQmAql4
+                        {
+                            Guid = UtilityHelper.ToGuid(row["Guid"].ToString()),
+                            AqlTypeCr = row["AqlTypeCr"].ToString(),
+                            AqlTypeMa = row["AqlTypeMa"].ToString(),
+                            AqlTypeMi = row["AqlTypeMi"].ToString(),
+                            FacLevel = row["FacLevel"].ToString(),
+                        });
+                    }
+                }
                 if (qmaql2.Count <= 0)
                 {
-                    Gs.DevApp.ToolBox.MsgHelper.Warning("鏍锋湰閲忓瓙鐮佷笉鑳戒负绌猴紒");
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("鏍锋湰閲忓瓙鐮佷笉鑳戒负绌猴紒");
                     return;
                 }
                 if (qmaql3.Count <= 0)
                 {
-                    Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥牱鏂规涓嶈兘涓虹┖锛�");
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("鎶芥牱鏂规涓嶈兘涓虹┖锛�");
+                    return;
+                }
+                if (qmaql4.Count <= 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("AQL鎶芥牱鍩哄噯涓嶈兘涓虹┖锛�");
                     return;
                 }
                 var _obj = new MesQmAql1
@@ -345,28 +381,33 @@
                     FoneChecked = false,
                     Fversion = Convert.ToInt32(txt_fversion.Text.Trim()),
                     MesQmAql2s = qmaql2,
-                    MesQmAql3s = qmaql3
+                    MesQmAql3s = qmaql3,
+                    MesQmAql4s = qmaql4
                 };
                 try
                 {
                     string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
                     ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+
                     if (_rtn.rtnCode > 0)
                     {
+                        ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
                         lbGuid.Text = _rtn.rtnData;
                         toolBarMenu1.isSetBtn = true;
                         List<GridView> gridViews = new List<GridView>();
                         gridViews.Add(gvMx1);
                         gridViews.Add(gvMx2);
+                        gridViews.Add(gvMx3);
                         UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gridViews);
                         toolBarMenu1.currentAction = "";
                         Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                     }
+                    else
+                        ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
                 catch (Exception ex)
                 {
-                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
             }
             catch (Exception ex)
@@ -414,7 +455,7 @@
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -429,7 +470,7 @@
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             var _obj = new
@@ -447,10 +488,12 @@
                     List<GridView> gvList = new List<GridView>();
                     gvList.Add(gvMx1);
                     gvList.Add(gvMx2);
+                    gvList.Add(gvMx3);
                     UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     JArray mesQmAql3s = new JArray();
+                    JArray mesQmAql4s = new JArray();
                     foreach (var a in _job["rtnData"]["mesQmAql2s"])
                     {
                         array.Add(a);
@@ -467,6 +510,7 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                     }
+
                     foreach (var a in _job["rtnData"]["mesQmAql3s"])
                     {
                         mesQmAql3s.Add(a);
@@ -483,13 +527,32 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
                     }
+
+
+                        foreach (var a in _job["rtnData"]["mesQmAql4s"])
+                        {
+                            mesQmAql4s.Add(a);
+                        }
+                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(mesQmAql4s.ToString());
+                    if (dt2.Rows.Count > 0)
+                    {
+                        gcMx3.BindingContext = new BindingContext();
+                        gcMx3.DataSource = dt2;
+                        gcMx3.ForceInitialize();
+                        // gvMx3.BestFitColumns();
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
+                    }
+
                 }
                 else
-                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -527,13 +590,17 @@
                         JsonConvert.SerializeObject(lst));
                     var _rtn =
                         UtilityHelper.ReturnToDynamic(strJson);
-                    if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
-
-                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+                        getModel(lbGuid.Text);
+                    }
+                    else
+                        MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
                 catch (Exception ex)
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
             }
         }
@@ -570,13 +637,16 @@
                         JsonConvert.SerializeObject(lst));
                     var _rtn =
                         UtilityHelper.ReturnToDynamic(strJson);
-                    if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
-
-                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        getModel(lbGuid.Text); MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+                    }
+                    else
+                        MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
                 catch (Exception ex)
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
             }
         }
@@ -596,13 +666,14 @@
                 case 0:
                     strMsg = "鍙嶅鏍�";
                     break;
-            };
+            }
+            ;
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_sampleSizeNo, gridView1, "sampleSizeNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
@@ -619,9 +690,9 @@
                 var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck",
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                 if (_rtn.rtnCode > 0)
                 {
+                    MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
                     {
                         getModel(lbGuid.Text.Trim());
@@ -630,10 +701,12 @@
                     gridView1.FocusedRowHandle = rowHandle;
                     UtilityHelper.SetCheckIco(gridView1, "foneChecked", "foneCheckor", "foneCheckdate", picCheckBox, this, _inFieldValue.ToString());
                 }
+                else
+                    MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
     }

--
Gitblit v1.9.3