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)); }
protected bool Equals(Activity other) { //ignore last modified return(Code == other.Code && BusinessPartnerCode == other.BusinessPartnerCode && HandleByEmployeeCode == other.HandleByEmployeeCode && Action == other.Action && TypeCode == other.TypeCode && SubjectCode == other.SubjectCode && Details == other.Details && Notes == other.Notes && BeginDateTime.Equals(other.BeginDateTime) && DurationMinutes == other.DurationMinutes && Nullable.Equals(CreationDateTime, other.CreationDateTime) && Nullable.Equals(LastModifiedDateTime, other.LastModifiedDateTime) && Nullable.Equals(CloseDate, other.CloseDate) && IsClosed == other.IsClosed && IsActive == other.IsActive && BaseActivity == other.BaseActivity && Equals(Document, other.Document)); }
public bool IsStartable(DateTime now) { var startableDateTime = BeginDateTime.AddMinutes(-1 * MinReservTime); return(now >= startableDateTime); }