示例#1
0
 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; }
 }
示例#2
0
 public override void RemoveLine(PizzaViewModel.PizzaViewModel pizzaVM)
 {
     base.RemoveLine(pizzaVM);
     Session.SetJson("Cart", this);
 }
示例#3
0
 public override void AddItem(PizzaViewModel.PizzaViewModel pizzaVM, int quantity)
 {
     base.AddItem(pizzaVM, quantity);
     Session.SetJson("Cart", this);
 }
示例#4
0
 public virtual void RemoveLine(PizzaViewModel.PizzaViewModel pizza){
     lineCollection.RemoveAll(l => l.PizzaVm.PizzaID == pizza.PizzaID);
 }