去除静态变量Funs.DB
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class DesignApproveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取设计变更模板列表
|
||||
/// </summary>
|
||||
@@ -16,14 +15,15 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string DesignId)
|
||||
{
|
||||
return from x in db.Check_DesignApprove
|
||||
var db1 = Funs.DB;
|
||||
return from x in db1.Check_DesignApprove
|
||||
where x.DesignId == DesignId && x.ApproveDate != null
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.DesignApproveId,
|
||||
x.DesignId,
|
||||
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,
|
||||
@@ -38,7 +38,7 @@ namespace BLL
|
||||
/// <returns>一个设计变更审批实体</returns>
|
||||
public static Model.Check_DesignApprove GetDesignApproveByDesignId(string DesignId)
|
||||
{
|
||||
return db.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveDate == null);
|
||||
return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -48,22 +48,22 @@ namespace BLL
|
||||
/// <returns>一个设计变更审批实体</returns>
|
||||
public static Model.Check_DesignApprove GetDesignApproveByApproveId(string approveId)
|
||||
{
|
||||
return db.Check_DesignApprove.FirstOrDefault(x => x.DesignApproveId == approveId);
|
||||
return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignApproveId == approveId);
|
||||
}
|
||||
|
||||
public static Model.Check_DesignApprove GetComplie(string DesignId)
|
||||
{
|
||||
return db.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Compile);
|
||||
return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Compile);
|
||||
}
|
||||
|
||||
public static Model.Check_DesignApprove GetAuditMan(string DesignId, string state)
|
||||
{
|
||||
return db.Check_DesignApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == state);
|
||||
return Funs.DB.Check_DesignApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == state);
|
||||
}
|
||||
|
||||
public static Model.Check_DesignApprove GetAudit2(string DesignId)
|
||||
{
|
||||
return db.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Audit2);
|
||||
return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Audit2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -73,7 +73,7 @@ namespace BLL
|
||||
/// <returns>设计变更审批集合</returns>
|
||||
public static List<Model.Check_DesignApprove> GetDesignApprovesByDesignId(string DesignId)
|
||||
{
|
||||
return (from x in db.Check_DesignApprove where x.DesignId == DesignId select x).ToList();
|
||||
return (from x in Funs.DB.Check_DesignApprove where x.DesignId == DesignId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user