/// <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); }
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); }
public ActionResult Collector_Edit(Collector collector) { collectorInfoservice = CollectorInfoService.GetInstance(); collectorInfoservice.Save(collector); return RedirectToAction("Collectors"); }