public IList <ReservationHistoryItem> GetReservationHistoryData(IClient client, DateTime?sd, DateTime?ed, bool includeCanceledForModification) { // Select Past Reservations var reservations = _provider.Scheduler.Reservation.SelectHistory(client.ClientID, sd.GetValueOrDefault(Reservations.MinReservationBeginDate), ed.GetValueOrDefault(Reservations.MaxReservationEndDate)); var filtered = _provider.Scheduler.Reservation.FilterCancelledReservations(reservations, includeCanceledForModification); var result = ReservationHistoryItem.CreateList(filtered); return(result); }
public bool IsBeforeForgiveCutoff(ReservationHistoryItem item, DateTime now, int maxForgivenDay, IEnumerable <IHoliday> holidays) { // Normal lab users cannot forgive reservations // Staff can forgive a reservation on the same day it ended, and during the following 3 three business days // Admins can always forgive reservations DateTime maxDay = item.ActualBeginDateTime.GetValueOrDefault(item.EndDateTime); return(IsBeforeForgiveCutoff(now, maxDay, maxForgivenDay, item.Editable, holidays)); }