/// <summary>
 /// 创建一个采集器服务
 /// </summary>
 /// <returns>采集器服务</returns>
 public static CollectorInfoService GetInstance()
 {
     if (_instance == null)
     {
         _instance = new CollectorInfoService();
     }
     return _instance;
 }
 /// <summary>
 /// 创建一个采集器服务
 /// </summary>
 /// <returns>采集器服务</returns>
 public static CollectorInfoService GetInstance()
 {
     if (_instance == null)
     {
         _instance = new CollectorInfoService();
     }
     return(_instance);
 }
Beispiel #3
0
        public double GetEnergy(Plant plant, string startyyyyMMdd, string endyyyyMMdd)
        {
            double returnValue = 0;

            if (plant == null || plant.plantUnits == null || plant.plantUnits.Count.Equals(0))
            {
                return(0);
            }
            foreach (PlantUnit pu in plant.plantUnits)
            {
                returnValue += CollectorInfoService.GetInstance().GetEnergy(pu.id, startyyyyMMdd, endyyyyMMdd);
            }

            return(returnValue);
        }
Beispiel #4
0
 public ActionResult Collector_Edit(Collector collector)
 {
     collectorInfoservice = CollectorInfoService.GetInstance();
     collectorInfoservice.Save(collector);
     return RedirectToAction("Collectors");
 }