From 93c179fb93c47ccd6365b31d291f61739f35fd2c Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 20 三月 2025 10:49:28 +0800 Subject: [PATCH] 销售 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index faebd02..b4761e5 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -409,7 +409,14 @@ if (colType is CheckEdit) { var txt = colType as CheckEdit; + if (_isRead(txt.Tag)) + { + txt.ReadOnly = true; + } + else + txt.ReadOnly = isEdt; if (txt != null) + { switch (strVal) { case "True": @@ -425,8 +432,8 @@ txt.Checked = false; break; } + } - txt.ReadOnly = isEdt; continue; } //鍗曢�� @@ -452,6 +459,7 @@ txt.Enabled = !isEdt; continue; } + //鏃堕棿 if (colType is DateTimePicker) { @@ -797,7 +805,6 @@ else txt.ReadOnly = isEdt; continue; - } //鑷畾涔変粨搴� if (ctrl is UcLookCk) @@ -1374,6 +1381,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 @@ -1595,7 +1607,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) @@ -1757,7 +1769,7 @@ { column.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; column.OptionsColumn.AllowEdit = true; - column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains; + // column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains; column.OptionsFilter.AutoFilterCondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Contains; column.OptionsFilter.ImmediateUpdateAutoFilter = false; if (column.Tag == null || column.Tag.ToString().EndsWith("edit")) @@ -1766,6 +1778,7 @@ column.OptionsColumn.ReadOnly = true; if (column.Tag == null || column.Tag.ToString().Length <= 0) column.OptionsFilter.AllowAutoFilter = false; + } gridView1.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False; gridView1.OptionsView.ShowAutoFilterRow = true; @@ -1863,6 +1876,14 @@ edit.SelectAll(); } + public static void SetGridLayout(GridView gridView1) + { + foreach (GridColumn column in gridView1.Columns) + { + if (column.Width > 500) + column.Width = 500; + } + } public static void SetTabParameter(GridView gridView1, DevExpress.XtraTab.XtraTabControl xtraTabControl1, UcPageBar pageBar1, DelegateGetModel action = null, DelegateGetList page = null) { xtraTabControl1.SelectedPageChanged += (s, e) => @@ -2053,7 +2074,7 @@ column.Visible = bool.Parse(controlVisible); } } - + } } } -- Gitblit v1.9.3