去除静态变量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
@@ -12,8 +12,6 @@ namespace BLL
/// </summary>
public static class EnvironmentalCheckService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
@@ -22,7 +20,8 @@ namespace BLL
/// <returns></returns>
public static ReturnData PushEnvironmentalCheckData()
{
var items = (from x in db.EnvironmentalCheck where x.IsPushed == false select x).ToList();
var db1 = Funs.DB;
var items = (from x in db1.EnvironmentalCheck where x.IsPushed == false select x).ToList();
Model.ReturnData responeData = new Model.ReturnData();
if (items.Count() > 0)
{
@@ -35,11 +34,11 @@ namespace BLL
{//推送成功后,修改数据状态
foreach (var item in items)
{
Model.EnvironmentalCheck envModel = db.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id);
Model.EnvironmentalCheck envModel = db1.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id);
if (envModel != null)
{
envModel.IsPushed = true;
db.SubmitChanges();
db1.SubmitChanges();
}
}
}