From 1a1c8e71fcd14858f595029f089b2d4a00202b32 Mon Sep 17 00:00:00 2001
From: ogi <Administrator@S-OGI-PC>
Date: Fri, 05 Dec 2025 09:24:16 +0900
Subject: [PATCH] プロジェクトファイルを追加。
---
HotelPms.WinForm.Common/Util/EnvironmentSetting.cs | 66 +++++++++++++++++++++++++++++++++
1 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/HotelPms.WinForm.Common/Util/EnvironmentSetting.cs b/HotelPms.WinForm.Common/Util/EnvironmentSetting.cs
new file mode 100644
index 0000000..65e9375
--- /dev/null
+++ b/HotelPms.WinForm.Common/Util/EnvironmentSetting.cs
@@ -0,0 +1,66 @@
+using HotelPms.Share.Data;
+using HotelPms.Share.IO;
+using System.Reflection;
+using System.Text;
+
+namespace HotelPms.WinForm.Common.Util
+{
+ public static class EnvironmentSetting
+ {
+ private static Setting? m_Default;
+
+ public static Setting Default
+ {
+ get
+ {
+ if (m_Default == null) {
+ //var aa = Config.Instance.Get(Config.SettingKey.HostName);
+
+ m_Default = new Setting
+ {
+ DataBase = new DBConnectItem(Config.Instance.Get(Config.SettingKey.HostName),
+ Config.Instance.Get(Config.SettingKey.DBName),
+ Config.Instance.Get(Config.SettingKey.UserID),
+ Config.Instance.Get(Config.SettingKey.Password)),
+ };
+ OperationLog.Instance.WriteLog(Config.Instance.ToString());
+ }
+ return m_Default;
+ }
+ }
+
+ #region ★★★★★ Function ★★★★★
+
+ /// <summary>
+ /// 初期化
+ /// </summary>
+ /// <returns></returns>
+ public static bool Init()
+ {
+ try
+ {
+ return true;
+ }
+ catch(Exception ex)
+ {
+ OperationLog.Instance.WriteLog($"{MethodInfo.GetCurrentMethod()}:{ex.Message}");
+ return false;
+ }
+ }
+
+ public static string GetResourceString(string name)
+ {
+ using (Stream st = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
+ {
+ using (StreamReader sr = new StreamReader(st, Encoding.UTF8))
+ {
+ string info = sr.ReadToEnd();
+ return info;
+ }
+ }
+ }
+
+ #endregion
+
+ }
+}
--
Gitblit v1.10.0