Exemplo n.º 1
0
        public void AddItem(SVTrade.Models.Product product, int quantity, int pluser)
        {
            CartLine line = lineCollection
                            .Where(p => p.Product.productID == product.productID)
                            .FirstOrDefault();

            if (line == null)
            {
                lineCollection.Add(new CartLine
                {
                    Product  = product,
                    Quantity = quantity
                });
            }
            else
            if (pluser > 0)
            {
                line.Quantity = pluser;
            }
        }
Exemplo n.º 2
0
 public void RemoveLine(SVTrade.Models.Product product)
 {
     lineCollection.RemoveAll(l => l.Product.productID == product.productID);
 }