去除静态变量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 Person_ShuntApproveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分流管理模板列表
|
||||
/// </summary>
|
||||
@@ -16,14 +15,15 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string ShuntId)
|
||||
{
|
||||
return from x in db.Person_ShuntApprove
|
||||
var db1 = Funs.DB;
|
||||
return from x in db1.Person_ShuntApprove
|
||||
where x.ShuntId == ShuntId && x.ApproveDate != null
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.ShuntApproveId,
|
||||
x.ShuntId,
|
||||
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.Person_ShuntApprove GetShuntApproveByShuntApproveId(string ShuntApproveId)
|
||||
{
|
||||
return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == ShuntApproveId);
|
||||
return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == ShuntApproveId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -48,7 +48,7 @@ namespace BLL
|
||||
/// <returns>一个分流管理审批实体</returns>
|
||||
public static Model.Person_ShuntApprove GetShuntApproveByShuntId(string ShuntId)
|
||||
{
|
||||
return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveDate == null);
|
||||
return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveDate == null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -58,17 +58,17 @@ namespace BLL
|
||||
/// <returns>一个分流管理审批实体</returns>
|
||||
public static Model.Person_ShuntApprove GetShuntApproveByApproveId(string approveId)
|
||||
{
|
||||
return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == approveId);
|
||||
return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == approveId);
|
||||
}
|
||||
|
||||
public static Model.Person_ShuntApprove GetComplie(string ShuntId)
|
||||
{
|
||||
return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Compile);
|
||||
return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Compile);
|
||||
}
|
||||
|
||||
public static Model.Person_ShuntApprove GetAudit(string ShuntId)
|
||||
{
|
||||
return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Audit);
|
||||
return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Audit);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -78,7 +78,7 @@ namespace BLL
|
||||
/// <returns>分流管理审批集合</returns>
|
||||
public static List<Model.Person_ShuntApprove> GetShuntApprovesByShuntApproveId(string ShuntApproveId)
|
||||
{
|
||||
return (from x in db.Person_ShuntApprove where x.ShuntApproveId == ShuntApproveId select x).ToList();
|
||||
return (from x in Funs.DB.Person_ShuntApprove where x.ShuntApproveId == ShuntApproveId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user