From 0e83e666b4ea7a521f46835c6395395ea64a81ad Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期三, 04 十二月 2024 13:46:59 +0800 Subject: [PATCH] 右箭关闭 --- DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 103 insertions(+), 3 deletions(-) diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs index f596b2b..25fbc03 100644 --- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs +++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs @@ -542,6 +542,30 @@ txt.Enabled = false; continue; } + + //鑷畾瀹㈡埛 + if (colType is UcLookCustomer) + { + var txt = colType as UcLookCustomer; + txt.SetIdOrCode(strVal); + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } + //鑷畾鍛樺伐 + if (colType is UcLookStaff) + { + var txt = colType as UcLookStaff; + txt.SetIdOrCode(strVal); + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } + if (colType is SimpleButton) { var txt = colType as SimpleButton; @@ -698,6 +722,22 @@ txt.Enabled = !isEdt; continue; } + //鑷畾瀹㈡埛 + if (ctrl is UcLookCustomer) + { + var txt = ctrl as UcLookCustomer; + txt.SetIdOrCode("-1"); + txt.Enabled = !isEdt; + continue; + } + //鑷畾瀹㈡埛 + if (ctrl is UcLookStaff) + { + var txt = ctrl as UcLookStaff; + txt.SetIdOrCode("-1"); + txt.Enabled = !isEdt; + continue; + } if (ctrl is SimpleButton) { var txt = ctrl as SimpleButton; @@ -836,6 +876,26 @@ if (ctrl is UcLookUnit) { var txt = ctrl as UcLookUnit; + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } + //鑷畾涔夊鎴� + if (ctrl is UcLookCustomer) + { + var txt = ctrl as UcLookCustomer; + if (txt.IsReadly == false) + txt.Enabled = !isEdt; + else + txt.Enabled = false; + continue; + } + //鑷畾涔夊憳宸� + if (ctrl is UcLookStaff) + { + var txt = ctrl as UcLookStaff; if (txt.IsReadly == false) txt.Enabled = !isEdt; else @@ -1189,7 +1249,7 @@ if (string.IsNullOrEmpty(filter.FilterString)) continue; // fiList.Add(new FilterEntity("b.FNumber", "浣跨敤缁勭粐", " like ", "鍖呭惈", "%" + filter.Value + "%")); - string[] ddd = filter.FilterString.Replace("Contains","").Replace("(","").Replace(")","").Replace("'", "").Replace("'", "").Split(','); + string[] ddd = filter.FilterString.Replace("Contains", "").Replace("(", "").Replace(")", "").Replace("'", "").Replace("'", "").Split(','); //Contains([fSubsidiary], '005') fiList.Add(getFilterEntityWord(col.Tag.ToString(), col.Caption.Trim(), ddd[1].Trim())); } @@ -1212,7 +1272,7 @@ _sbSqlWhere.Append(" and org.FNumber " + itm.fileOper + "'" + itm.fileValue + "'"); else { - _sbSqlWhere.Append(" and org.NAME " + itm.fileOper + "'" + itm.fileValue.Trim() + "'"); + _sbSqlWhere.Append(" and org.NAME " + itm.fileOper + "'" + itm.fileValue.Trim() + "'"); } } else @@ -1232,12 +1292,31 @@ column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains; column.OptionsFilter.ImmediateUpdateAutoFilter = false; column.OptionsColumn.AllowEdit = false; - if (column.Tag==null || column.Tag.ToString().Length <= 0) + if (column.Tag == null || column.Tag.ToString().Length <= 0) column.OptionsFilter.AllowAutoFilter = false; } gridView1.OptionsFilter.AllowAutoFilterConditionChange = DevExpress.Utils.DefaultBoolean.False; gridView1.OptionsFilter.AllowFilterEditor = false; gridView1.OptionsFilter.ShowCustomFunctions = DevExpress.Utils.DefaultBoolean.False; + gridView1.OptionsCustomization.AllowFilter = false; + gridView1.OptionsFind.ShowSearchNavButtons = false; + gridView1.OptionsView.ShowAutoFilterRow = true; + gridView1.OptionsView.ShowGroupPanel = false; + gridView1.IndicatorWidth = 50; + gridView1.CustomDrawRowIndicator += (s, e) => + { + if (e.Info.IsRowIndicator && e.RowHandle >= 0) + e.Info.DisplayText = (e.RowHandle + 1).ToString(); + }; + gridView1.CustomDrawEmptyForeground += (s, e) => + { + var str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!"; + var f = new Font("寰蒋闆呴粦", 16); + var r = new Rectangle(gridView1.GridControl.Width / 2 - 100, + e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); + e.Graphics.DrawString(str, f, Brushes.Gray, r); + }; + } #endregion @@ -1247,6 +1326,27 @@ Regex regex = new Regex("^[0-9]+$"); return regex.IsMatch(str); } + + + public static void SetValidatingEditor(object sender, BaseContainerValidateEditorEventArgs e) + { + //yz_quantity_0 + GridView view = sender as GridView; + if (view.FocusedColumn.Tag != null && view.FocusedColumn.Tag.ToString().StartsWith("yz_")) + { + string[] _ary = view.FocusedColumn.Tag.ToString().Split('_'); + if (_ary.Length > 2) + { + if (_ary[2] == "0") + { + double price = 0; if (!Double.TryParse(e.Value as String, out price)) + { e.Valid = false; e.ErrorText = "璇疯緭鍏ユ纭殑鏁板瓧."; } + return; + } + } + } + } + } /// <summary> -- Gitblit v1.9.3