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)); }
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; }