From beefa10327cacb21d3f434ec5a537ef4a6cd79de Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期三, 18 九月 2024 20:57:08 +0800
Subject: [PATCH] 增加假日

---
 DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index a2c73a3..700b018 100644
--- a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
+++ b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -15,6 +15,7 @@
 using DevExpress.XtraEditors;
 using DevExpress.XtraTab;
 using System.Text.RegularExpressions;
+using System.Xml;
 
 namespace Gs.DevApp.ToolBox
 {
@@ -263,6 +264,15 @@
                             txt.Enabled = isEdt;
                             continue;
                         }
+                        //鏃堕棿
+                        if (colType is DateTimePicker)
+                        {
+                            DateTimePicker txt = colType as DateTimePicker;
+                            if (txt != null)
+                                txt.Checked = (strVal.ToString() == "1" ? true : false);
+                            txt.Enabled = isEdt;
+                            continue;
+                        }
                     }
                 }
                 catch (Exception ex)
@@ -334,7 +344,12 @@
                     ctrl.Enabled = isEdt;
                     continue;
                 }
-
+                //鏃ユ湡
+                if (ctrl is DateTimePicker)
+                {
+                    ctrl.Enabled = isEdt;
+                    continue;
+                }
             }
         }
 
@@ -423,7 +438,20 @@
             string dd = Regex.Replace(propertyName, @"_([a-z])", m => m.Groups[1].Value.ToUpper());
             return dd;
         }
+        public static void UpdateAppConfig(string key, string newValue)
+        {
+            string configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
+            XmlDocument xmlDoc = new XmlDocument();
+            xmlDoc.Load(configFile);
 
+            XmlNode node = xmlDoc.SelectSingleNode($"//appSettings//add[@key='{key}']");
+            if (node != null)
+            {
+                XmlAttribute attribute = node as XmlAttribute;
+                attribute.Value = newValue;
+                xmlDoc.Save(configFile);
+            }
+        }
         public class CboItemEntity
         {
             private object _text = 0;

--
Gitblit v1.9.3