Beispiel #1
0
        public void removeProduct(int id)
        {
            CartProduct item = findProduct(id);

            if (item.Id != 0)
            {
                this.items.Remove(item);
            }
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
 public void addProduct(CartProduct item)
 {
     this.products.Add(item);
 }
Beispiel #4
0
        public void reduceAmountOnProduct(int id, int amountToReduce)
        {
            CartProduct item = findProduct(id);

            item.Amount -= amountToReduce;
        }
Beispiel #5
0
        public void addAmountOnProduct(int id, int amountToAdd)
        {
            CartProduct item = findProduct(id);

            item.Amount += amountToAdd;
        }
Beispiel #6
0
        public void SetAmountOnProduct(int id, int newAmount)
        {
            CartProduct item = findProduct(id);

            item.Amount = newAmount;
        }