예제 #1
0
        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;
            }
        }
예제 #2
0
 public void PlaceOrder(Cocktail order)
 {
     orderQueue.Enqueue(order);
 }
예제 #3
0
 public virtual void RemoveLine(Cocktail cocktail) =>
 lineCollection.RemoveAll(l => l.Cocktail.CocktailID == cocktail.CocktailID);
예제 #4
0
 public override void RemoveLine(Cocktail cocktail)
 {
     base.RemoveLine(cocktail);
     Session.SetJson("Cart", this);
 }
예제 #5
0
 public override void AddItem(Cocktail cocktail, int quantity)
 {
     base.AddItem(cocktail, quantity);;
     Session.SetJson("Cart", this);
 }