去除静态变量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
@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionRiskApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取风险管控模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
public static DataTable getListData(string ConstructionRiskId)
{
var res = from x in db.HSSE_ConstructionRiskApprove
var db1 = Funs.DB;
var res = from x in db1.HSSE_ConstructionRiskApprove
where x.ConstructionRiskId == ConstructionRiskId && x.ApproveDate != null && x.ApproveType != "S"
orderby x.ApproveDate
select new
{
x.ConstructionRiskApproveId,
x.ConstructionRiskId,
ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
x.ApproveDate,
x.IsAgree,
x.ApproveIdea,
@@ -76,7 +77,7 @@ namespace BLL
/// <returns></returns>
public static Model.HSSE_ConstructionRiskApprove GetSee(string ConstructionRiskId, string userId)
{
return db.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
return Funs.DB.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
}
public static void See(string ConstructionRiskId, string userId)
{
@@ -97,7 +98,7 @@ namespace BLL
/// <returns>一个风险管控审批实体</returns>
public static Model.HSSE_ConstructionRiskApprove GetConstructionRiskApproveByConstructionRiskId(string ConstructionRiskId)
{
return db.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType != "S" && x.ApproveDate == null);
return Funs.DB.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType != "S" && x.ApproveDate == null);
}
/// <summary>
/// 修改风险管控审批信息
@@ -162,7 +163,7 @@ namespace BLL
/// <returns></returns>
public static Model.HSSE_ConstructionRiskApprove GetAudit1(string ConstructionRiskId)
{
return db.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit1);
return Funs.DB.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit1);
}
/// <summary>
@@ -172,7 +173,7 @@ namespace BLL
/// <returns></returns>
public static Model.HSSE_ConstructionRiskApprove GetAudit2(string ConstructionRiskId)
{
return db.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit2);
return Funs.DB.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit2);
}
/// <summary>
@@ -182,12 +183,12 @@ namespace BLL
/// <returns></returns>
public static Model.HSSE_ConstructionRiskApprove GetAudit3(string ConstructionRiskId)
{
return db.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit3);
return Funs.DB.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit3);
}
public static Model.HSSE_ConstructionRiskApprove GetComplie(string ConstructionRiskId)
{
return db.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Compile);
return Funs.DB.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Compile);
}
public static List<Model.HSSE_ConstructionRiskApprove> GetListDataByCodeForApi(string code)
{