/// <summary>
 /// 修改TBL_ENERGY表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// 判断有无siteId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateEnergyInfo(Expression <Func <TBL_ENERGY, bool> > whereLambda, TBL_ENERGY info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_ENERGY> dataObject = db.TBL_ENERGY.Where(whereLambda) as DbQuery <TBL_ENERGY>;
             TBL_ENERGY           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.energyDate     = info.energyDate;
             oldInfo.energyWorktime = info.energyWorktime;
             oldInfo.energyStavalue = info.energyStavalue;
             oldInfo.energyEndvalue = info.energyEndvalue;
             oldInfo.energyPrepower = info.energyPrepower;
             oldInfo.energyCurpower = info.energyCurpower;
             oldInfo.energyPrerate  = info.energyPrerate;
             oldInfo.energyCurrate  = info.energyCurrate;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_SITE表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// 判断有无siteId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateSiteInfo(Expression <Func <TBL_SITE, bool> > whereLambda, TBL_SITE info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_SITE> dataObject = db.TBL_SITE.Where(whereLambda) as DbQuery <TBL_SITE>;
             TBL_SITE           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.siteName      = info.siteName;
             oldInfo.siteGroup     = info.siteGroup;
             oldInfo.siteModel     = info.siteModel;
             oldInfo.siteStatus    = info.siteStatus;
             oldInfo.siteSwistatus = info.siteSwistatus;
             oldInfo.siteIp        = info.siteIp;
             oldInfo.siteContime   = info.siteContime;
             oldInfo.siteInssite   = info.siteInssite;
             oldInfo.sitePurtime   = info.sitePurtime;
             oldInfo.siteLife      = info.siteLife;
             oldInfo.siteAcctime   = info.siteAcctime;
             oldInfo.siteNote      = info.siteNote;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_AMMETER表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.ammeterId == info.ammeterId, info) == true </param>
 /// 判断有无ammeterId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateAmmeterInfo(Expression <Func <TBL_AMMETER, bool> > whereLambda, TBL_AMMETER info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_AMMETER> dataObject = db.TBL_AMMETER.Where(whereLambda) as DbQuery <TBL_AMMETER>;
             TBL_AMMETER           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.siteId           = info.siteId;
             oldInfo.ammeterName      = info.ammeterName;
             oldInfo.ammeterGroup     = info.ammeterGroup;
             oldInfo.ammeterModel     = info.ammeterModel;
             oldInfo.ammeterRefpower  = info.ammeterRefpower;
             oldInfo.ammeterOldload   = info.ammeterOldload;
             oldInfo.ammeterNewload   = info.ammeterNewload;
             oldInfo.ammeterRate      = info.ammeterRate;
             oldInfo.ammeterAlarm     = info.ammeterAlarm;
             oldInfo.ammeterStatus    = info.ammeterStatus;
             oldInfo.ammeterSwistatus = info.ammeterSwistatus;
             oldInfo.ammeterLife      = info.ammeterLife;
             oldInfo.ammeterAcctime   = info.ammeterAcctime;
             oldInfo.ammeterNote      = info.ammeterNote;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_CTRCONTROL表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// 判断有无siteId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateCtrcontrolInfo(Expression <Func <TBL_CTRCONTROL, bool> > whereLambda, TBL_CTRCONTROL info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_CTRCONTROL> dataObject = db.TBL_CTRCONTROL.Where(whereLambda) as DbQuery <TBL_CTRCONTROL>;
             TBL_CTRCONTROL           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.ctrcontrolTimweek      = info.ctrcontrolTimweek;
             oldInfo.ctrcontrolLigweek      = info.ctrcontrolLigweek;
             oldInfo.ctrcontrolTimopetime   = info.ctrcontrolTimopetime;
             oldInfo.ctrcontrolTimclotime   = info.ctrcontrolTimclotime;
             oldInfo.ctrcontrolOpeligvalue  = info.ctrcontrolOpeligvalue;
             oldInfo.ctrcontrolCloligvalue  = info.ctrcontrolCloligvalue;
             oldInfo.ctrcontrolLigvalsource = info.ctrcontrolLigvalsource;
             oldInfo.ctrcontrolSystime      = info.ctrcontrolSystime;
             oldInfo.ctrcontrolSysweek      = info.ctrcontrolSysweek;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_USER表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.userId == info.userId, info) == true </param>
 /// 判断有无userId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice>权限信息的修改需要判断用户身份</notice>
 /// <notice>修改密码用专门的方法来修改,这里只管资料</notice>
 public static Boolean UpdateUserInfo(Expression <Func <TBL_USER, bool> > whereLambda, TBL_USER info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_USER> dataObject = db.TBL_USER.Where(whereLambda) as DbQuery <TBL_USER>;
             TBL_USER           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.userName     = info.userName;
             oldInfo.userSex      = info.userSex;
             oldInfo.userPhone    = info.userPhone;
             oldInfo.userWechat   = info.userWechat;
             oldInfo.userStatus   = info.userStatus;
             oldInfo.userLlogtime = info.userLlogtime;
             oldInfo.userExptime  = info.userExptime;
             oldInfo.userAut      = info.userAut;
             oldInfo.userNote     = info.userNote;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 分页查询
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="pageIndex">页码</param>
 /// <param name="pageSize">页容量</param>
 /// <param name="whereLambda">条件 lambda表达式</param>
 /// <param name="orderBy">排列 lambda表达式</param>
 /// <returns></returns>
 public TBL_SITE[] GetPagedListArea <TKey>(int pageIndex, int pageSize, Expression <Func <TBL_SITE, bool> > whereLambda, Expression <Func <TBL_SITE, TKey> > orderBy)
 {
     using (LampNetEntities db = new LampNetEntities())
     {
         //分页时一定注意:Skip之前一定要OrderBy
         return(db.TBL_SITE.Where(whereLambda).OrderBy(orderBy).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToArray());
     }
 }
Esempio n. 7
0
 public int GetSumPageArea(int pageSize)
 {
     using (LampNetEntities db = new LampNetEntities())
     {
         int listSum = db.TBL_SITE.ToList().Count;
         if ((listSum != 0) && listSum % pageSize == 0)
         {
             return(listSum / pageSize);
         }
         return((listSum / pageSize) + 1);
     }
 }
 /// <summary>
 /// 往单控信息表中插入数据
 /// </summary>
 /// <param name="info">前端页面输入的信息</param>
 /// <returns></returns>
 public static Boolean InsertSigcontrolInfo(TBL_SIGCONTROL info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_SIGCONTROL.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往系统设置信息表中插入数据
 /// </summary>
 /// <param name="info">前端页面输入的信息</param>
 /// <returns></returns>
 public static Boolean InsertSyssetInfo(TBL_SYSSET info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_SYSSET.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往文档数据表中插入数据
 /// </summary>
 /// <param name="info">新上传的文档数据信息</param>
 /// <returns></returns>
 public static Boolean InsertDocumentInfo(TBL_DOCUMENT info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_DOCUMENT.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往能耗数据表中插入数据
 /// </summary>
 /// <param name="info">硬件产生的信息(本系统模拟)</param>
 /// <returns></returns>
 public static Boolean InsertEnergyInfo(TBL_ENERGY info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_ENERGY.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往问题反馈表中插入数据
 /// </summary>
 /// <param name="info">新上传的反馈信息</param>
 /// <returns></returns>
 public static Boolean InsertFeedbackInfo(TBL_FEEDBACK info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_FEEDBACK.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往设备运维操作表中插入数据
 /// </summary>
 /// <param name="info">用户操作设备产生的信息</param>
 /// <returns></returns>
 public static Boolean InsertDeviceprotectInfo(TBL_DEVICEPROTECT info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_DEVICEPROTECT.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往电表信息表中插入数据
 /// </summary>
 /// <param name="info">前端页面输入的信息</param>
 /// <returns></returns>
 public static Boolean InsertAmmeterInfo(TBL_AMMETER info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_AMMETER.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 往运行状态历史表中插入数据
 /// </summary>
 /// <param name="info">系统产生的信息(本系统模拟)</param>
 /// <returns></returns>
 public static Boolean InsertRunnoteInfo(TBL_RUNNOTE info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             db.TBL_RUNNOTE.Add(info);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 16
0
 /// <summary>
 /// 查找集控信息表中符合条件的信息
 /// </summary>
 /// <param name="whereLambda">u => u.siteId == info.siteId, u => u.siteId</param>
 /// <returns>集控信息数组</returns>
 public static TBL_CTRCONTROL[] SelectCtrcontrolInfo <TKey>(Expression <Func <TBL_CTRCONTROL, bool> > whereLambda, Expression <Func <TBL_CTRCONTROL, TKey> > orderBy)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_CTRCONTROL> dataObject = db.TBL_CTRCONTROL.Where(whereLambda).OrderBy(orderBy) as DbQuery <TBL_CTRCONTROL>;
             TBL_CTRCONTROL[]         infoList   = dataObject.ToArray();
             return(infoList);
         }
     }
     catch
     {
         TBL_CTRCONTROL[] nullInfo = new TBL_CTRCONTROL[0];
         return(nullInfo);
     }
 }
Esempio n. 17
0
 /// <summary>
 /// 查找系统设置信息表中符合条件的信息
 /// </summary>
 /// <param name="whereLambda">u => u.syssetId == info.syssetId, u => u.syssetId</param>
 /// <returns>系统设置信息数组</returns>
 public static TBL_SYSSET[] SelectSyssetInfo <TKey>(Expression <Func <TBL_SYSSET, bool> > whereLambda, Expression <Func <TBL_SYSSET, TKey> > orderBy)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_SYSSET> dataObject = db.TBL_SYSSET.Where(whereLambda).OrderBy(orderBy) as DbQuery <TBL_SYSSET>;
             TBL_SYSSET[]         infoList   = dataObject.ToArray();
             return(infoList);
         }
     }
     catch
     {
         TBL_SYSSET[] nullInfo = new TBL_SYSSET[0];
         return(nullInfo);
     }
 }
Esempio n. 18
0
 /// <summary>
 /// 查找问题反馈表中符合条件的信息
 /// </summary>
 /// <param name="whereLambda">u => u.userId == info.userId, u => u.userId</param>
 /// <returns>问题反馈数组</returns>
 public static TBL_FEEDBACK[] SelectFeedbackInfo <TKey>(Expression <Func <TBL_FEEDBACK, bool> > whereLambda, Expression <Func <TBL_FEEDBACK, TKey> > orderBy)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_FEEDBACK> dataObject = db.TBL_FEEDBACK.Where(whereLambda).OrderBy(orderBy) as DbQuery <TBL_FEEDBACK>;
             TBL_FEEDBACK[]         infoList   = dataObject.ToArray();
             return(infoList);
         }
     }
     catch
     {
         TBL_FEEDBACK[] nullInfo = new TBL_FEEDBACK[0];
         return(nullInfo);
     }
 }
 /// <summary>
 /// 修改TBL_RUNNOTE表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// <param name="whereLambda"> (u=>u.ammeterId == info.ammeterId, info) == true </param>
 /// 判断有无siteId 或者 有无ammeter
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateRunnoteInfo(Expression <Func <TBL_RUNNOTE, bool> > whereLambda, TBL_RUNNOTE info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_RUNNOTE> dataObject = db.TBL_RUNNOTE.Where(whereLambda) as DbQuery <TBL_RUNNOTE>;
             TBL_RUNNOTE           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.runnoteAlastatus = info.runnoteAlastatus;
             oldInfo.runnoteAlatime   = info.runnoteAlatime;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_FEEDBACK表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.userId == info.userId, info) == true </param>
 /// 判断有无userId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateFeedbackInfo(Expression <Func <TBL_FEEDBACK, bool> > whereLambda, TBL_FEEDBACK info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_FEEDBACK> dataObject = db.TBL_FEEDBACK.Where(whereLambda) as DbQuery <TBL_FEEDBACK>;
             TBL_FEEDBACK           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.userId       = info.userId;
             oldInfo.feedbackTime = info.feedbackTime;
             oldInfo.feedbackNote = info.feedbackNote;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_DOCUMENT表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.documentId == info.documentId, info) == true </param>
 /// 判断有无documentId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateDocumentInfo(Expression <Func <TBL_DOCUMENT, bool> > whereLambda, TBL_DOCUMENT info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_DOCUMENT> dataObject = db.TBL_DOCUMENT.Where(whereLambda) as DbQuery <TBL_DOCUMENT>;
             TBL_DOCUMENT           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.documentKind = info.documentKind;
             oldInfo.documentNote = info.documentNote;
             oldInfo.documentUrl  = info.documentUrl;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_DEVICEPROTECT表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// 判断有无 三个参数都要与原数据中的一样才能修改,否则只能作为新数据插入
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateDeviceprotectInfo(Expression <Func <TBL_DEVICEPROTECT, bool> > whereLambda, TBL_DEVICEPROTECT info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_DEVICEPROTECT> dataObject = db.TBL_DEVICEPROTECT.Where(whereLambda) as DbQuery <TBL_DEVICEPROTECT>;
             TBL_DEVICEPROTECT           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.deviceprotectKind    = info.deviceprotectKind;
             oldInfo.deviceprotectModule  = info.deviceprotectModule;
             oldInfo.deviceprotectLoginfo = info.deviceprotectLoginfo;
             oldInfo.deviceprotectOpttime = info.deviceprotectOpttime;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_RUN表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.siteId == info.siteId, info) == true </param>
 /// 判断有无siteId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateRunInfo(Expression <Func <TBL_RUN, bool> > whereLambda, TBL_RUN info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_RUN> dataObject = db.TBL_RUN.Where(whereLambda) as DbQuery <TBL_RUN>;
             TBL_RUN           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.runVolt      = info.runVolt;
             oldInfo.runCurrent   = info.runCurrent;
             oldInfo.runStavalue  = info.runStavalue;
             oldInfo.runFreshtime = info.runFreshtime;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 24
