去除静态变量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
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogHJGLService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志焊接数据明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogHJGL> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogHJGL
return (from x in Funs.DB.ZHGL_ConstructionLogHJGL
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogMachineService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志机械明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogMachine> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogMachine
return (from x in Funs.DB.ZHGL_ConstructionLogMachine
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogManagementService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志专业管理明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogManagement> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogManagement
return (from x in Funs.DB.ZHGL_ConstructionLogManagement
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogPersonService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志作业人员明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogPerson> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogPerson
return (from x in Funs.DB.ZHGL_ConstructionLogPerson
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogProblemService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志需要协调解决的问题明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogProblem> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogProblem
return (from x in Funs.DB.ZHGL_ConstructionLogProblem
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogRecordService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志施工经理相关记录明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogRecord> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogRecord
return (from x in Funs.DB.ZHGL_ConstructionLogRecord
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class ConstructionLogService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取项目级施工日志
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogWorkEfficiencyCompanyService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志公司工效明细列表
/// </summary>
@@ -16,7 +15,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogWorkEfficiencyCompany> getListData(string projectId, DateTime month)
{
return (from x in db.ZHGL_ConstructionLogWorkEfficiencyCompany
return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiencyCompany
select x).ToList();
}
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogWorkEfficiencyMonthService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志月工效明细列表
/// </summary>
@@ -16,7 +15,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogWorkEfficiencyMonth> getListData(string projectId, DateTime month)
{
return (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth
return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiencyMonth
where x.ProjectId == projectId && x.Month == month
select x).ToList();
}
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogWorkEfficiencyProjectService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志项目工效明细列表
/// </summary>
@@ -16,7 +15,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogWorkEfficiencyProject> getListData(string projectId, DateTime month)
{
return (from x in db.ZHGL_ConstructionLogWorkEfficiencyProject
return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiencyProject
where x.ProjectId == projectId
select x).ToList();
}
@@ -1,12 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionLogWorkEfficiencyService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取施工日志工效明细列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.ZHGL_ConstructionLogWorkEfficiency> getListData(string ConstructionLogId)
{
return (from x in db.ZHGL_ConstructionLogWorkEfficiency
return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiency
where x.ConstructionLogId == ConstructionLogId
select x).ToList();
}
@@ -1,32 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionPlanApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取分页列表
/// </summary>
/// <returns></returns>
public static IEnumerable getListData(string ConstructionPlanId)
{
return from x in db.ZHGL_ConstructionPlanApprove
var db1 = Funs.DB;
return from x in db1.ZHGL_ConstructionPlanApprove
where x.ConstructionPlanId == ConstructionPlanId && x.ApproveDate != null
orderby x.ApproveDate
select new
{
x.ConstructionPlanApproveId,
x.ConstructionPlanId,
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.ApproveIdea,
x.IsAgree,
x.ApproveType,
UserName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
UserName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
IsAgreeName = x.IsAgree == true ? "同意" : "不同意"
};
}
@@ -95,7 +95,7 @@ namespace BLL
/// <returns>一个总承包商施工计划审批实体</returns>
public static Model.ZHGL_ConstructionPlanApprove GetConstructionPlanApproveByConstructionPlanId(string constructionPlanId)
{
return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == constructionPlanId && x.ApproveDate == null);
return Funs.DB.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == constructionPlanId && x.ApproveDate == null);
}
/// <summary>
/// 修改总承包商施工计划审批信息
@@ -117,7 +117,7 @@ namespace BLL
public static Model.ZHGL_ConstructionPlanApprove GetComplie(string ConstructionPlanId)
{
return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == ConstructionPlanId && x.ApproveType == BLL.Const.ConstructionPlan_Compile);
return Funs.DB.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == ConstructionPlanId && x.ApproveType == BLL.Const.ConstructionPlan_Compile);
}
public static Model.ZHGL_ConstructionPlanApprove GetConstructionPlanApproveById(string ConstructionPlanApproveId)
{
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class ConstructionPlanService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取总承包商施工计划
@@ -1,32 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class ConstructionReportApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取分页列表
/// </summary>
/// <returns></returns>
public static IEnumerable getListData(string ConstructionReportId)
{
return from x in db.ZHGL_ConstructionReportApprove
var db1 = Funs.DB;
return from x in db1.ZHGL_ConstructionReportApprove
where x.ConstructionReportId == ConstructionReportId && x.ApproveDate != null
orderby x.ApproveDate
select new
{
x.ConstructionReportApproveId,
x.ConstructionReportId,
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.ApproveIdea,
x.IsAgree,
x.ApproveType,
UserName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
UserName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
IsAgreeName = x.IsAgree == true ? "同意" : "不同意"
};
}
@@ -95,7 +95,7 @@ namespace BLL
/// <returns>一个总承包商施工报告审批实体</returns>
public static Model.ZHGL_ConstructionReportApprove GetConstructionReportApproveByConstructionReportId(string constructionReportId)
{
return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == constructionReportId && x.ApproveDate == null);
return Funs.DB.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == constructionReportId && x.ApproveDate == null);
}
/// <summary>
/// 修改总承包商施工报告审批信息
@@ -117,7 +117,7 @@ namespace BLL
public static Model.ZHGL_ConstructionReportApprove GetComplie(string ConstructionReportId)
{
return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == ConstructionReportId && x.ApproveType == BLL.Const.ConstructionReport_Compile);
return Funs.DB.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == ConstructionReportId && x.ApproveType == BLL.Const.ConstructionReport_Compile);
}
public static Model.ZHGL_ConstructionReportApprove GetConstructionReportApproveById(string ConstructionReportApproveId)
{
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class ConstructionReportService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取总承包商施工报告
@@ -7,7 +7,7 @@ namespace BLL
/// </summary>
public static class PictureService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取项目图片
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class ProjectConstructionLogService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取项目级施工日志
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class ReceiveFileManagerService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取一般来文
/// </summary>
@@ -203,8 +201,9 @@ namespace BLL
newReceiveFileManager.FromId = getFile.ReceiveFileManagerId;
newReceiveFileManager.FromType = "2";
db.InformationProject_ReceiveFileManager.InsertOnSubmit(newReceiveFileManager);
db.SubmitChanges();
var db1 = Funs.DB;
db1.InformationProject_ReceiveFileManager.InsertOnSubmit(newReceiveFileManager);
db1.SubmitChanges();
////增加一条编码记录
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ReceiveFileManagerMenuId, newReceiveFileManager.ProjectId, null, newReceiveFileManager.ReceiveFileManagerId, newReceiveFileManager.GetFileDate);
@@ -1,32 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class WorkHandoverApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取分页列表
/// </summary>
/// <returns></returns>
public static IEnumerable getListData(string WorkHandoverId)
{
return from x in db.ZHGL_WorkHandoverApprove
var db1 = Funs.DB;
return from x in db1.ZHGL_WorkHandoverApprove
where x.WorkHandoverId == WorkHandoverId && x.ApproveDate != null
orderby x.ApproveDate
select new
{
x.WorkHandoverApproveId,
x.WorkHandoverId,
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.ApproveIdea,
x.IsAgree,
x.ApproveType,
PersonName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
PersonName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(),
IsAgreeName = x.IsAgree == true ? "同意" : "不同意"
};
}
@@ -95,7 +95,7 @@ namespace BLL
/// <returns>一个工作交接审批实体</returns>
public static Model.ZHGL_WorkHandoverApprove GetWorkHandoverApproveByWorkHandoverId(string constructionPlanId)
{
return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == constructionPlanId && x.ApproveDate == null);
return Funs.DB.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == constructionPlanId && x.ApproveDate == null);
}
/// <summary>
/// 修改工作交接审批信息
@@ -117,7 +117,7 @@ namespace BLL
public static Model.ZHGL_WorkHandoverApprove GetComplie(string WorkHandoverId)
{
return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == WorkHandoverId && x.ApproveType == BLL.Const.WorkHandover_Compile);
return Funs.DB.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == WorkHandoverId && x.ApproveType == BLL.Const.WorkHandover_Compile);
}
public static Model.ZHGL_WorkHandoverApprove GetWorkHandoverApproveById(string WorkHandoverApproveId)
{
@@ -1,13 +1,12 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
public class WorkHandoverDetailService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取工作交接明细列表
/// </summary>
@@ -16,7 +15,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData(string WorkHandoverId)
{
return from x in db.ZHGL_WorkHandoverDetail
return from x in Funs.DB.ZHGL_WorkHandoverDetail
where x.WorkHandoverId == WorkHandoverId
select new
{
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class WorkHandoverService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取工作交接