去除静态变量Funs.DB
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace BLL
|
||||
{
|
||||
public static class ConstructionRiskCheckService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 要求主键获取危险清单信息
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
{
|
||||
public static class ConstructionRiskListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 要求主键获取危险清单信息
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Hazard_EnvironmentalRiskItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据危险源明细表id得到明细信息
|
||||
/// </summary>
|
||||
@@ -136,7 +135,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Hazard_EnvironmentalRiskItem> GetEnvironmentalRiskItemByEnvironmentalId(string environmentalId)
|
||||
{
|
||||
return (from x in db.Hazard_EnvironmentalRiskItem where x.EnvironmentalId == environmentalId select x).ToList();
|
||||
return (from x in Funs.DB.Hazard_EnvironmentalRiskItem where x.EnvironmentalId == environmentalId select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace BLL
|
||||
{
|
||||
public static class Hazard_EnvironmentalRiskListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 要求主键获取危险清单信息
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Hazard_HazardListService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 要求主键获取危险清单信息
|
||||
/// </summary>
|
||||
@@ -23,7 +22,7 @@ namespace BLL
|
||||
/// <returns>危险清单的数量</returns>
|
||||
public static int GetHazardListCountByVersionNoIsNull(string projectId)
|
||||
{
|
||||
return (from x in db.Hazard_HazardList where x.VersionNo == null && x.ProjectId == projectId select x).Count();
|
||||
return (from x in Funs.DB.Hazard_HazardList where x.VersionNo == null && x.ProjectId == projectId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class Hazard_HazardSelectedItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据危险源类别编号查询危险源类别
|
||||
/// </summary>
|
||||
@@ -15,7 +14,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getHazardSelectedItemByHazardListTypeId(string hazardListTypeId, string hazardListId)
|
||||
{
|
||||
return from x in db.Hazard_HazardSelectedItem
|
||||
return from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId
|
||||
select new
|
||||
{
|
||||
@@ -48,7 +47,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getHazardSelectedItemByHazardListTypeId(string hazardListTypeId, string hazardListId, string workStage)
|
||||
{
|
||||
return from x in db.Hazard_HazardSelectedItem
|
||||
return from x in Funs.DB.Hazard_HazardSelectedItem
|
||||
where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.WorkStage == workStage
|
||||
select new
|
||||
{
|
||||
@@ -80,7 +79,7 @@ namespace BLL
|
||||
/// <returns>危险因素明细集合</returns>
|
||||
public static List<Model.Hazard_HazardSelectedItem> GetHazardSelectedItemByHazardListTypeIdAndHazardListId(string hazardListTypeId, string hazardListId)
|
||||
{
|
||||
return (from x in db.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId select x).ToList();
|
||||
return (from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -89,7 +88,7 @@ namespace BLL
|
||||
/// <returns>危险因素明细集合</returns>
|
||||
public static List<Model.Hazard_HazardSelectedItem> GetPromptTimeIsNotNullHazardSelectedItemByHazardListTypeIdAndHazardListId(string hazardListTypeId, string hazardListId)
|
||||
{
|
||||
return (from x in db.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.PromptTime != null select x).ToList();
|
||||
return (from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.PromptTime != null select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -99,7 +98,7 @@ namespace BLL
|
||||
/// <returns>一个危险源辨识与评价清单审批实体</returns>
|
||||
public static Model.Hazard_HazardSelectedItem GetHazardSelectedItemByHazardId(string hazardId, string hazardListId, string workStage)
|
||||
{
|
||||
return db.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId && x.HazardListId == hazardListId && x.WorkStage == workStage);
|
||||
return Funs.DB.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId && x.HazardListId == hazardListId && x.WorkStage == workStage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -109,7 +108,7 @@ namespace BLL
|
||||
/// <returns>一个危险源辨识与评价清单审批实体</returns>
|
||||
public static Model.Hazard_HazardSelectedItem GetHazardSelectedItemByHazardId(string hazardId)
|
||||
{
|
||||
return db.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId);
|
||||
return Funs.DB.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -142,7 +141,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Hazard_HazardSelectedItem> GetHazardSelectedItemBySortAndListIdAndWorkStage(string hazardListTypeId, string hazardListId, string workStage)
|
||||
{
|
||||
return (from x in db.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.WorkStage == workStage select x).ToList();
|
||||
return (from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.WorkStage == workStage select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user