From 032fc90030ec8efc4ac726b3de92436d279b9190 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 13 十二月 2024 10:38:00 +0800
Subject: [PATCH] 1
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 175 +++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 148 insertions(+), 27 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 73cc569..dd32cf5 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -128,7 +128,7 @@
request.Timeout = 15000;
request.AllowAutoRedirect = false;
request.ServicePoint.Expect100Continue = false;
- wdf.SetCaption(_caption+"锛�10/100锛�" + meth);
+ wdf.SetCaption(_caption + "锛�10/100锛�" + meth);
HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
request.CachePolicy = noCachePolicy;
wdf.SetCaption(_caption + "锛�20/100锛�" + meth);
@@ -604,7 +604,39 @@
txt.Enabled = false;
continue;
}
-
+ //鑷畾鐢ㄦ埛
+ if (colType is UcLookUser)
+ {
+ var txt = colType as UcLookUser;
+ txt.SetIdOrCode(strVal);
+ if (txt.IsReadly == false)
+ txt.Enabled = !isEdt;
+ else
+ txt.Enabled = false;
+ continue;
+ }
+ //鑷畾鎵撳嵃鏈�
+ if (colType is UcLookPrint)
+ {
+ var txt = colType as UcLookPrint;
+ txt.SetIdOrCode(strVal);
+ if (txt.IsReadly == false)
+ txt.Enabled = !isEdt;
+ else
+ txt.Enabled = false;
+ continue;
+ }
+ //鑷畾缂洪櫡绫诲埆
+ if (colType is UcLookDefectType)
+ {
+ var txt = colType as UcLookDefectType;
+ txt.SetIdOrCode(strVal);
+ if (txt.IsReadly == false)
+ txt.Enabled = !isEdt;
+ else
+ txt.Enabled = false;
+ continue;
+ }
if (colType is SimpleButton)
{
var txt = colType as SimpleButton;
@@ -683,7 +715,12 @@
if (ctrl is TextEdit)
{
var txt = ctrl as TextEdit;
- txt.Text = "";
+ if (txt.Tag != null && txt.Tag.ToString().Length > 0 && txt.Tag.ToString().StartsWith("moren"))
+ {
+ txt.Text = txt.Tag.ToString().Replace("moren.", "");
+ }
+ else
+ txt.Text = "";
txt.ReadOnly = isEdt;
continue;
}
@@ -706,7 +743,7 @@
if (ctrl is CheckBox)
{
var txt = ctrl as CheckBox;
- txt.Checked = false;
+ //txt.Checked = false;
txt.Enabled = !isEdt;
}
if (ctrl is CheckEdit)
@@ -784,6 +821,30 @@
if (ctrl is UcLookOrg)
{
var txt = ctrl as UcLookOrg;
+ txt.SetIdOrCode("-1");
+ txt.Enabled = !isEdt;
+ continue;
+ }
+ //鑷畾鐢ㄦ埛
+ if (ctrl is UcLookUser)
+ {
+ var txt = ctrl as UcLookUser;
+ txt.SetIdOrCode("-1");
+ txt.Enabled = !isEdt;
+ continue;
+ }
+ //鑷畾鎵撳嵃鏈�
+ if (ctrl is UcLookPrint)
+ {
+ var txt = ctrl as UcLookPrint;
+ txt.SetIdOrCode("-1");
+ txt.Enabled = !isEdt;
+ continue;
+ }
+ //鑷畾缂洪櫡绫诲埆
+ if (ctrl is UcLookDefectType)
+ {
+ var txt = ctrl as UcLookDefectType;
txt.SetIdOrCode("-1");
txt.Enabled = !isEdt;
continue;
@@ -959,6 +1020,36 @@
if (ctrl is UcLookOrg)
{
var txt = ctrl as UcLookOrg;
+ if (txt.IsReadly == false)
+ txt.Enabled = !isEdt;
+ else
+ txt.Enabled = false;
+ continue;
+ }
+ //鑷畾鐢ㄦ埛
+ if (ctrl is UcLookUser)
+ {
+ var txt = ctrl as UcLookUser;
+ if (txt.IsReadly == false)
+ txt.Enabled = !isEdt;
+ else
+ txt.Enabled = false;
+ continue;
+ }
+ //鑷畾鎵撳嵃
+ if (ctrl is UcLookPrint)
+ {
+ var txt = ctrl as UcLookPrint;
+ if (txt.IsReadly == false)
+ txt.Enabled = !isEdt;
+ else
+ txt.Enabled = false;
+ continue;
+ }
+ //鑷畾缂洪櫡绫诲埆
+ if (ctrl is UcLookDefectType)
+ {
+ var txt = ctrl as UcLookDefectType;
if (txt.IsReadly == false)
txt.Enabled = !isEdt;
else
@@ -1362,6 +1453,7 @@
/// <param name="icoName">鍥炬爣璺緞</param>
public static void SetGridSear(GridView gridView1, PictureBox btnChkIco = null, Form fm = null, string fileName = "checkStatus", string icoName = "")
{
+ // gridView1.OptionsView.ColumnAutoWidth = false;鑷姩璋冩暣鍒楀
foreach (GridColumn column in gridView1.Columns)
{
column.OptionsFilter.AutoFilterCondition = AutoFilterCondition.Contains;
@@ -1399,6 +1491,57 @@
};
}
}
+
+ /// <summary>
+ /// 璁剧疆鏄庣粏grid鏍峰紡
+ /// </summary>
+ /// <param name="gridView1"></param>
+ /// <param name="btnChkIco"></param>
+ /// <param name="fm"></param>
+ /// <param name="fileName"></param>
+ /// <param name="icoName"></param>
+ public static void SetGridSearMx(GridView gridView1)
+ {
+ gridView1.OptionsFilter.AllowFilterEditor = false;
+ gridView1.OptionsFilter.ShowCustomFunctions = DevExpress.Utils.DefaultBoolean.False;
+ gridView1.OptionsCustomization.AllowFilter = false;
+ gridView1.OptionsFind.ShowSearchNavButtons = false;
+ gridView1.OptionsView.ShowAutoFilterRow = false;
+ gridView1.OptionsView.ShowGroupPanel = false;
+ gridView1.IndicatorWidth = 40;
+ 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);
+ };
+ gridView1.ValidatingEditor += (sender, 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;
+ }
+ }
+ }
+ };
+ }
+
#endregion
public static bool IsNumeric(string str)
@@ -1407,29 +1550,7 @@
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
- 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;
- }
- }
- }
- }
+
}
--
Gitblit v1.9.3