예제 #1
0
 public void AddToCart(AbstractProduct product, int quantity)
 {
     _cartProducts.Add(CartProductFactory.Create(product, quantity));
 }
예제 #2
0
 public CartProduct(AbstractProduct prod, int quantity)
 {
     Product  = prod;
     Quantity = quantity;
     Subtotal = quantity * Product.ProductPrice;
 }
예제 #3
0
 public static CartProduct Create(AbstractProduct product, int quantity)
 {
     return(new CartProduct(product, quantity));
 }