去除静态变量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 CQMS_InspectionApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取报验管理模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
public static DataTable getListData(string InspectionId)
{
var res = from x in db.Material_InspectionApprove
var db1 = Funs.DB;
var res = from x in db1.Material_InspectionApprove
where x.InspectionId == InspectionId && x.ApproveDate != null && x.ApproveType != "S"
orderby x.ApproveDate
select new
{
x.InspectionApproveId,
x.InspectionId,
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,
@@ -77,7 +78,7 @@ namespace BLL
/// <returns></returns>
public static Model.Material_InspectionApprove GetSee(string InspectionId, string userId)
{
return db.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
return Funs.DB.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
}
public static void See(string InspectionId, string userId)
{
@@ -98,11 +99,11 @@ namespace BLL
/// <returns>一个报验管理审批实体</returns>
public static Model.Material_InspectionApprove GetInspectionApproveByInspectionId(string InspectionId)
{
return db.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType != "S" && x.ApproveDate == null);
return Funs.DB.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType != "S" && x.ApproveDate == null);
}
public static Model.Material_InspectionApprove GetAuditMan(string InspectionId, string state)
{
return db.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == state);
return Funs.DB.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == state);
}
/// <summary>
/// 修改报验管理审批信息
@@ -148,7 +149,7 @@ namespace BLL
/// <returns></returns>
public static Model.Material_InspectionApprove GetAudit1(string InspectionId)
{
return db.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit1);
return Funs.DB.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit1);
}
/// <summary>
@@ -158,12 +159,12 @@ namespace BLL
/// <returns></returns>
public static Model.Material_InspectionApprove GetAudit2(string InspectionId)
{
return db.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit2);
return Funs.DB.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit2);
}
public static Model.Material_InspectionApprove GetComplie(string InspectionId)
{
return db.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Compile);
return Funs.DB.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Compile);
}
}
}