From 6acf01e390fe8dbb04c5ad7f4198905df6c974d5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 26 十月 2024 18:49:57 +0800
Subject: [PATCH] 1
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 81 +++++++++++++++++++++++++++++++++++-----
1 files changed, 70 insertions(+), 11 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 385e3e1..5685fb1 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -12,6 +12,7 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
+using DevExpress.Office.Model;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
@@ -24,7 +25,6 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using static System.Windows.Forms.Control;
-
namespace Gs.DevApp.ToolBox
{
@@ -252,6 +252,13 @@
if (gridViews != null)
foreach (var gv in gridViews)
gv.OptionsBehavior.Editable = !isEdt;
+
+ var _btnAry= controls.Find("btnSelect", false);
+ if (_btnAry.Length > 0) {
+ var _btnType = _btnAry[0];
+ _btnType.Enabled = !isEdt;
+ }
+
foreach (JProperty property in dynamicObject.Properties())
{
var strName = property.Name;
@@ -282,10 +289,7 @@
txt.ReadOnly = isEdt;
txt.SelectedIndex = i;
}
-
- ;
}
-
continue;
}
@@ -377,7 +381,14 @@
txt.Enabled = !isEdt;
continue;
}
-
+ if (colType is CheckEdit)
+ {
+ var txt = colType as CheckEdit;
+ if (txt != null)
+ txt.Checked = bool.Parse(strVal);
+ txt.ReadOnly = isEdt;
+ continue;
+ }
//鏃堕棿
if (colType is DateTimePicker)
{
@@ -393,15 +404,37 @@
var txt = colType as Label;
if (_dddddd == "txt_checkStatus")
{
- if (strVal == "True")
+ if (strVal == "True" || strVal=="1")
txt.Text = "宸插鏍�";
- if (strVal == "False")
+ if (strVal == "False" || strVal=="0" || strVal=="")
txt.Text = "鏈鏍�";
}
else
{
txt.Text = strVal;
}
+ }
+ //鑷畾涔変粨搴�
+ if (colType is UcLookCk)
+ {
+ var txt = colType as UcLookCk;
+ txt.SetIdOrCode( strVal);
+ txt.Enabled = !isEdt;
+ continue;
+ }
+ //鑷畾涔変緵搴斿晢
+ if (colType is UcLookSupplier)
+ {
+ var txt = colType as UcLookSupplier;
+ txt.SetIdOrCode(strVal);
+ txt.Enabled = !isEdt;
+ continue;
+ }
+ if (colType is SimpleButton)
+ {
+ var txt = colType as UcLookCk;
+ txt.Enabled = !isEdt;
+ continue;
}
}
}
@@ -474,13 +507,18 @@
txt.Enabled = !isEdt;
continue;
}
-
//鍗曢��
if (ctrl is CheckBox)
{
var txt = ctrl as CheckBox;
txt.Checked = false;
txt.Enabled = !isEdt;
+ }
+ if (ctrl is CheckEdit)
+ {
+ var txt = ctrl as CheckEdit;
+ txt.ReadOnly = isEdt;
+ continue;
}
}
}
@@ -533,7 +571,17 @@
}
//鍗曢��
- if (ctrl is CheckBox) ctrl.Enabled = !isEdt;
+ if (ctrl is CheckBox) {
+ ctrl.Enabled = !isEdt;
+ continue;
+ }
+
+ if (ctrl is CheckEdit)
+ {
+ var txt = ctrl as CheckEdit;
+ txt.ReadOnly = isEdt;
+ continue;
+ }
}
}
@@ -626,7 +674,18 @@
}
/// <summary>
- /// 璇诲彇grid鐨勫綋鍓嶈
+ /// 杞珿uid
+ /// </summary>
+ /// <param name="str"></param>
+ /// <returns></returns>
+ public Guid ToGuid(string str)
+ {
+ if (string.IsNullOrEmpty(str)) return Guid.Empty;
+ return Guid.Parse(str);
+ }
+
+ /// <summary>
+ /// 璇诲彇grid鐨勫綋鍓嶈
/// </summary>
/// <param name="xtraTabControl1"></param>
/// <param name="lbGuid">缂栬緫妗嗕腑鐨勪富閿悕</param>
@@ -658,7 +717,7 @@
else
{
_strGuid = dr["guid"].ToString();
- _strName = dr[2].ToString();
+ _strName = dr[1].ToString();
}
}
--
Gitblit v1.9.3