public Period getPeriod(int bsID, DateTime time) { PeriodCtr pCtr = new PeriodCtr(); MPeriod period = pCtr.getRecord(bsID, time, true); Period p = new Period(); if (period != null) { p.bsID = bsID; p.availNumber = period.initBatteryNumber; p.bookedNumber = period.bookedBatteryNumber; p.time = period.time; } return p; }
public List<Period> getStoragePeriods(int bsID) { PeriodCtr pCtr = new PeriodCtr(); List<MPeriod> periods = pCtr.getStoragePeriods(bsID); List<Period> ps = new List<Period>(); foreach (MPeriod period in periods) { Period p = new Period(); p.availNumber = period.initBatteryNumber; p.bookedNumber = period.bookedBatteryNumber; p.time = period.time; ps.Add(p); } return ps; }
public List<Period> getAllPeriods() { PeriodCtr pCtr = new PeriodCtr(); List<MPeriod> periods = pCtr.getAllRecord(true); List<Period> ps = new List<Period>(); foreach (MPeriod period in periods) { Period p = new Period(); p.availNumber = period.initBatteryNumber; p.bookedNumber = period.bookedBatteryNumber; p.time = period.time; ps.Add(p); } return ps; }