Example #1
0
        public virtual void AddItem(Bookstore book, int qty)
        {
            CartLine line = Lines
                            .Where(b => b.Bookstore.BookID == book.BookID)
                            .FirstOrDefault();

            if (line == null)
            {
                Lines.Add(new CartLine
                {
                    Bookstore = book,
                    Quantity  = qty
                });
            }
            else
            {
                line.Quantity += qty;
            }
        }
Example #2
0
 public virtual void RemoveLine(Bookstore book) =>
 Lines.RemoveAll(x => x.Bookstore.BookID == book.BookID);
Example #3
0
 public override void RemoveLine(Bookstore bookstore)
 {
     base.RemoveLine(bookstore);
     Session.SetJson("Cart", this);
 }
Example #4
0
 public override void AddItem(Bookstore bookstore, int quantity)
 {
     base.AddItem(bookstore, quantity);
     Session.SetJson("Cart", this);
 }