Пример #1
0
        public IEnumerable <TimeSlot> GetAvailableTimeSlot(DateTime startDate)
        {
            var date = startDate.Date;
            RoomDayReservation reservationsOndate;

            if (!this._reservations.TryGetValue(date, out reservationsOndate))
            {
                reservationsOndate = new RoomDayReservation(date);
            }
            return(reservationsOndate.GetAvailableSlots());
        }
Пример #2
0
        public Result Reserver(User user, TimeSlot slot)
        {
            var date = slot.GetDate();
            RoomDayReservation existingReservations;

            if (!this._reservations.TryGetValue(date, out existingReservations))
            {
                existingReservations = new RoomDayReservation(date);

                this._reservations.Add(date, existingReservations);
            }
            return(existingReservations.Book(user, slot));
        }