From 0c6e45643cddd0fc8a28032f6fd7a307186c3605 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 15 三月 2025 15:47:01 +0800
Subject: [PATCH] 样本

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs          |   49 +++---------
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs     |   91 +++++++---------------
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.Designer.cs |   63 +++------------
 3 files changed, 57 insertions(+), 146 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.Designer.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.Designer.cs
index 129320c..068cde7 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.Designer.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.Designer.cs
@@ -37,16 +37,16 @@
             DevExpress.XtraLayout.RowDefinition rowDefinition2 = new DevExpress.XtraLayout.RowDefinition();
             DevExpress.XtraLayout.RowDefinition rowDefinition3 = new DevExpress.XtraLayout.RowDefinition();
             DevExpress.XtraLayout.RowDefinition rowDefinition4 = new DevExpress.XtraLayout.RowDefinition();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.XtraLayout.ColumnDefinition columnDefinition5 = new DevExpress.XtraLayout.ColumnDefinition();
             DevExpress.XtraLayout.ColumnDefinition columnDefinition6 = new DevExpress.XtraLayout.ColumnDefinition();
             DevExpress.XtraLayout.ColumnDefinition columnDefinition7 = new DevExpress.XtraLayout.ColumnDefinition();
             DevExpress.XtraLayout.ColumnDefinition columnDefinition8 = new DevExpress.XtraLayout.ColumnDefinition();
             DevExpress.XtraLayout.RowDefinition rowDefinition5 = new DevExpress.XtraLayout.RowDefinition();
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
@@ -57,11 +57,6 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject10 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject11 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject12 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions4 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject13 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject14 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject15 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject16 = new DevExpress.Utils.SerializableAppearanceObject();
             this.repositoryItemComboBox1 = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox();
             this.toolBarMenu1 = new Gs.DevApp.UserControl.UcToolBarMenu();
             this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
@@ -157,8 +152,6 @@
             this.gvMx1sampleSizeNo = new DevExpress.XtraGrid.Columns.GridColumn();
             this.gvMx1fcheckLevel = new DevExpress.XtraGrid.Columns.GridColumn();
             this.gvMx1facLevel = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.gridColumn21 = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.repositoryItemButtonEdit4 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
             this.splitYangLi = new DevExpress.XtraEditors.SplitContainerControl();
             this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
             this.gcMx2 = new DevExpress.XtraGrid.GridControl();
@@ -271,7 +264,6 @@
             this.splitMx2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit4)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.splitYangLi)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.splitYangLi.Panel1)).BeginInit();
             this.splitYangLi.Panel1.SuspendLayout();
@@ -1292,8 +1284,6 @@
             this.gcMx1.Location = new System.Drawing.Point(0, 0);
             this.gcMx1.MainView = this.gvMx1;
             this.gcMx1.Name = "gcMx1";
-            this.gcMx1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
-            this.repositoryItemButtonEdit4});
             this.gcMx1.Size = new System.Drawing.Size(1340, 201);
             this.gcMx1.TabIndex = 1;
             this.gcMx1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -1321,8 +1311,7 @@
             this.gvMx1fngQty,
             this.gvMx1sampleSizeNo,
             this.gvMx1fcheckLevel,
-            this.gvMx1facLevel,
-            this.gridColumn21});
+            this.gvMx1facLevel});
             this.gvMx1.GridControl = this.gcMx1;
             this.gvMx1.Name = "gvMx1";
             this.gvMx1.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False;
@@ -1552,26 +1541,6 @@
             this.gvMx1facLevel.VisibleIndex = 15;
             this.gvMx1facLevel.Width = 200;
             // 
-            // gridColumn21
-            // 
-            this.gridColumn21.Caption = "娓呯┖";
-            this.gridColumn21.ColumnEdit = this.repositoryItemButtonEdit4;
-            this.gridColumn21.MinWidth = 25;
-            this.gridColumn21.Name = "gridColumn21";
-            this.gridColumn21.Visible = true;
-            this.gridColumn21.VisibleIndex = 16;
-            this.gridColumn21.Width = 94;
-            // 
-            // repositoryItemButtonEdit4
-            // 
-            this.repositoryItemButtonEdit4.AutoHeight = false;
-            editorButtonImageOptions1.Image = global::Gs.DevApp.Properties.Resources.refresh_16x16;
-            editorButtonImageOptions1.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
-            this.repositoryItemButtonEdit4.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "娓呯┖", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
-            this.repositoryItemButtonEdit4.Name = "repositoryItemButtonEdit4";
-            this.repositoryItemButtonEdit4.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
-            // 
             // splitYangLi
             // 
             this.splitYangLi.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -1656,7 +1625,6 @@
             // gridColumn20
             // 
             this.gridColumn20.Caption = "鍒ゅ畾鏍囧織";
