public virtual void AddItem(BLP proj, int qty) { CartLine line = Lines .Where(p => p.Project.BookId == proj.BookId) .FirstOrDefault(); if (line == null) { Lines.Add(new CartLine { Project = proj, Quantity = qty }); } else { line.Quantity += qty; } }
public virtual void RemoveLine(BLP proj) => Lines.RemoveAll(x => x.Project.BookId == proj.BookId);
public override void RemoveLine(BLP bLP) { base.RemoveLine(bLP); Session.SetJson("Cart", this); }
public override void AddItem(BLP bLP, int quantity) { base.AddItem(bLP, quantity); Session.SetJson("Cart", this); }