public void removeProduct(int id) { CartProduct item = findProduct(id); if (item.Id != 0) { this.items.Remove(item); } }
public void AddToCart(int id, string name, decimal price, int amount, string image) { CartProduct product = findProduct(id); if (product.Id != 0) { product.Amount += amount; } else { this.items.Add(new CartProduct(id, name, price, amount, image)); } }
public void addProduct(CartProduct item) { this.products.Add(item); }
public void reduceAmountOnProduct(int id, int amountToReduce) { CartProduct item = findProduct(id); item.Amount -= amountToReduce; }
public void addAmountOnProduct(int id, int amountToAdd) { CartProduct item = findProduct(id); item.Amount += amountToAdd; }
public void SetAmountOnProduct(int id, int newAmount) { CartProduct item = findProduct(id); item.Amount = newAmount; }