去除静态变量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
+7 -7
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Linq;
using Model;
namespace BLL
{
@@ -10,8 +11,6 @@ namespace BLL
/// </summary>
public static class TestRecordService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +24,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Training_TestRecord> getDataLists = from x in db.Training_TestRecord
private static IQueryable<Model.Training_TestRecord> getDataLists = from x in Funs.DB.Training_TestRecord
where x.TestStartTime.HasValue
select x;
@@ -44,16 +43,17 @@ namespace BLL
return null;
}
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
var db1 = Funs.DB;
return from x in getDataList
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
join z in db.Training_Plan on y.PlanId equals z.PlanId into g
join y in db1.Training_TestPlan on x.TestPlanId equals y.TestPlanId
join z in db1.Training_Plan on y.PlanId equals z.PlanId into g
from z in g.DefaultIfEmpty()
select new
{
x.TestRecordId,
x.TestPlanId,
x.ProjectId,
db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName,
db1.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName,
y.PlanName,
y.PlanCode,
y.TestPalce,
@@ -62,7 +62,7 @@ namespace BLL
x.TestEndTime,
x.TestScores,
z.TrainTypeId,
db.Base_TrainType.First(u=>u.TrainTypeId == z.TrainTypeId).TrainTypeName,
db1.Base_TrainType.First(u=>u.TrainTypeId == z.TrainTypeId).TrainTypeName,
z.TrainStartDate,
};
}