public bool IsBeforeMinCancelTime(DateTime now) { // [2020-09-29 jg] // Per discussion in staff meeting. Tool engineers can cancel their own reservation even // after MinCancelTime (as long as the reservation is startable). if (IsToolEngineer) { return(true); } if (MinCancelTime == 0) { if (now < BeginDateTime) { return(true); } else { return(IsStartable(now)); } } return(now <= BeginDateTime.AddMinutes(-1 * MinCancelTime)); }
public bool IsStartable(DateTime now) { var startableDateTime = BeginDateTime.AddMinutes(-1 * MinReservTime); return(now >= startableDateTime); }