去除静态变量Funs.DB
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user