Пример #1
0
        public bool CancelBooking(List <BookedSlot> cancelAtempts)
        {
            var bookable = BookableBroker.GetBookableById(cancelAtempts[0].BookableId);

            ConsumerBroker.Save(this);
            return(true);
        }
Пример #2
0
        public bool BookSlots(List <BookedSlot> bookingAtempt)
        {
            if (!ValidateBookingSlots(bookingAtempt))
            {
                return(false);
            }
            var bookable = BookableBroker.GetBookableById(bookingAtempt[0].BookableId);

            bookable.BookSlot(bookingAtempt);
            myBookedSlotList.AddRange(bookingAtempt);
            ConsumerBroker.Save(this);
            return(true);
        }
Пример #3
0
        public bool CancelBooking(Guid bookingId)
        {
            var toRemove = this.myBookedSlotList.Find(x => x.Id == bookingId);

            this.myBookedSlotList.Remove(toRemove);

            if (toRemove != null || toRemove.BookableId != null || toRemove.BookableId != Guid.Empty)
            {
                var bookable = BookableBroker.GetBookableById(toRemove.BookableId);
                bookable.CancelBooking(toRemove.BookableId);
            }
            ConsumerBroker.Save(this);
            return(true);
        }
Пример #4
0
        public bool BookSlot(BookedSlot bookingAtempt)
        {
            if (!ValidateBookingSlot(bookingAtempt))
            {
                return(false);
            }
            var bookable = BookableBroker.GetBookableById(bookingAtempt.BookableId);

            if (bookable.BookSlot(bookingAtempt))
            {
                myBookedSlotList.Add(bookingAtempt);
                ConsumerBroker.Save(this);
                return(true);
            }
            return(false);
        }