示例#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;
            }
        }
 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);
 }