コード例 #1
0
        private static bool IsAllowed(RoomContractSet roomSet, DateTime checkInDate, AccommodationBookingSettings settings, IDateTimeProvider dateTimeProvider,
                                      HashSet <AprMode> aprModesToDisallow, HashSet <PassedDeadlineOffersMode> deadlineModesToDisallow)
        {
            if (roomSet.IsAdvancePurchaseRate && aprModesToDisallow.Contains(settings.AprMode))
            {
                return(false);
            }

            if (deadlineModesToDisallow.Contains(settings.PassedDeadlineOffersMode))
            {
                var tomorrow = dateTimeProvider.UtcTomorrow();
                if (checkInDate <= tomorrow)
                {
                    return(false);
                }

                var deadlineDate = roomSet.Deadline.Date;
                if (deadlineDate.HasValue && deadlineDate.Value.Date <= tomorrow)
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #2
0
 public static bool IsEvaluationAllowed(RoomContractSet roomSet, DateTime checkInDate, AccommodationBookingSettings settings,
                                        IDateTimeProvider dateTimeProvider)
 {
     return(IsAllowed(roomSet,
                      checkInDate,
                      settings,
                      dateTimeProvider,
                      new HashSet <AprMode> {
         AprMode.Hide, AprMode.DisplayOnly
     },
                      new HashSet <PassedDeadlineOffersMode> {
         PassedDeadlineOffersMode.Hide, PassedDeadlineOffersMode.DisplayOnly
     }));
 }