Пример #1
0
        public void SetItem(int productId, double price, int quantity)
        {
            PurchasedProduct purchasedProduct = new PurchasedProduct(productId, price);

            sale.CreateSaleItem(purchasedProduct, quantity);
            Console.WriteLine($"New SaleItem: '{productId}/{quantity}' created");
        }
Пример #2
0
 public void CreateSaleItem(PurchasedProduct product, int quantity)
 {
     this.SaleItems.Add(new SaleItem(product, quantity));
 }
 public SaleItem(PurchasedProduct product, int quantity)
 {
     this.Product  = product;
     this.Quantity = quantity;
 }