去除静态变量Funs.DB
This commit is contained in:
@@ -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 HSEDataDWService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 安全数据仓库
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -25,7 +24,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
|
||||
private static IQueryable<Model.Base_Project> getDataLists = from x in Funs.DB.Base_Project
|
||||
where x.ProjectState == Const.ProjectState_1
|
||||
select x;
|
||||
|
||||
@@ -51,15 +50,16 @@ 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
|
||||
select new
|
||||
{
|
||||
x.ProjectId,
|
||||
x.ProjectName,
|
||||
x.ProjectCode,
|
||||
Count1=db.SitePerson_Person.Where(p=>p.ProjectId == x.ProjectId && p.States == Const.ProjectPersonStates_1).Count(), //人员数量
|
||||
Count1=db1.SitePerson_Person.Where(p=>p.ProjectId == x.ProjectId && p.States == Const.ProjectPersonStates_1).Count(), //人员数量
|
||||
Count2 = getProjecctSafeHours(x.ProjectId), //安全人工时
|
||||
Count3 =db.EduTrain_TrainRecord.Where(p => p.ProjectId == x.ProjectId && p.States == BLL.Const.State_2).Count(), //安全培训次数
|
||||
Count3 =db1.EduTrain_TrainRecord.Where(p => p.ProjectId == x.ProjectId && p.States == BLL.Const.State_2).Count(), //安全培训次数
|
||||
ProblemRate = getProblemRate(x.ProjectId), //安全巡检整改率
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user