public virtual void AddItem(Cocktail cocktail, int quantity) { CartLine line = lineCollection .Where(p => p.Cocktail.CocktailID == cocktail.CocktailID) .FirstOrDefault(); if (line == null) { lineCollection.Add(new CartLine { Cocktail = cocktail, Quantity = quantity }); } else { line.Quantity += quantity; } }
public void PlaceOrder(Cocktail order) { orderQueue.Enqueue(order); }
public virtual void RemoveLine(Cocktail cocktail) => lineCollection.RemoveAll(l => l.Cocktail.CocktailID == cocktail.CocktailID);
public override void RemoveLine(Cocktail cocktail) { base.RemoveLine(cocktail); Session.SetJson("Cart", this); }
public override void AddItem(Cocktail cocktail, int quantity) { base.AddItem(cocktail, quantity);; Session.SetJson("Cart", this); }