/// <summary> /// Adding a product into order for customer can order multiple items /// </summary> /// <param name="product"> The customer product purchase </param> /// <param name="amount"> The number of product to be purchased </param> public bool AddProduct(Product product, int amount) { // SPECIAL CASE TO CONSIDER: IF THE RESTRICTED AMOUNT IS LESS THAN OR EQUAL TO 0, IT MEANS THERE IS NO LIMIT. if (product == null || amount <= 0 || (product.RestrictedAmount > 0 && product.RestrictedAmount < amount)) { return(false); } ProductDetail.Add(product.Name, amount); ProductPrice.Add(product.Name, Math.Round(product.Price, 2)); return(true); }