去除静态变量Funs.DB
This commit is contained in:
@@ -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 TestPlanService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训计划
|
||||
/// </summary>
|
||||
@@ -53,8 +52,9 @@ namespace BLL
|
||||
States = testPlan.States
|
||||
};
|
||||
|
||||
db.Training_TestPlan.InsertOnSubmit(newTestPlan);
|
||||
db.SubmitChanges();
|
||||
var db1 = Funs.DB;
|
||||
db1.Training_TestPlan.InsertOnSubmit(newTestPlan);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -63,7 +63,8 @@ namespace BLL
|
||||
/// <param name="TestPlan"></param>
|
||||
public static void UpdateTestPlan(Model.Training_TestPlan TestPlan)
|
||||
{
|
||||
Model.Training_TestPlan newTestPlan = db.Training_TestPlan.FirstOrDefault(e => e.TestPlanId == TestPlan.TestPlanId);
|
||||
var db1 = Funs.DB;
|
||||
Model.Training_TestPlan newTestPlan = db1.Training_TestPlan.FirstOrDefault(e => e.TestPlanId == TestPlan.TestPlanId);
|
||||
if (newTestPlan != null)
|
||||
{
|
||||
newTestPlan.PlanCode = TestPlan.PlanCode;
|
||||
@@ -83,7 +84,7 @@ namespace BLL
|
||||
newTestPlan.WorkPostIds = TestPlan.WorkPostIds;
|
||||
newTestPlan.WorkPostNames = TestPlan.WorkPostNames;
|
||||
newTestPlan.States = TestPlan.States;
|
||||
db.SubmitChanges();
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Training_TestPlan> GetTestPlanList()
|
||||
{
|
||||
return (from x in db.Training_TestPlan orderby x.PlanCode select x).ToList();
|
||||
return (from x in Funs.DB.Training_TestPlan orderby x.PlanCode select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user