去除静态变量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
@@ -15,10 +15,7 @@ namespace BLL
public static class InterFaceTaskService
{
public static Model.SGGLDB db = Funs.DB;
#region
#region
/// <summary>
/// 记录数
/// </summary>
@@ -29,7 +26,7 @@ namespace BLL
}
public static List<Model.InterFaceTask> GetInterFaceTaskByModle(Model.InterFaceTask table)
{
var q= from x in db.InterFaceTask
var q= from x in Funs.DB.InterFaceTask
where
( string.IsNullOrEmpty(table.InterFaceTaskId)||x.InterFaceTaskId.Contains(table.InterFaceTaskId)) &&
( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
@@ -73,7 +70,7 @@ namespace BLL
public static Model.InterFaceTask GetInterFaceTaskById(string InterFaceTaskId)
{
return db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
return Funs.DB.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
}
public static void AddInterFaceTask(Model.InterFaceTask newtable)
{
@@ -86,15 +83,16 @@ namespace BLL
CreateTime=newtable.CreateTime,
Enable=newtable.Enable,
};
db.InterFaceTask.InsertOnSubmit(table);
db.SubmitChanges();
var db1 = Funs.DB;
db1.InterFaceTask.InsertOnSubmit(table);
db1.SubmitChanges();
}
public static void UpdateInterFaceTask(Model.InterFaceTask newtable)
{
Model.InterFaceTask table = db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==newtable.InterFaceTaskId);
var db1 = Funs.DB;
Model.InterFaceTask table = db1.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==newtable.InterFaceTaskId);
if (table != null)
{
table.InterFaceTaskId=newtable.InterFaceTaskId;
@@ -103,18 +101,18 @@ namespace BLL
table.Frequency=newtable.Frequency;
table.CreateTime=newtable.CreateTime;
table.Enable=newtable.Enable;
db.SubmitChanges();
db1.SubmitChanges();
}
}
public static void DeleteInterFaceTaskById (string InterFaceTaskId)
{
Model.InterFaceTask table =db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
{
var db1 = Funs.DB;
Model.InterFaceTask table =db1.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
if (table != null)
{
db.InterFaceTask.DeleteOnSubmit(table);
db.SubmitChanges();
db1.InterFaceTask.DeleteOnSubmit(table);
db1.SubmitChanges();
}
}