去除静态变量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
@@ -4,6 +4,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
namespace BLL
@@ -11,9 +12,6 @@ namespace BLL
public static class HazardRealtimedeviceService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +23,7 @@ namespace BLL
}
public static List<Model.Hazard_RealTimeDevice> GetHazard_RealTimeDeviceByModle(Model.Hazard_RealTimeDevice table)
{
var q = from x in db.Hazard_RealTimeDevice
var q = from x in Funs.DB.Hazard_RealTimeDevice
where
(string.IsNullOrEmpty(table.ID) || x.ID.Contains(table.ID)) &&
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
@@ -130,7 +128,7 @@ namespace BLL
public static Model.Hazard_RealTimeDevice GetHazard_RealTimeDeviceById(string ID)
{
return db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID);
return Funs.DB.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID);
}
@@ -268,7 +266,7 @@ namespace BLL
}
public static List<Model.Hazard_RealTimeDevice> GetHazard_RealTimeDeviceByDate(DateTime? reportDate)
{
var q = from x in db.Hazard_RealTimeDevice
var q = from x in Funs.DB.Hazard_RealTimeDevice
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0
select x;
return q.ToList();