Exemplo n.º 1
0
        public bool CancelBooking(List <BookedSlot> cancelAtempts)
        {
            var bookable = BookableBroker.GetBookableById(cancelAtempts[0].BookableId);

            ConsumerBroker.Save(this);
            return(true);
        }
Exemplo n.º 2
0
        public bool BookSlot(List <BookedSlot> bookings)
        {
            if (!ValidateBookingSlots(bookings))
            {
                return(false);
            }

            this.BookedSlots.AddRange(bookings);

            BookableBroker.Save(this);
            return(true);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
 public bool BookSlot(BookedSlot booking)
 {
     if (ValidateBookingSlot(booking))
     {
         if (this.BookedSlots == null)
         {
             this.BookedSlots = new List <BookedSlot>();
         }
         this.BookedSlots.Add(booking);
         BookableBroker.Save(this);
         return(true);
     }
     return(false);
 }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        public bool CancelBooking(Guid BookingId)
        {
            if (this.BookedSlots == null)
            {
                return(true);
            }
            var toRemove = this.BookedSlots.Find(x => x.Id == BookingId);

            if (toRemove == null)
            {
                return(true);
            }
            this.BookedSlots.Remove(toRemove);
            BookableBroker.Save(this);
            return(true);
        }
Exemplo n.º 7
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);
        }