From 34697d73ce31cfe3edc760f6c4d1d3640ce263a1 Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期一, 16 九月 2024 20:53:05 +0800
Subject: [PATCH] 增加更新

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

diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 3ff807d..646a7e1 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
 {
@@ -423,7 +424,45 @@
             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;
+            private object _Value = "";
+            /// <summary>
+            /// 鏄剧ず鍊�
+            /// </summary>
+            public object Text
+            {
+                get { return this._text; }
+                set { this._text = value; }
+            }
+            /// <summary>
+            /// 瀵硅薄鍊�
+            /// </summary>
+            public object Value
+            {
+                get { return this._Value; }
+                set { this._Value = value; }
+            }
 
+            public override string ToString()
+            {
+                return this.Text.ToString();
+            }
+        }
     }
 }

--
Gitblit v1.9.3