public virtual void AddItem(PizzaViewModel.PizzaViewModel pizzaVM, int quantity) { CartLine line = lineCollection.Where(p => p.PizzaVm.PizzaID == pizzaVM.PizzaID).FirstOrDefault(); if (line == null) { lineCollection.Add(new CartLine { PizzaVm = pizzaVM, Quantity = quantity }); } else { line.Quantity += quantity; } }
public override void RemoveLine(PizzaViewModel.PizzaViewModel pizzaVM) { base.RemoveLine(pizzaVM); Session.SetJson("Cart", this); }
public override void AddItem(PizzaViewModel.PizzaViewModel pizzaVM, int quantity) { base.AddItem(pizzaVM, quantity); Session.SetJson("Cart", this); }
public virtual void RemoveLine(PizzaViewModel.PizzaViewModel pizza){ lineCollection.RemoveAll(l => l.PizzaVm.PizzaID == pizza.PizzaID); }