0
 /// <summary>
 /// 删除电表信息表中的数据
 /// </summary>
 /// <param name="whereLambda">u => ammeterId == ammeterId</param>
 /// Notice:删除电表信息需要对应删除的信息有如下:
 /// 单控TBL_SIGCONTROL、运行状态历史TBL_RUNNOTE、设备运维TBL_DEVICEPROTECT
 public static Boolean DeleteAmmeterInfo(Expression <Func <TBL_AMMETER, bool> > whereLambda)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_AMMETER> dbDelete = db.TBL_AMMETER.Where(whereLambda) as DbQuery <TBL_AMMETER>;
             List <TBL_AMMETER>    obDelete = dbDelete.ToList();
             if (obDelete.Count == 0)
             {
                 return(true);
             }
             db.TBL_AMMETER.RemoveRange(obDelete);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 25
0
 /// <summary>
 /// 删除设备运维操作表中的数据
 /// </summary>
 /// <param name="whereLambda">u => userId == userId</param>
 /// <param name="whereLambda">u => siteId == siteId</param>
 /// <param name="whereLambda">u => ammeterId == ammeterId</param>
 public static Boolean DeleteDeviceprotectInfo(Expression <Func <TBL_DEVICEPROTECT, bool> > whereLambda)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_DEVICEPROTECT> dbDelete = db.TBL_DEVICEPROTECT.Where(whereLambda) as DbQuery <TBL_DEVICEPROTECT>;
             List <TBL_DEVICEPROTECT>    obDelete = dbDelete.ToList();
             if (obDelete.Count == 0)
             {
                 return(true);
             }
             db.TBL_DEVICEPROTECT.RemoveRange(obDelete);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 26
