コード例 #1
0
ファイル: Consumer.cs プロジェクト: lixx0115/BookingService
        public bool CancelBooking(List <BookedSlot> cancelAtempts)
        {
            var bookable = BookableBroker.GetBookableById(cancelAtempts[0].BookableId);

            ConsumerBroker.Save(this);
            return(true);
        }
コード例 #2
0
        public bool BookSlot(List <BookedSlot> bookings)
        {
            if (!ValidateBookingSlots(bookings))
            {
                return(false);
            }

            this.BookedSlots.AddRange(bookings);

            BookableBroker.Save(this);
            return(true);
        }
コード例 #3
0
ファイル: Consumer.cs プロジェクト: lixx0115/BookingService
        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);
        }
コード例 #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);
 }
コード例 #5
0
ファイル: Consumer.cs プロジェクト: lixx0115/BookingService
        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);
        }
コード例 #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);
        }
コード例 #7
0
ファイル: Consumer.cs プロジェクト: lixx0115/BookingService
        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);
        }