Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        public bool IsStartable(DateTime now)
        {
            var startableDateTime = BeginDateTime.AddMinutes(-1 * MinReservTime);

            return(now >= startableDateTime);
        }