From ae27635bd92120d0dd975d8480c344162610219a Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期二, 17 九月 2024 10:35:01 +0800
Subject: [PATCH] 文件上传
---
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs | 57 +++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 45 insertions(+), 12 deletions(-)
diff --git a/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs b/DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
index 235ded3..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
{
@@ -220,7 +221,7 @@
if (txt != null)
{
txt.EditValue = strVal;
- // txt.Text = strVal;
+ // txt.Text = strVal;
}
txt.Enabled = isEdt;
continue;
@@ -416,20 +417,52 @@
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- public static string ToCamelCase(string input)
+ public static string ToCamelCase(string propertyName)
{
- if (string.IsNullOrEmpty(input))
- return input;
-
- // 鍖归厤闈炲瓧姣嶆暟瀛楀瓧绗﹀悗鐨勭涓�涓瓧姣嶏紝骞跺皢鍏惰浆鎹负澶у啓
- return Regex.Replace(
- input,
- "([a-z])([A-Z])",
- "$1$2",
- RegexOptions.CultureInvariant
- ).Trim();
+ if (propertyName.Length > 0 && propertyName.All(char.IsUpper))
+ propertyName = propertyName.ToLower();
+ 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