0
 /// <summary>
 /// 删除单控信息表中的数据
 /// </summary>
 /// <param name="whereLambda">u => ammeterId == ammeterId</param>
 public static Boolean DeleteSigcontrolInfo(Expression <Func <TBL_SIGCONTROL, bool> > whereLambda)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_SIGCONTROL> dbDelete = db.TBL_SIGCONTROL.Where(whereLambda) as DbQuery <TBL_SIGCONTROL>;
             List <TBL_SIGCONTROL>    obDelete = dbDelete.ToList();
             if (obDelete.Count == 0)
             {
                 return(true);
             }
             db.TBL_SIGCONTROL.RemoveRange(obDelete);
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_SYSSET表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.syssetId == info.syssetId, info) == true </param>
 /// 判断有无syssetId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateSyssetInfo(Expression <Func <TBL_SYSSET, bool> > whereLambda, TBL_SYSSET info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_SYSSET> dataObject = db.TBL_SYSSET.Where(whereLambda) as DbQuery <TBL_SYSSET>;
             TBL_SYSSET           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.syssetName       = info.syssetName;
             oldInfo.syssetOpevalue   = info.syssetOpevalue;
             oldInfo.syssetClovalue   = info.syssetClovalue;
             oldInfo.syssetAlatime    = info.syssetAlatime;
             oldInfo.syssetAlacurrent = info.syssetAlacurrent;
             oldInfo.syssetNote       = info.syssetNote;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
 /// <summary>
 /// 修改TBL_SIGCONTROL表的数据
 /// </summary>
 /// <param name="whereLambda"> (u=>u.ammeterId == info.ammeterId, info) == true </param>
 /// 判断有无ammeterId
 /// <param name="info"> info是需要修改的信息 </param>
 /// <notice></notice>
 public static Boolean UpdateSigcontrolInfo(Expression <Func <TBL_SIGCONTROL, bool> > whereLambda, TBL_SIGCONTROL info)
 {
     try
     {
         using (LampNetEntities db = new LampNetEntities())
         {
             DbQuery <TBL_SIGCONTROL> dataObject = db.TBL_SIGCONTROL.Where(whereLambda) as DbQuery <TBL_SIGCONTROL>;
             TBL_SIGCONTROL           oldInfo    = dataObject.FirstOrDefault();
             oldInfo.ammeterSwistatus     = info.ammeterSwistatus;
             oldInfo.sigcontrolIndtime    = info.sigcontrolIndtime;
             oldInfo.sigcontrolInsstatime = info.sigcontrolInsstatime;
             oldInfo.sigcontrolInsendtime = info.sigcontrolInsendtime;
             oldInfo.sigcontrolAlacurup   = info.sigcontrolAlacurup;
             oldInfo.sigcontrolAlacurlow  = info.sigcontrolAlacurlow;
             db.SaveChanges();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }