From aa77240aba2a41a9a653f6400ed1ff54310f92d4 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 03 四月 2025 13:03:31 +0800
Subject: [PATCH] 字典

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs |   54 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs
index a3058e7..70f8b1c 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs
@@ -61,31 +61,32 @@
 
         private void GvMx1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
         {
-            // 鑾峰彇琛屽彞鏌�
-            int rowHandle = e.RowHandle;
-            // 鑾峰彇鍒�
-            //  GridColumn col = gvMx1.Columns[e.Column.Name];
-            // 鑾峰彇鏂板��
-            object newValue = e.Value;
-            // 鑾峰彇鏃у��
-            //   object oldValue = gvMx1.GetRowCellValue(rowHandle, col);
-            //   MessageBox.Show(newValue.ToString());
-            //  getModel();
-            // 鍦ㄨ繖閲屾墽琛屼綘鐨勯�昏緫锛屼緥濡傦細
-            //  MessageBox.Show($"琛� {rowHandle}锛屽垪 {col.FieldName} 鐨勫�煎凡浠� {oldValue} 鏀逛负 {newValue}");
-            string dt05Guid = gvMx1.GetRowCellValue(e.RowHandle, "guid").ToString();
-            string dtCol = e.Column.FieldName;
-            gvMx1.CloseEditor();
-            gvMx1.PostEditor();
-            gvMx1.UpdateCurrentRow();
-            var _obj = new
-            {
-                dt05Guid = dt05Guid,
-                fSeq = dtCol,
-                fVal = newValue,
-            };
             try
             {
+                // 鑾峰彇琛屽彞鏌�
+                int rowHandle = e.RowHandle;
+                // 鑾峰彇鍒�
+                //  GridColumn col = gvMx1.Columns[e.Column.Name];
+                // 鑾峰彇鏂板��
+                object newValue = e.Value;
+                if (newValue == null || string.IsNullOrEmpty(newValue.ToString())) { return; }
+                // 鑾峰彇鏃у��
+                //   object oldValue = gvMx1.GetRowCellValue(rowHandle, col);
+                //   MessageBox.Show(newValue.ToString());
+                //  getModel();
+                // 鍦ㄨ繖閲屾墽琛屼綘鐨勯�昏緫锛屼緥濡傦細
+                //  MessageBox.Show($"琛� {rowHandle}锛屽垪 {col.FieldName} 鐨勫�煎凡浠� {oldValue} 鏀逛负 {newValue}");
+                string dt05Guid = gvMx1.GetRowCellValue(e.RowHandle, "guid").ToString();
+                string dtCol = e.Column.FieldName;
+                gvMx1.CloseEditor();
+                gvMx1.PostEditor();
+                gvMx1.UpdateCurrentRow();
+                var _obj = new
+                {
+                    dt05Guid = dt05Guid,
+                    fSeq = dtCol,
+                    fVal = newValue,
+                };
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditYangLi", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
@@ -95,7 +96,8 @@
                     string _outSum = _rtn.rtnData.outSum;
                     if (string.IsNullOrEmpty(_outSum)) _outSum = "-1";
                     if (int.Parse(_outSum) < 0) {
-                        MessageBox.Show(_outMsg);
+                        Gs.DevApp.ToolBox.MsgHelper.ShowError(_outMsg);
+                        gvMx1.SetRowCellValue(rowHandle, dtCol,"");
                     }
                     if (_strYbNo == "鏍锋湰鏁�")
                         getModel();
@@ -142,13 +144,13 @@
                         gcMx1.DataSource = dt;
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
+                        gvMx1.Columns["guid"].Visible = false;
+                        gvMx1.Columns["parentGuid"].Visible = false;
                     }
                     else
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                     }
-                    gvMx1.Columns["guid"].Visible = false;
-                    gvMx1.Columns["parentGuid"].Visible = false;
                 }
                 else
                     ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);

--
Gitblit v1.9.3