From b71d1372394ba9fffa04f3e55fcfcd32c545c85a Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 18 三月 2025 09:04:24 +0800 Subject: [PATCH] erp改主键 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 2ccb088..60e3a1c 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -10,7 +10,6 @@ using System.Net.Http; using System.Reflection; using System.Resources; -using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -410,7 +409,13 @@ if (colType is CheckEdit) { var txt = colType as CheckEdit; - if (txt != null) + if (_isRead(txt.Tag)) + { + txt.ReadOnly = true; + } + else + txt.ReadOnly = isEdt; + if (txt != null) { switch (strVal) { case "True": @@ -426,8 +431,8 @@ txt.Checked = false; break; } - - txt.ReadOnly = isEdt; + } + continue; } //鍗曢�� @@ -453,6 +458,7 @@ txt.Enabled = !isEdt; continue; } + //鏃堕棿 if (colType is DateTimePicker) { @@ -791,13 +797,12 @@ if (ctrl is CheckEdit) { var txt = ctrl as CheckEdit; - txt.ReadOnly = isEdt; - if (txt.Tag != null && txt.Tag.ToString().Length > 0 && txt.Tag.ToString().StartsWith("moren")) + if (_isRead(txt.Tag)) { - txt.Checked = bool.Parse(txt.Tag.ToString().Replace("moren.", "")); + txt.ReadOnly = true; } else - txt.Checked = false; + txt.ReadOnly = isEdt; continue; } //鑷畾涔変粨搴� @@ -1375,6 +1380,11 @@ return 0; } } + public static decimal? GetDecimal(string s) + { + if (string.IsNullOrEmpty(s)) return null; + return decimal.Parse(s); + } public static int ToInt(string str) { try @@ -1596,7 +1606,7 @@ GridView dgv = s as GridView; if (dgv != null) { - if (dgv.GetSelectedRows() != null) + if (dgv.GetSelectedRows() != null && dgv.GetSelectedRows().Count()>0) { var selectedRow = dgv.GetSelectedRows()[0]; // 鑾峰彇绗竴涓�変腑琛岀殑绱㈠紩 if (selectedRow >= 0) -- Gitblit v1.9.3