Ejemplo n.º 1
0
        public void removeProduct(int id)
        {
            CartProduct item = findProduct(id);

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

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

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

            item.Amount = newAmount;
        }