From de4b3fa6111e0e9e3e5d7edc78054d8efef6b139 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 05 十二月 2024 16:12:14 +0800 Subject: [PATCH] 检验 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 85 +++++++++++++++++++++++++++++++++++------- 1 files changed, 71 insertions(+), 14 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index 25fbc03..ff0354f 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -193,7 +193,14 @@ { var dt = new DataTable(); foreach (GridColumn col in gv.Columns) - dt.Columns.Add(col.FieldName, typeof(string)); + { + if (col.UnboundDataType == typeof(bool)) + dt.Columns.Add(col.FieldName, typeof(System.Boolean)); + else + { + dt.Columns.Add(col.FieldName, typeof(string)); + } + } gc.BindingContext = new BindingContext(); gc.DataSource = dt; gc.ForceInitialize(); @@ -293,13 +300,16 @@ { foreach (GridColumn colmn in gv.Columns) { - if (colmn.Name.ToString().Contains("gvMxDel")) + if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui")) { - colmn.Visible = !isEdt; - break; + // colmn.Visible = !isEdt; + // break; + colmn.OptionsColumn.AllowEdit =true; } + else + colmn.OptionsColumn.AllowEdit = !isEdt; } - gv.OptionsBehavior.Editable = !isEdt; + //gv.OptionsBehavior.Editable = !isEdt; } var _btnAry = controls.Find("btnSelect", false); if (_btnAry.Length > 0) @@ -565,6 +575,17 @@ txt.Enabled = false; continue; } + //鑷畾缁勭粐 + if (colType is UcLookOrg) + { + var txt = colType as UcLookOrg; + txt.SetIdOrCode(strVal); + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } if (colType is SimpleButton) { @@ -596,13 +617,16 @@ { foreach (GridColumn colmn in gv.Columns) { - if (colmn.Name.ToString().Contains("gvMxDel")) + if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui")) { - colmn.Visible = !isEdt; - break; + // colmn.Visible = !isEdt; + // break; + colmn.OptionsColumn.AllowEdit = true; } + else + colmn.OptionsColumn.AllowEdit = !isEdt; } - gv.OptionsBehavior.Editable = !isEdt; + //gv.OptionsBehavior.Editable = !isEdt; } foreach (Control ctrl in controls) { @@ -738,6 +762,14 @@ txt.Enabled = !isEdt; continue; } + //鑷畾缁勭粐 + if (ctrl is UcLookOrg) + { + var txt = ctrl as UcLookOrg; + txt.SetIdOrCode("-1"); + txt.Enabled = !isEdt; + continue; + } if (ctrl is SimpleButton) { var txt = ctrl as SimpleButton; @@ -763,13 +795,16 @@ { foreach (GridColumn colmn in gv.Columns) { - if (colmn.Name.ToString().Contains("gvMxDel")) + if (colmn.Name.ToString().Contains("gvMxDel") || colmn.Name.ToString().Contains("gvMxTui")) { - colmn.Visible = !isEdt; - break; + // colmn.Visible = !isEdt; + // break; + colmn.OptionsColumn.AllowEdit = true; } + else + colmn.OptionsColumn.AllowEdit = !isEdt; } - gv.OptionsBehavior.Editable = !isEdt; + //gv.OptionsBehavior.Editable = !isEdt; } foreach (Control ctrl in controls) { @@ -902,6 +937,16 @@ txt.Enabled = false; continue; } + //鑷畾缁勭粐 + if (ctrl is UcLookOrg) + { + var txt = ctrl as UcLookOrg; + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } } } @@ -1028,6 +1073,14 @@ return 0; } } + + public static int ToBit(string str) + { + if (str.ToUpper() == "true".ToUpper()) + return 1; + return 0; + } + /// <summary> /// 璇诲彇grid鐨勫綋鍓嶈 /// </summary> @@ -1327,7 +1380,11 @@ return regex.IsMatch(str); } - + /// <summary> + /// yz_quantity_0锛寉z_瀛楁_绫诲瀷 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> public static void SetValidatingEditor(object sender, BaseContainerValidateEditorEventArgs e) { //yz_quantity_0 -- Gitblit v1.9.3