Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
        public BatteryStorage getStorage(int id)
        {
            BatteryStorageCtr sCtr = new BatteryStorageCtr();
            PeriodCtr pCtr = new PeriodCtr();
            MBatteryStorage storage = sCtr.getRecord(id, true);
            BatteryStorage s = new BatteryStorage();
            if (storage != null)
            {
                s.ID = storage.id;
                s.typeID = storage.type.id;
                s.periods = getStoragePeriods(id);
                s.storageNumber = storage.storageNumber;

            }
            return s;
        }
Example #4
0
 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;
 }