From 5efd0e777e3954c6817a2fb5ecc5e0c40e00a6a7 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 12 十一月 2024 16:32:28 +0800
Subject: [PATCH] 各种细节

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |  103 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 91 insertions(+), 12 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 712ce51..428834f 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -284,14 +284,29 @@
             isEdt = !isEdt;
             if (gridViews != null)
                 foreach (var gv in gridViews)
+                {
+                    foreach (GridColumn colmn in gv.Columns)
+                    {
+                        if (colmn.Name.ToString().Contains("gvMxDel"))
+                        {
+                            colmn.Visible = !isEdt;
+                            break;
+                        }
+                    }
                     gv.OptionsBehavior.Editable = !isEdt;
-
-           var _btnAry=  controls.Find("btnSelect", false);
-            if (_btnAry.Length > 0) {
+                }
+            var _btnAry = controls.Find("btnSelect", false);
+            if (_btnAry.Length > 0)
+            {
                 var _btnType = _btnAry[0];
                 _btnType.Enabled = !isEdt;
             }
-
+            var _btnAry2 = controls.Find("btnTui", false);
+            if (_btnAry2.Length > 0)
+            {
+                var _btnType = _btnAry2[0];
+                _btnType.Enabled = !isEdt;
+            }
             foreach (JProperty property in dynamicObject.Properties())
             {
                 var strName = property.Name;
@@ -369,6 +384,14 @@
                             txt.ReadOnly = isEdt;
                             continue;
                         }
+                        if (colType is MemoEdit)
+                        {
+                            var txt = colType as MemoEdit;
+                            if (txt != null)
+                                txt.Text = strVal;
+                            txt.ReadOnly = isEdt;
+                            continue;
+                        }
 
                         //鏁板瓧鍗�
                         if (colType is NumericUpDown)
@@ -437,9 +460,9 @@
                             var txt = colType as Label;
                             if (_dddddd == "txt_checkStatus")
                             {
-                                if (strVal == "True" || strVal=="1")
+                                if (strVal == "True" || strVal == "1")
                                     txt.Text = "宸插鏍�";
-                                if (strVal == "False" || strVal=="0" || strVal=="")
+                                if (strVal == "False" || strVal == "0" || strVal == "")
                                     txt.Text = "鏈鏍�";
                             }
                             else
@@ -451,7 +474,7 @@
                         if (colType is UcLookCk)
                         {
                             var txt = colType as UcLookCk;
-                            txt.SetIdOrCode( strVal);
+                            txt.SetIdOrCode(strVal);
                             txt.Enabled = !isEdt;
                             continue;
                         }
@@ -498,7 +521,17 @@
             isEdt = !isEdt;
             if (gridViews != null)
                 foreach (var gv in gridViews)
+                {
+                    foreach (GridColumn colmn in gv.Columns)
+                    {
+                        if (colmn.Name.ToString().Contains("gvMxDel"))
+                        {
+                            colmn.Visible = !isEdt;
+                            break;
+                        }
+                    }
                     gv.OptionsBehavior.Editable = !isEdt;
+                }
             foreach (Control ctrl in controls)
             {
                 //澶氳鏂囨湰
@@ -540,7 +573,14 @@
                     txt.ReadOnly = isEdt;
                     continue;
                 }
-
+                if (ctrl is MemoEdit)
+                {
+                    var txt = ctrl as MemoEdit;
+                    if (txt != null)
+                        txt.Text = "";
+                    txt.ReadOnly = isEdt;
+                    continue;
+                }
                 //鏃堕棿
                 if (ctrl is DateTimePicker)
                 {
@@ -608,7 +648,17 @@
             isEdt = !isEdt;
             if (gridViews != null)
                 foreach (var gv in gridViews)
+                {
+                    foreach (GridColumn colmn in gv.Columns)
+                    {
+                        if (colmn.Name.ToString().Contains("gvMxDel"))
+                        {
+                            colmn.Visible = !isEdt;
+                            break;
+                        }
+                    }
                     gv.OptionsBehavior.Editable = !isEdt;
+                }
             foreach (Control ctrl in controls)
             {
                 //鏂囨湰
@@ -618,7 +668,12 @@
                     txt.ReadOnly = isEdt;
                     continue;
                 }
-
+                if (ctrl is MemoEdit)
+                {
+                    var txt = ctrl as MemoEdit;
+                    txt.ReadOnly = isEdt;
+                    continue;
+                }
                 //鏁板瓧鍗�
                 if (ctrl is NumericUpDown)
                 {
@@ -626,7 +681,6 @@
                     txt.ReadOnly = isEdt;
                     continue;
                 }
-
                 //涓嬫媺
                 if (ctrl is UcComBox)
                 {
@@ -644,7 +698,8 @@
                 }
 
                 //鍗曢��
-                if (ctrl is CheckBox) {
+                if (ctrl is CheckBox)
+                {
                     ctrl.Enabled = !isEdt;
                     continue;
                 }
@@ -757,6 +812,30 @@
             return Guid.Parse(str);
         }
 
+        public static int ToInt(string str)
+        {
+            try
+            {
+                return int.Parse(str);
+            }
+            catch (Exception)
+            {
+
+                return 0;
+            }
+        }
+        public static long ToLong(string str)
+        {
+            try
+            {
+                return long.Parse(str);
+            }
+            catch (Exception)
+            {
+
+                return 0;
+            }
+        }
         /// <summary>
         /// 璇诲彇grid鐨勫綋鍓嶈
         /// </summary>
@@ -790,7 +869,7 @@
                 else
                 {
                     _strGuid = dr["guid"].ToString();
-                      _strName = dr[1].ToString();
+                    _strName = dr[1].ToString();
                 }
             }
 

--
Gitblit v1.9.3