From e6db49c7ec2e2be934c625c48d665fdca04ffaf5 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 02 一月 2025 16:49:36 +0800 Subject: [PATCH] 超领取 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 82 +++++++++++++++++++++++++++++++---------- 1 files changed, 62 insertions(+), 20 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 2657a09..b33f18b 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -275,13 +275,21 @@ foreach (GridColumn colmn in gv.Columns) { colmn.OptionsColumn.AllowEdit = true; + + if (colmn.Name.ToString().Contains("gvBtnAlawys") ) + { + colmn.Visible = true; + colmn.OptionsColumn.ReadOnly = false; + }; + if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui")) { colmn.Visible = !isEdt; } else { - if (isEdt == false) { + if (isEdt == false) + { if (colmn.Tag != null && colmn.Tag.ToString().EndsWith("edit")) colmn.OptionsColumn.ReadOnly = isEdt; else @@ -344,25 +352,22 @@ var txt = colType as ComboBoxEdit; if (txt.Properties.TextEditStyle == TextEditStyles.DisableTextEditor) - txt.SelectedIndex = int.Parse(strVal); + try + { + txt.SelectedIndex = int.Parse(strVal); + } + catch (Exception) + { + + txt.Text = strVal; + } + else txt.Text = strVal; txt.ReadOnly = isEdt; continue; } - //涓嬫媺 - if (colType is ComboBoxEdit) - { - var txt = colType as ComboBoxEdit; - if (txt.Properties.TextEditStyle == - TextEditStyles.DisableTextEditor) - txt.SelectedIndex = int.Parse(strVal); - else - txt.Text = strVal; - txt.ReadOnly = isEdt; - continue; - } //鑷畾涔変笅鎷� if (colType is UcComBox) @@ -623,6 +628,17 @@ txt.Enabled = false; continue; } + //鑷畾濮斿 + if (colType is UcLookWwgd) + { + var txt = colType as UcLookWwgd; + txt.SetIdOrCode(strVal); + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } if (colType is SimpleButton) { var txt = colType as SimpleButton; @@ -739,13 +755,14 @@ if (ctrl is CheckBox) { var txt = ctrl as CheckBox; - //txt.Checked = false; txt.Enabled = !isEdt; + txt.Checked = false; } if (ctrl is CheckEdit) { var txt = ctrl as CheckEdit; txt.ReadOnly = isEdt; + txt.Checked = false; continue; } @@ -861,6 +878,14 @@ txt.Enabled = !isEdt; continue; } + //鑷畾濮斿 + if (ctrl is UcLookWwgd) + { + var txt = ctrl as UcLookWwgd; + txt.SetIdOrCode("-1"); + txt.Enabled = !isEdt; + continue; + } if (ctrl is SimpleButton) { var txt = ctrl as SimpleButton; @@ -894,10 +919,10 @@ } else { - if (colmn.Tag!=null && colmn.Tag.ToString().EndsWith("edit")) + if (colmn.Tag != null && colmn.Tag.ToString().EndsWith("edit")) colmn.OptionsColumn.ReadOnly = isEdt; else - colmn.OptionsColumn.ReadOnly = !isEdt; + colmn.OptionsColumn.ReadOnly = isEdt; } } } @@ -1093,7 +1118,16 @@ txt.Enabled = false; continue; } - + //鑷畾濮斿 + if (ctrl is UcLookWwgd) + { + var txt = ctrl as UcLookWwgd; + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } if (ctrl is SimpleButton) { var txt = ctrl as SimpleButton; @@ -1286,7 +1320,12 @@ return 1; return 0; } - + public static bool ToBoole(string str) + { + if (str.ToUpper() == "true".ToUpper()) + return true; + return false; + } public string GetIsNullOrEmpty(string str) { if (string.IsNullOrEmpty(str.Trim())) @@ -1567,7 +1606,10 @@ column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains; column.OptionsFilter.ImmediateUpdateAutoFilter = false; column.OptionsColumn.AllowEdit = true; - column.OptionsColumn.ReadOnly = true; + if (column.Tag == null || column.Tag.ToString().EndsWith("edit")) + column.OptionsColumn.ReadOnly = false; + else + column.OptionsColumn.ReadOnly = true; if (column.Tag == null || column.Tag.ToString().Length <= 0) column.OptionsFilter.AllowAutoFilter = false; } -- Gitblit v1.9.3