去除静态变量Funs.DB
This commit is contained in:
@@ -7,8 +7,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TestRecordItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据考试记录Id获取明细信息
|
||||
/// </summary>
|
||||
@@ -25,11 +23,12 @@ namespace BLL
|
||||
/// <param name="planId"></param>
|
||||
public static void DeleteTestRecordItemmByTestRecordItemId(string testRecordItemId)
|
||||
{
|
||||
var testRecordItem = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == testRecordItemId);
|
||||
var db1 = Funs.DB;
|
||||
var testRecordItem = db1.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == testRecordItemId);
|
||||
if (testRecordItem != null)
|
||||
{
|
||||
db.Training_TestRecordItem.DeleteOnSubmit(testRecordItem);
|
||||
db.SubmitChanges();
|
||||
db1.Training_TestRecordItem.DeleteOnSubmit(testRecordItem);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user