-            this.gridColumn20.ColumnEdit = this.repositoryItemComboBox1;
             this.gridColumn20.FieldName = "fstand";
             this.gridColumn20.MinWidth = 25;
             this.gridColumn20.Name = "gridColumn20";
@@ -1977,9 +1945,9 @@
             // repositoryItemButtonEdit2
             // 
             this.repositoryItemButtonEdit2.AutoHeight = false;
-            editorButtonImageOptions2.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
+            editorButtonImageOptions1.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
             this.repositoryItemButtonEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "娴忚", -1, true, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "娴忚", -1, true, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.repositoryItemButtonEdit2.Name = "repositoryItemButtonEdit2";
             this.repositoryItemButtonEdit2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
             // 
@@ -1996,10 +1964,10 @@
             // repositoryItemButtonEdit3
             // 
             this.repositoryItemButtonEdit3.AutoHeight = false;
-            editorButtonImageOptions3.Image = global::Gs.DevApp.Properties.Resources.download_16x16;
-            editorButtonImageOptions3.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
+            editorButtonImageOptions2.Image = global::Gs.DevApp.Properties.Resources.download_16x16;
+            editorButtonImageOptions2.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
             this.repositoryItemButtonEdit3.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "涓嬭浇", -1, true, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "涓嬭浇", -1, true, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.repositoryItemButtonEdit3.Name = "repositoryItemButtonEdit3";
             this.repositoryItemButtonEdit3.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
             // 
@@ -2016,10 +1984,10 @@
             // repositoryItemButtonEdit1
             // 
             this.repositoryItemButtonEdit1.AutoHeight = false;
-            editorButtonImageOptions4.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16;
-            editorButtonImageOptions4.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
+            editorButtonImageOptions3.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16;
+            editorButtonImageOptions3.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
             this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "鍒犻櫎", -1, true, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "鍒犻櫎", -1, true, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
             this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
             // 
@@ -2142,7 +2110,6 @@
             this.splitMx2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.gcMx1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.gvMx1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit4)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.splitYangLi.Panel1)).EndInit();
             this.splitYangLi.Panel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.splitYangLi.Panel2)).EndInit();
@@ -2307,8 +2274,6 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem20;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem19;
-        private DevExpress.XtraGrid.Columns.GridColumn gridColumn21;
-        private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit4;
         private DevExpress.XtraGrid.Columns.GridColumn gridColumn20;
         private DevExpress.XtraEditors.Repository.RepositoryItemComboBox repositoryItemComboBox1;
         private DevExpress.XtraEditors.SplitContainerControl splitYangLi;
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 3536719..dc7396d 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -140,46 +140,21 @@
                 string _strCmd = txtJianYan.Text.Trim().ToUpper();
                 string _strOK = "OK";
                 string _strNG = "NG";
-                int n = 0;
-                if ((_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG)))
+                if (!(_strCmd.StartsWith(_strOK) || _strCmd.StartsWith(_strNG)))
                 {
-                    if (!_strCmd.Contains("-"))
-                    {
-                        Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!");
-                        return;
-                    }
-                    string[] _ary = _strCmd.Split('-');
-                    if (_ary.Length != 2)
-                    {
-                        Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氾細璇锋纭娇鐢∣K 鎴�  NG 鍛戒护!");
-                        return;
-                    }
-                    string _str1 = _ary[0];
-                    if (!(_str1 == _strOK || _str1 == _strNG))
-                    {
-                        Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴�  NG 鍛戒护!");
-                        return;
-                    }
-                    string _str2 = _ary[1];
-                    if (int.TryParse(_str2, out n))
-                    {
-                    }
-                    else
-                    {
-                        Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴�  NG 鍛戒护!");
-                        return;
-                    }
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!");
+                    return;
                 }
