From 3cf7cd4d37f38a60a65f2a066f6403db9d24e6e0 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 24 十二月 2024 08:50:41 +0800
Subject: [PATCH] 细节

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |  116 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 95 insertions(+), 21 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index be8520e..2657a09 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -59,7 +59,7 @@
                 }
             }
         }
-       
+
         public static string HttpPost(string url, string meth, string param)
         {
             string _caption = "鎷煎懡鍔犺浇涓紝璇风◢鍚�...";
@@ -269,21 +269,30 @@
         {
             isEdt = !isEdt;
             if (gridViews != null)
+            {
                 foreach (var gv in gridViews)
                 {
                     foreach (GridColumn colmn in gv.Columns)
                     {
+                        colmn.OptionsColumn.AllowEdit = true;
                         if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui"))
                         {
-                            //  colmn.Visible = !isEdt;
-                            //  break;
-                            colmn.OptionsColumn.AllowEdit = true;
+                            colmn.Visible = !isEdt;
                         }
                         else
-                            colmn.OptionsColumn.AllowEdit = !isEdt;
+                        {
+                            if (isEdt == false) {
+                                if (colmn.Tag != null && colmn.Tag.ToString().EndsWith("edit"))
+                                    colmn.OptionsColumn.ReadOnly = isEdt;
+                                else
+                                    colmn.OptionsColumn.ReadOnly = !isEdt;
+                            }
+                            else
+                                colmn.OptionsColumn.ReadOnly = isEdt;
+                        }
                     }
-                    //gv.OptionsBehavior.Editable = !isEdt;
                 }
+            }
             var _btnAry = controls.Find("btnSelect", false);
             if (_btnAry.Length > 0)
             {
@@ -603,6 +612,17 @@
                                 txt.Enabled = false;
                             continue;
                         }
+                        //鑷畾daa
+                        if (colType is UcLookDaa)
+                        {
+                            var txt = colType as UcLookDaa;
+                            txt.SetIdOrCode(strVal);
+                            if (txt.IsReadly == false)
+                                txt.Enabled = !isEdt;
+                            else
+                                txt.Enabled = false;
+                            continue;
+                        }
                         if (colType is SimpleButton)
                         {
                             var txt = colType as SimpleButton;
@@ -629,21 +649,31 @@
         {
             isEdt = !isEdt;
             if (gridViews != null)
+            {
                 foreach (var gv in gridViews)
                 {
                     foreach (GridColumn colmn in gv.Columns)
                     {
+                        colmn.OptionsColumn.AllowEdit = true;
                         if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui"))
                         {
-                            //  colmn.Visible = !isEdt;
-                            //  break;
-                            colmn.OptionsColumn.AllowEdit = true;
+                            colmn.Visible = !isEdt;
                         }
                         else
-                            colmn.OptionsColumn.AllowEdit = !isEdt;
+                        {
+                            if (isEdt == false)
+                            {
+                                if (colmn.Tag != null && colmn.Tag.ToString().EndsWith("edit"))
+                                    colmn.OptionsColumn.ReadOnly = isEdt;
+                                else
+                                    colmn.OptionsColumn.ReadOnly = !isEdt;
+                            }
+                            else
+                                colmn.OptionsColumn.ReadOnly = isEdt;
+                        }
                     }
-                    //gv.OptionsBehavior.Editable = !isEdt;
                 }
+            }
             foreach (Control ctrl in controls)
             {
                 //澶氳鏂囨湰
@@ -823,6 +853,14 @@
                     txt.Enabled = !isEdt;
                     continue;
                 }
+                //鑷畾daa
+                if (ctrl is UcLookDaa)
+                {
+                    var txt = ctrl as UcLookDaa;
+                    txt.SetIdOrCode("-1");
+                    txt.Enabled = !isEdt;
+                    continue;
+                }
                 if (ctrl is SimpleButton)
                 {
                     var txt = ctrl as SimpleButton;
@@ -844,21 +882,26 @@
         {
             isEdt = !isEdt;
             if (gridViews != null)
+            {
                 foreach (var gv in gridViews)
                 {
                     foreach (GridColumn colmn in gv.Columns)
                     {
+                        colmn.OptionsColumn.AllowEdit = true;
                         if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui"))
                         {
-                            //  colmn.Visible = !isEdt;
-                            //  break;
-                            colmn.OptionsColumn.AllowEdit = true;
+                            colmn.Visible = !isEdt;
                         }
                         else
-                            colmn.OptionsColumn.AllowEdit = !isEdt;
+                        {
+                            if (colmn.Tag!=null && colmn.Tag.ToString().EndsWith("edit"))
+                                colmn.OptionsColumn.ReadOnly = isEdt;
+                            else
+                                colmn.OptionsColumn.ReadOnly = !isEdt;
+                        }
                     }
-                    //gv.OptionsBehavior.Editable = !isEdt;
                 }
+            }
             foreach (Control ctrl in controls)
             {
                 //鏂囨湰
@@ -1040,6 +1083,23 @@
                         txt.Enabled = false;
                     continue;
                 }
+                //鑷畾daa
+                if (ctrl is UcLookDaa)
+                {
+                    var txt = ctrl as UcLookDaa;
+                    if (txt.IsReadly == false)
+                        txt.Enabled = !isEdt;
+                    else
+                        txt.Enabled = false;
+                    continue;
+                }
+
+                if (ctrl is SimpleButton)
+                {
+                    var txt = ctrl as SimpleButton;
+                    txt.Enabled = !isEdt;
+                    continue;
+                }
             }
         }
 
@@ -1070,9 +1130,11 @@
         /// </summary>
         /// <param name="tabControl"></param>
         /// <param name="idx">0鏌ョ湅锛�1閫�鍑猴紝2鍒犻櫎锛�3淇敼锛�4鏂板鍔�</param>
-        public static void JumpTab(XtraTabControl tabControl, int action) {
+        public static void JumpTab(XtraTabControl tabControl, int action)
+        {
 
-            if (action == 0) {
+            if (action == 0)
+            {
                 tabControl.TabPages[0].PageEnabled = true;
                 tabControl.TabPages[1].PageEnabled = true;
                 tabControl.SelectedTabPageIndex = 1;
@@ -1102,6 +1164,13 @@
             if (action == 4)
             {
                 tabControl.TabPages[0].PageEnabled = false;
+                tabControl.TabPages[1].PageEnabled = true;
+                tabControl.SelectedTabPageIndex = 1;
+                return;
+            }
+            if (action == 5)
+            {
+                tabControl.TabPages[0].PageEnabled = true;
                 tabControl.TabPages[1].PageEnabled = true;
                 tabControl.SelectedTabPageIndex = 1;
                 return;
@@ -1216,6 +1285,13 @@
             if (str.ToUpper() == "true".ToUpper())
                 return 1;
             return 0;
+        }
+
+        public string GetIsNullOrEmpty(string str)
+        {
+            if (string.IsNullOrEmpty(str.Trim()))
+                return "{>";
+            return str.Trim();
         }
 
         /// <summary>
@@ -1357,7 +1433,6 @@
                     }
                 }
             }
-
             return "";
         }
 
@@ -1589,6 +1664,7 @@
         /// <param name="icoName"></param>
         public static void SetGridViewParameterMx(GridView gridView1)
         {
+            gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀
             gridView1.OptionsFilter.AllowFilterEditor = false;
             gridView1.OptionsFilter.ShowCustomFunctions = DevExpress.Utils.DefaultBoolean.False;
             gridView1.OptionsCustomization.AllowFilter = false;
@@ -1636,8 +1712,6 @@
             Regex regex = new Regex("^[0-9]+$");
             return regex.IsMatch(str);
         }
-
-
 
     }
 

--
Gitblit v1.9.3