From c2d73fe7167e6006acd69ad09491e75463eb611a Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 12 十一月 2024 13:53:20 +0800
Subject: [PATCH] 各种细节

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |   39 ++++++++++++++++++++++++++++-----------
 1 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 0694dd6..428834f 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -283,8 +283,10 @@
         {
             isEdt = !isEdt;
             if (gridViews != null)
-                foreach (var gv in gridViews) {
-                    foreach (GridColumn colmn in gv.Columns) {
+                foreach (var gv in gridViews)
+                {
+                    foreach (GridColumn colmn in gv.Columns)
+                    {
                         if (colmn.Name.ToString().Contains("gvMxDel"))
                         {
                             colmn.Visible = !isEdt;
@@ -293,8 +295,9 @@
                     }
                     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;
             }
@@ -389,7 +392,7 @@
                             txt.ReadOnly = isEdt;
                             continue;
                         }
-                        
+
                         //鏁板瓧鍗�
                         if (colType is NumericUpDown)
                         {
@@ -457,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
@@ -471,7 +474,7 @@
                         if (colType is UcLookCk)
                         {
                             var txt = colType as UcLookCk;
-                            txt.SetIdOrCode( strVal);
+                            txt.SetIdOrCode(strVal);
                             txt.Enabled = !isEdt;
                             continue;
                         }
@@ -695,7 +698,8 @@
                 }
 
                 //鍗曢��
-                if (ctrl is CheckBox) {
+                if (ctrl is CheckBox)
+                {
                     ctrl.Enabled = !isEdt;
                     continue;
                 }
@@ -808,10 +812,23 @@
             return Guid.Parse(str);
         }
 
-        public static int ToInt(string 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)
             {
@@ -852,7 +869,7 @@
                 else
                 {
                     _strGuid = dr["guid"].ToString();
-                      _strName = dr[1].ToString();
+                    _strName = dr[1].ToString();
                 }
             }
 

--
Gitblit v1.9.3