去除静态变量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 RewardAndPunishApproveService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取质量奖罚模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
public static DataTable getListData(string RewardAndPunishId)
{
var res = from x in db.RewardAndPunish_RewardAndPunishApprove
var db1 = Funs.DB;
var res = from x in db1.RewardAndPunish_RewardAndPunishApprove
where x.RewardAndPunishId == RewardAndPunishId && x.ApproveDate != null && x.ApproveType != "S"
orderby x.ApproveDate
select new
{
x.RewardAndPunishApproveId,
x.RewardAndPunishId,
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.RewardAndPunish_RewardAndPunishApprove GetSee(string RewardAndPunishId, string userId)
{
return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
return Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
}
public static void See(string RewardAndPunishId, string userId)
{
@@ -98,11 +99,11 @@ namespace BLL
/// <returns>一个质量奖罚审批实体</returns>
public static Model.RewardAndPunish_RewardAndPunishApprove GetRewardAndPunishApproveByRewardAndPunishId(string RewardAndPunishId)
{
return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType != "S" && x.ApproveDate == null);
return Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType != "S" && x.ApproveDate == null);
}
public static Model.RewardAndPunish_RewardAndPunishApprove GetAuditMan(string RewardAndPunishId, string state)
{
return db.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == state);
return Funs.DB.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == state);
}
/// <summary>
/// 修改质量奖罚审批信息
@@ -193,12 +194,12 @@ namespace BLL
/// <returns></returns>
public static Model.RewardAndPunish_RewardAndPunishApprove GetAudit1(string RewardAndPunishId)
{
return db.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Audit1);
return Funs.DB.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Audit1);
}
public static Model.RewardAndPunish_RewardAndPunishApprove GetComplie(string RewardAndPunishId)
{
return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Compile);
return Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Compile);
}
public static string GetHandleManName(string RewardAndPunishId)
@@ -10,7 +10,7 @@ namespace BLL
/// </summary>
public static class RewardAndPunishService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取质量奖罚