From d89c4f466c0922287ff88d4f61bfba71461cdbf0 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期二, 02 十二月 2025 15:37:58 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs"
index 14df465..83f41a0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBContext.cs"
@@ -1,4 +1,5 @@
-锘縰sing SqlSugar;
+锘縰sing Microsoft.Extensions.Logging;
+using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -23,14 +24,31 @@
/// </summary>
public static MutiDBOperate GetMainConnectionDb()
{
- MutiDBOperate mainDb = new MutiDBOperate()
+ string dbType = AppSettings.GetValue("DBType");
+ if(Enum.TryParse(typeof(DbType),dbType,out object? result) && result != null)
{
- Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB),
- ConnId = MainDb.CurrentDbConnId,
- DbType = DataBaseType.SqlServer
- };
+ DbType dataBaseType = (DbType)result;
+ MutiDBOperate mainDb = new MutiDBOperate()
+ {
+ Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB),
+ ConnId = MainDb.CurrentDbConnId,
+ DbType = dataBaseType
+ };
+ return mainDb;
+ }
+ else
+ {
+ throw new Exception("鏁版嵁搴撹繛鎺ラ厤缃敊璇�");
+ }
- return mainDb;
+ //MutiDBOperate mainDb = new MutiDBOperate()
+ //{
+ // Connection = AppSettings.Get(MainDb.ConnectionString).DecryptDES(AppSecret.DB),
+ // ConnId = MainDb.CurrentDbConnId,
+ // DbType = DataBaseType.SqlServer
+ //};
+
+ //return mainDb;
}
/// <summary>
/// 杩炴帴瀛楃涓�
--
Gitblit v1.9.3