public virtual void AddItem(Bowlers book, int quantity)
        {
            CartLine Line = Lines.Where(b => b.Book.BowlerID == book.BowlerID)
                            .FirstOrDefault();

            if (Line == null)
            {
                Lines.Add(new CartLine
                {
                    Book     = book,
                    Quantity = quantity
                });
            }
            else
            {
                Line.Quantity += quantity;
            }
        }
 public virtual void RemoveLine(Bowlers book) =>
 Lines.RemoveAll(x => x.Book.BowlerID == book.BowlerID);
Exemple #3
0
 public override void RemoveLine(Bowlers book)
 {
     base.RemoveLine(book);
     Session.SetJson("Cart", this);
 }
Exemple #4
0
 public override void AddItem(Bowlers book, int quantity)
 {
     base.AddItem(book, quantity);
     Session.SetJson("Cart", this);
 }