去除静态变量Funs.DB

This commit is contained in:
2025-01-07 19:00:48 +08:00
parent 188974fadc
commit 2c1a328bc1
290 changed files with 1205 additions and 1242 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ namespace BLL
{
public static class DepartService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
+1 -1
View File
@@ -7,7 +7,7 @@ namespace BLL
public static class LogService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 添加操作日志
+1 -1
View File
@@ -5,7 +5,7 @@ namespace BLL
{
public static class RoleItemService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取角色明细信息
+1 -1
View File
@@ -5,7 +5,7 @@
public static class RoleService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取角色信息
+20 -20
View File
@@ -4,6 +4,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
namespace BLL
@@ -11,9 +12,6 @@ namespace BLL
public static class SysHttplogService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +23,7 @@ namespace BLL
}
public static List<Model.Sys_HttpLog> GetSys_HttpLogByModle(Model.Sys_HttpLog table)
{
var q = from x in db.Sys_HttpLog
var q = from x in Funs.DB.Sys_HttpLog
where
(string.IsNullOrEmpty(table.HttpLogId) || x.HttpLogId.Contains(table.HttpLogId)) &&
(string.IsNullOrEmpty(table.UserName) || x.UserName.Contains(table.UserName)) &&
@@ -74,7 +72,7 @@ namespace BLL
public static Model.Sys_HttpLog GetSys_HttpLogById(string HttpLogId)
{
return db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
return Funs.DB.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
}
@@ -90,22 +88,23 @@ namespace BLL
LogTxt = newtable.LogTxt,
MeThod = newtable.MeThod,
};
db.Sys_HttpLog.InsertOnSubmit(table);
db.SubmitChanges();
var db1 = Funs.DB;
db1.Sys_HttpLog.InsertOnSubmit(table);
db1.SubmitChanges();
}
public static void AddBulkSys_HttpLog(List<Model.Sys_HttpLog> newtables)
{
db.Sys_HttpLog.InsertAllOnSubmit(newtables);
db.SubmitChanges();
var db1 = Funs.DB;
db1.Sys_HttpLog.InsertAllOnSubmit(newtables);
db1.SubmitChanges();
}
public static void UpdateSys_HttpLog(Model.Sys_HttpLog newtable)
{
Model.Sys_HttpLog table = db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == newtable.HttpLogId);
var db1 = Funs.DB;
Model.Sys_HttpLog table = db1.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == newtable.HttpLogId);
if (table != null)
{
table.HttpLogId = newtable.HttpLogId;
@@ -114,28 +113,29 @@ namespace BLL
table.HttpUrl = newtable.HttpUrl;
table.LogTxt = newtable.LogTxt;
table.MeThod = newtable.MeThod;
db.SubmitChanges();
db1.SubmitChanges();
}
}
public static void DeleteSys_HttpLogById(string HttpLogId)
{
Model.Sys_HttpLog table = db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
var db1 = Funs.DB;
Model.Sys_HttpLog table = db1.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId);
if (table != null)
{
db.Sys_HttpLog.DeleteOnSubmit(table);
db.SubmitChanges();
db1.Sys_HttpLog.DeleteOnSubmit(table);
db1.SubmitChanges();
}
}
public static void DeleteALLSys_HttpLog()
{
if (db.Sys_HttpLog != null)
var db1 = Funs.DB;
if (db1.Sys_HttpLog != null)
{
db.Sys_HttpLog.DeleteAllOnSubmit(db.Sys_HttpLog);
db.SubmitChanges();
db1.Sys_HttpLog.DeleteAllOnSubmit(db1.Sys_HttpLog);
db1.SubmitChanges();
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ namespace BLL
{
public static class SysMenuService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据MenuId获取菜单名称项
@@ -7,8 +7,6 @@ namespace BLL
/// </summary>
public static class Sys_UserShowColumnsService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据用户ID获取信息
/// </summary>
@@ -32,8 +30,9 @@ namespace BLL
newShowColumns.UserId = showColumns.UserId;
newShowColumns.Columns = showColumns.Columns;
newShowColumns.ShowType = showColumns.ShowType;
db.Sys_UserShowColumns.InsertOnSubmit(newShowColumns);
db.SubmitChanges();
var db1 = Funs.DB;
db1.Sys_UserShowColumns.InsertOnSubmit(newShowColumns);
db1.SubmitChanges();
}
/// <summary>
@@ -44,12 +43,13 @@ namespace BLL
/// <param name="def"></param>
public static void UpdateUserShowColumns(Model.Sys_UserShowColumns showColumns)
{
Model.Sys_UserShowColumns newShowColumns = db.Sys_UserShowColumns.FirstOrDefault(e => e.ShowColumnId == showColumns.ShowColumnId);
var db1 = Funs.DB;
Model.Sys_UserShowColumns newShowColumns = db1.Sys_UserShowColumns.FirstOrDefault(e => e.ShowColumnId == showColumns.ShowColumnId);
if (newShowColumns != null)
{
newShowColumns.Columns = showColumns.Columns;
newShowColumns.ShowType = showColumns.ShowType;
db.SubmitChanges();
db1.SubmitChanges();
}
}
@@ -59,9 +59,10 @@ namespace BLL
/// <param name="roleId"></param>
public static void DeleteUserShowColumns(string showColumnId)
{
Model.Sys_UserShowColumns newShowColumns = db.Sys_UserShowColumns.First(e => e.ShowColumnId == showColumnId);
db.Sys_UserShowColumns.DeleteOnSubmit(newShowColumns);
db.SubmitChanges();
var db1 = Funs.DB;
Model.Sys_UserShowColumns newShowColumns = db1.Sys_UserShowColumns.First(e => e.ShowColumnId == showColumnId);
db1.Sys_UserShowColumns.DeleteOnSubmit(newShowColumns);
db1.SubmitChanges();
}
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ namespace BLL
/// </summary>
public static class UnitService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取单位信息