Exemple #1
0
 public void addProduct(CanonicalProduct canonicalProduct, decimal price)
 {
     Product product = new Product(canonicalProduct, price);
     this.Products.Add(canonicalProduct.Uid, product);
 }
 public OrderItem(SerializationInfo info, StreamingContext ctxt)
 {
     this.Product = (Product)info.GetValue("Product", typeof(Product));
     this.Quantity = (int)info.GetValue("Quantity", typeof(int));
 }
Exemple #3
0
 public void AddItem(Product product, int quantity)
 {
     OrderItem item = new OrderItem(product, quantity);
     this.Items.Add(item);
     this.TotalPrice += product.Price * quantity;
 }
 public OrderItem(Product product, int quantity)
 {
     this.Product = product;
     this.Quantity = quantity;
 }