コード例 #1
0
        public TicketReservation ReserveTicket(int tktQty)
        {
            if (!CanReserveTicket(tktQty))
            {
                ThrowExceptionWithDetailsOnWhyTicketsCannotBeReserved();
            }

            TicketReservation reservation = TicketReservationFactory.CreateReservation(this, tktQty);

            ReservedTickets.Add(reservation);

            return(reservation);
        }
コード例 #2
0
        public TicketReservation ReserveTicket(int ticketQty)
        {
            if (!CanReserveTicket(ticketQty))
            {
                throw new ApplicationException("no enough ticket to reserve");
            }
            TicketReservation reservation = TicketReservationFactory.CreateReservation(this, ticketQty);

            //reservation.Event = this;
            //reservation.ExpiryTime = DateTime.Now.AddMinutes(1);
            //reservation.HasBeenRedeemed = false;
            //reservation.Id = new Guid();
            //reservation.TicketQuantity = ticketQty;
            this.reservedTickets.Add(reservation);
            return(reservation);
        }