diff --git a/ClientsLibrary/AccountSupport/AccountLogin.cs b/ClientsLibrary/AccountSupport/AccountLogin.cs index 9200482..29ffe1f 100644 --- a/ClientsLibrary/AccountSupport/AccountLogin.cs +++ b/ClientsLibrary/AccountSupport/AccountLogin.cs @@ -196,6 +196,7 @@ namespace ClientsLibrary { UserClient.SystemFactories = json[nameof(UserClient.SystemFactories)].ToObject>(); } + CommonLibrary.DataBaseSupport.SqlServerSupport.ConnectionString = SoftBasic.GetValueFromJsonObject(json, nameof(ServerSettings.SqlServerStr), ""); } else { diff --git a/CommonLibrary/BasicSupport/SoftSettings.cs b/CommonLibrary/BasicSupport/SoftSettings.cs index fa15286..e480be1 100644 --- a/CommonLibrary/BasicSupport/SoftSettings.cs +++ b/CommonLibrary/BasicSupport/SoftSettings.cs @@ -50,6 +50,10 @@ namespace CommonLibrary /// public string Announcement { get; set; } = "测试公告"; /// + /// 数据库连接字符串 + /// + public string SqlServerStr { get; set; } = string.Empty; + /// /// 是否允许账户登录,超级管理员账户除外 /// public bool Can_Account_Login { get; set; } = true; @@ -163,6 +167,7 @@ namespace CommonLibrary { nameof(WhetherToEnableTrustedClientAuthentication),new JValue(WhetherToEnableTrustedClientAuthentication) }, { nameof(TrustedClientList),new JArray(TrustedClientList) }, { nameof(AllowLoginWhenFramewordVersionNotCheck), new JValue(AllowLoginWhenFramewordVersionNotCheck) }, + { nameof(SqlServerStr), new JValue(SqlServerStr) }, }; return json.ToString(); } @@ -179,7 +184,7 @@ namespace CommonLibrary AllowUserMultiOnline = SoftBasic.GetValueFromJsonObject(json, nameof(AllowUserMultiOnline), AllowUserMultiOnline); Account_Forbidden_Reason = SoftBasic.GetValueFromJsonObject(json, nameof(Account_Forbidden_Reason), Account_Forbidden_Reason); AllowLoginWhenFramewordVersionNotCheck = SoftBasic.GetValueFromJsonObject(json, nameof(AllowLoginWhenFramewordVersionNotCheck), AllowLoginWhenFramewordVersionNotCheck); - + SqlServerStr = SoftBasic.GetValueFromJsonObject(json, nameof(SqlServerStr), SqlServerStr); if (json[nameof(SystemFactories)] != null) diff --git a/CommonLibrary/CommonLibrary.csproj b/CommonLibrary/CommonLibrary.csproj index 1db465d..ec8a76e 100644 --- a/CommonLibrary/CommonLibrary.csproj +++ b/CommonLibrary/CommonLibrary.csproj @@ -118,6 +118,7 @@ FormWaitInfomation.cs + diff --git a/CommonLibrary/DataBaseSupport/SqlServerSupport.cs b/CommonLibrary/DataBaseSupport/SqlServerSupport.cs new file mode 100644 index 0000000..3c613c1 --- /dev/null +++ b/CommonLibrary/DataBaseSupport/SqlServerSupport.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace CommonLibrary.DataBaseSupport +{ + /// + /// 使用SQL SERVER服务器的时的数据支持 + /// + public class SqlServerSupport + { + /// + /// 数据库的连接字符串,该信息应来源于服务器保存的连接字符串 + /// + public static string ConnectionString { get; set; } + + } +} diff --git a/CommonLibrary/UserSystem.cs b/CommonLibrary/UserSystem.cs index 2b95ace..1c95483 100644 --- a/CommonLibrary/UserSystem.cs +++ b/CommonLibrary/UserSystem.cs @@ -44,7 +44,7 @@ namespace CommonLibrary **************************************************************************/ - SoftBasic.FrameworkVersion = new SystemVersion("1.7.10"); + SoftBasic.FrameworkVersion = new SystemVersion("1.7.11"); } diff --git a/软件系统服务端模版/FormServerWindow.cs b/软件系统服务端模版/FormServerWindow.cs index afdfa56..e793c2d 100644 --- a/软件系统服务端模版/FormServerWindow.cs +++ b/软件系统服务端模版/FormServerWindow.cs @@ -111,6 +111,7 @@ namespace 软件系统服务端模版 // 初始化并加载账户信息 UserServer.ServerSettings.FileSavePath = Application.StartupPath + @"\settings.txt"; UserServer.ServerSettings.LoadByFile(); + CommonLibrary.DataBaseSupport.SqlServerSupport.ConnectionString = UserServer.ServerSettings.SqlServerStr; // 初始化并加载角色规则 UserServer.ServerRoles.FileSavePath = Application.StartupPath + @"\roles.txt"; @@ -487,6 +488,7 @@ namespace 软件系统服务端模版 { { nameof(UserServer.ServerSettings.Announcement), new JValue(UserServer.ServerSettings.Announcement) }, { nameof(UserServer.ServerSettings.SystemFactories), new JArray(UserServer.ServerSettings.SystemFactories) }, + { nameof(UserServer.ServerSettings.SqlServerStr), new JValue(UserServer.ServerSettings.SqlServerStr) }, }; net_simplify_server.SendMessage(state, handle, json.ToString()); } diff --git a/软件系统浏览器模版/Controllers/AccountController.cs b/软件系统浏览器模版/Controllers/AccountController.cs index 9d90e29..fed0d23 100644 --- a/软件系统浏览器模版/Controllers/AccountController.cs +++ b/软件系统浏览器模版/Controllers/AccountController.cs @@ -124,6 +124,7 @@ namespace 软件系统浏览器模版.Controllers json = JObject.Parse(result.Content); //例如公告数据 UserClient.Announcement = SoftBasic.GetValueFromJsonObject(json, nameof(UserClient.Announcement), ""); + CommonLibrary.DataBaseSupport.SqlServerSupport.ConnectionString = SoftBasic.GetValueFromJsonObject(json, nameof(ServerSettings.SqlServerStr), ""); } else {