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