Exemplo n.º 1
0
        public ProductPurchase ConfirmPurchaseWith(Guid reservationId)
        {
            if (!ReservationIdValid(reservationId))
            {
                throw new Exception(string.Format("Cannot confirm the purchase with this Id: {0}", reservationId));
            }

            ProductReservation reservation = GetReservationWith(reservationId);
            ProductPurchase purchase = new ProductPurchase(this, reservation.Quantity);
            reservation.HasBeenConfirmed = true;
            PurchasedProducts.Add(purchase);
            return purchase;
        }
Exemplo n.º 2
0
        public ProductPurchase ConfirmPurchaseWith(Guid reservationId)
        {
            if (!ReservationIdValid(reservationId))
            {
                throw new Exception(string.Format("Cannot confirm the purchase with this Id: {0}", reservationId));
            }

            ProductReservation reservation = GetReservationWith(reservationId);
            ProductPurchase    purchase    = new ProductPurchase(this, reservation.Quantity);

            reservation.HasBeenConfirmed = true;
            PurchasedProducts.Add(purchase);
            return(purchase);
        }