-                else
+                if (!_strCmd.Contains("-"))
                 {
-                    if (int.TryParse(_strCmd, out n))
-                    {
-                    }
-                    else
-                    {
-                        Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴�  NG 鍛戒护!");
-                        return;
-                    }
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴� NG 鍛戒护!");
+                    return;
+                }
+                string[] _ary = _strCmd.Split('-');
+                if (_ary.Length != 2)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("鍛戒护杈撳叆閿欒锛氳姝g‘浣跨敤OK 鎴�  NG 鍛戒护!");
+                    return;
                 }
                 var _obj = new
                 {
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs
index 66ded33..f538ed8 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Input.cs
@@ -1,23 +1,9 @@
-锘縰sing DevExpress.Utils;
-using DevExpress.Utils.DirectXPaint;
-using DevExpress.XtraGrid.Columns;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraPrinting.Native;
-using DevExpress.XtraRichEdit.Layout;
-using Gs.DevApp.DevFrm.QC;
-using Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
-using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
 using System;
-using System.Collections.Generic;
-using System.Configuration;
 using System.Data;
 using System.Drawing;
-using System.Net;
-using System.Threading.Tasks;
-using System.Web.UI.WebControls;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm.QC
@@ -37,41 +23,40 @@
             gvMx1.CustomDrawCell += GvMx1_CustomDrawCell;
         }
 
+        /// <summary>
+        /// 鍒ゆ柇鍗曞厓鏍肩殑缂栬緫鎬�
+        /// </summary>
+        /// <param name="Column"></param>
+        /// <param name="_maxYbs"></param>
+        /// <returns></returns>
+        private bool ckCol(string ColumnName, string _maxYbs)
+        {
+            string _FieldName = ColumnName;
+            if (!_FieldName.Contains("鏍锋湰"))
+                return false;
+            if (_FieldName == "鏍锋湰鏁�")
+                return true;
+            if (string.IsNullOrEmpty(_maxYbs))
+                return false;
+            string _seqYb = _FieldName.Replace("鏍锋湰", "");
+            if (int.Parse(_seqYb) > int.Parse(_maxYbs))
+                return false;
+            return true;
+        }
+
         private void GvMx1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
         {
-            // 鍒ゆ柇鍗曞厓鏍兼槸鍚︾鍚堟潯浠� && e.CellValue.ToString() == "YourCondition"
-            bool _bl = false;
-            string _FieldName = e.Column.FieldName;
-            //if (e.Column.FieldName == "鏍锋湰鏁�")
-            //{
-            //    _bl = true;
-            //}
-            //e.Appearance.BackColor = Color.LightBlue; // 璁剧疆鑳屾櫙鑹�
-            if (_FieldName.Contains("鏍�"))
+            string _maxYbs = (gvMx1.GetRowCellValue(e.RowHandle, "鏍锋湰鏁�").ToString());
+            bool _bl = ckCol(e.Column.FieldName, _maxYbs);
+            if (_bl)
             {
-                if (_FieldName == "鏍锋湰鏁�")
-                    _bl = true;
-                else
-                {
-                    string _maxYbs = (gvMx1.GetRowCellValue(e.RowHandle, "鏍锋湰鏁�").ToString());
-                    string _seqYb = _FieldName.Replace("鏍锋湰", "");
-                    if (int.Parse(_seqYb) > int.Parse(_maxYbs))
-                        _bl = false;
-                    else
-                        _bl = true;
-                }
-            }
-            else
-            {
-                _bl = false;
-            }
-            if (_bl) { 
-              e.Appearance.BackColor = Color.Azure;
+                e.Appearance.BackColor = Color.Azure;
                 e.Column.MinWidth = 50;
-             //e.Appearance.BackColor2 = Color.LightSkyBlue;
             }
             else
+            {
                 e.Appearance.BackColor = Color.LightGray;
+            }
         }
 
         private void GvMx1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
@@ -124,24 +109,10 @@
         private void GvMx1_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
         {
             DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
-            string _FieldName = view.FocusedColumn.FieldName;
-            if (view.FocusedColumn.FieldName.Contains("鏍�"))
-            {
-                if (_FieldName == "鏍锋湰鏁�")
-                    e.Cancel = false;
-                else
-                {
-                    string _maxYbs = (gvMx1.GetRowCellValue(view.FocusedRowHandle, "鏍锋湰鏁�").ToString());
-                    string _seqYb = _FieldName.Replace("鏍锋湰", "");
-                    if (int.Parse(_seqYb) > int.Parse(_maxYbs))
-                        e.Cancel = true;
-                }
-            }
-            else
-            {
+            string _maxYbs = (gvMx1.GetRowCellValue(view.FocusedRowHandle, "鏍锋湰鏁�").ToString());
+            bool _bl = ckCol(view.FocusedColumn.FieldName, _maxYbs);
+            if (!_bl)
                 e.Cancel = true;
-            }
-
         }
 
         private void getModel()

--
Gitblit v1.9.3