去除静态变量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,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -8,8 +9,6 @@ namespace BLL
/// </summary>
public static class TrainingPlanService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取培训计划
/// </summary>
@@ -36,8 +35,9 @@ namespace BLL
WorkPostId = plan.WorkPostId,
States = plan.States
};
db.Training_Plan.InsertOnSubmit(newPlan);
db.SubmitChanges();
var db1 = Funs.DB;
db1.Training_Plan.InsertOnSubmit(newPlan);
db1.SubmitChanges();
}
/// <summary>
@@ -80,7 +80,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Training_Plan> GetPlanList()
{
return (from x in db.Training_Plan orderby x.PlanCode select x).ToList();
return (from x in Funs.DB.Training_Plan orderby x.PlanCode select x).ToList();
}
}
}