From 91a3be4ec1a61bbeb2271efd51fb23e6bfcf5184 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 25 四月 2025 17:26:33 +0800
Subject: [PATCH] 首检
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 99 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 79 insertions(+), 20 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index e534477..d16bb81 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -489,7 +489,6 @@
txt.Text = strVal;
}
}
-
//鑷畾涔変粨搴�
if (colType is UcLookCk)
{
@@ -613,7 +612,10 @@
if (colType is SimpleButton)
{
var txt = colType as SimpleButton;
- txt.Enabled = !isEdt;
+ if (txt.Tag != null && txt.Tag.ToString() == "gvBtnAlawys")
+ txt.Enabled = true;
+ else
+ txt.Enabled = !isEdt;
continue;
}
//鑷畾宸ュ簭
@@ -628,6 +630,14 @@
if (colType is UcDictionary)
{
var txt = colType as UcDictionary;
+ txt.TextTxt = (strVal);
+ txt.IsReadly = isEdt;
+ continue;
+ }
+ //鑷畾鍗曟嵁绫诲瀷涓嬫媺
+ if (colType is UcDictionaryComBox)
+ {
+ var txt = colType as UcDictionaryComBox;
txt.TextTxt = (strVal);
txt.IsReadly = isEdt;
continue;
@@ -909,10 +919,21 @@
txt.IsReadly = isEdt;
continue;
}
+ //鑷畾涔夊崟鎹被鍨嬩笅鎷�
+ if (ctrl is UcDictionaryComBox)
+ {
+ var txt = ctrl as UcDictionaryComBox;
+ //txt.SetIdOrCode("-1");
+ txt.IsReadly = isEdt;
+ continue;
+ }
if (ctrl is SimpleButton)
{
var txt = ctrl as SimpleButton;
- txt.Enabled = !isEdt;
+ if (txt.Tag != null && txt.Tag.ToString() == "gvBtnAlawys")
+ txt.Enabled = true;
+ else
+ txt.Enabled = !isEdt;
continue;
}
}
@@ -1006,7 +1027,6 @@
ctrl.Enabled = !isEdt;
continue;
}
- //
if (ctrl is CheckEdit)
{
var txt = ctrl as CheckEdit;
@@ -1090,7 +1110,6 @@
txt.IsReadly = isEdt;
continue;
}
-
//鑷畾閮ㄩ棬
if (ctrl is UcLookDepartment)
{
@@ -1133,10 +1152,20 @@
txt.IsReadly = isEdt;
continue;
}
+ //鑷畾鍗曟嵁绫诲瀷涓嬫媺
+ if (ctrl is UcDictionaryComBox)
+ {
+ var txt = ctrl as UcDictionaryComBox;
+ txt.IsReadly = isEdt;
+ continue;
+ }
if (ctrl is SimpleButton)
{
var txt = ctrl as SimpleButton;
- txt.Enabled = !isEdt;
+ if (txt.Tag != null && txt.Tag.ToString() == "gvBtnAlawys")
+ txt.Enabled = true;
+ else
+ txt.Enabled = !isEdt;
continue;
}
}
@@ -1626,7 +1655,17 @@
public static FilterEntity getFilterEntityWord(string id, string idDec, string val, string type)
{
- return new FilterEntity(id, idDec + ")", " like ", "鍖呭惈)", "%" + val + "%", type);
+ switch (type)
+ {
+ case "Bit绫诲瀷":
+ string _val = (val.ToUpper() == "true".ToUpper() ? "1" : "0");
+ return new FilterEntity(id, idDec + ")", "=", "绛変簬)", "" + _val + "", type);
+ break;
+ default:
+ return new FilterEntity(id, idDec + ")", "like", "鍖呭惈)", "%" + val + "%", type);
+ break;
+ }
+
}
public static List<FilterEntity> GetDilter(GridColumnCollection Columns, GridView gridView1 = null)
{
@@ -1642,10 +1681,19 @@
ColumnFilterInfo filter = col.FilterInfo;
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(',');
- //Contains([fSubsidiary], '005')
- fiList.Add(getFilterEntityWord(col.Tag.ToString(), col.Caption.Trim(), ddd[1].Trim(), col.UnboundExpression));
+ string _filterString = filter.FilterString.Replace("Contains", "").Replace("(", "").Replace(")", "").Replace("'", "").Replace("'", "");
+ string[] ddd = _filterString.Split(',');
+ string _val = "";
+ if (ddd.Length > 1)
+ {
+ _val = ddd[1].Trim();
+ }
+ else
+ {
+ ddd = _filterString.Split('=');
+ _val = ddd[1].Trim();
+ }
+ fiList.Add(getFilterEntityWord(col.Tag.ToString(), col.Caption.Trim(), _val, col.UnboundExpression));
}
return fiList;
}
@@ -1676,19 +1724,17 @@
case "鏃堕棿绫诲瀷":
_sbSqlWhere.Append(" and CONVERT(nvarchar(30)," + itm.fileId + ",23)" + itm.fileOper + "'" + itm.fileValue + "'");
break;
- //case "鏁板�肩被鍨�":
- // _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'");
- // break;
+ case "Bit绫诲瀷":
+ _sbSqlWhere.Append(" and isnull(" + itm.fileId + ",0) =" + itm.fileValue + "");
+ break;
default:
- _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'");
+ _sbSqlWhere.Append(" and " + itm.fileId + " " + itm.fileOper + " '" + itm.fileValue + "'");
break;
}
}
}
return _sbSqlWhere.ToString();
}
-
-
public delegate void DelegateGetModel(string guid);
public delegate void DelegateGetList(int currentPage);
/// <summary>
@@ -1722,7 +1768,7 @@
}
};
gridView1.OptionsView.ColumnAutoWidth = false;//鑷姩璋冩暣鍒楀
-
+
if (isPostSearch == true)
{
gridView1.OptionsView.ShowGroupPanel = false;
@@ -2044,7 +2090,20 @@
bool isNumeric = decimal.TryParse(input, out number);
return isNumeric;
}
-
+ /// <summary>
+ /// 鍒ゆ柇鏄笉鏄竴涓湁鏁堢殑姝f暣鏁�
+ /// </summary>
+ /// <param name="str"></param>
+ /// <returns></returns>
+ public static bool IsNumeric3(string str)
+ {
+ string input = str;
+ decimal number;
+ bool isNumeric = decimal.TryParse(input, out number);
+ if (isNumeric && number > 0)
+ return true;
+ return false;
+ }
public static void PrintJiSuan(DevExpress.XtraEditors.TextEdit box1, DevExpress.XtraEditors.TextEdit box2, string sum, DevExpress.XtraEditors.RadioGroup rd)
{
if (rd.SelectedIndex == 2)
@@ -2107,7 +2166,7 @@
// private GridColumn checkBoxColumn = null;
public static void CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
{
-
+
Rectangle checkBoxColumnHeaderRect = new Rectangle(51, 1, 37, 57);
if (e.Column != null && e.Column.AbsoluteIndex == 0)
{
--
Gitblit v1.9.3