Пример #1
0
        public static bool ApplicationsIntersect(IIntersectingCheckableApplication app1, IIntersectingCheckableApplication app2)
        {
            if (app1 is null)
            {
                throw new ArgumentNullException(nameof(app1));
            }

            if (app2 is null)
            {
                throw new ArgumentNullException(nameof(app2));
            }

            var result =
                app1.BeginDate >= app2.BeginDate &&
                app1.BeginDate <= app2.EndDate
                ||
                app2.BeginDate >= app1.BeginDate &&
                app2.BeginDate <= app1.EndDate;

            return(result);
        }
Пример #2
0
 public bool IntersectsWith(IIntersectingCheckableApplication application)
 {
     return(ReservationSystemHelper.ApplicationsIntersect(this, application));
 }