From aa61ade84d2657a9fb37993378c6fba4680b5ddf Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 27 十二月 2024 09:39:11 +0800 Subject: [PATCH] 调拨 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 125 +++++++++++++++++++++++++++++++---------- 1 files changed, 94 insertions(+), 31 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 2953a88..e2a9375 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -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) { @@ -335,25 +344,22 @@ var txt = colType as ComboBoxEdit; if (txt.Properties.TextEditStyle == TextEditStyles.DisableTextEditor) - txt.SelectedIndex = int.Parse(strVal); - else - txt.Text = strVal; - txt.ReadOnly = isEdt; - continue; - } + try + { + txt.SelectedIndex = int.Parse(strVal); + } + catch (Exception) + { - //涓嬫媺 - if (colType is ComboBoxEdit) - { - var txt = colType as ComboBoxEdit; - if (txt.Properties.TextEditStyle == - TextEditStyles.DisableTextEditor) - txt.SelectedIndex = int.Parse(strVal); + txt.Text = strVal; + } + else txt.Text = strVal; txt.ReadOnly = isEdt; continue; } + //鑷畾涔変笅鎷� if (colType is UcComBox) @@ -614,6 +620,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; @@ -640,21 +657,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) { //澶氳鏂囨湰 @@ -720,7 +747,6 @@ if (ctrl is CheckBox) { var txt = ctrl as CheckBox; - //txt.Checked = false; txt.Enabled = !isEdt; } if (ctrl is CheckEdit) @@ -842,6 +868,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; @@ -863,21 +897,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) { //鏂囨湰 @@ -1069,6 +1108,22 @@ 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; + txt.Enabled = !isEdt; + continue; + } } } @@ -1255,7 +1310,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())) @@ -1536,7 +1596,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