Ejemplo n.º 1
0
 public void AddBook(V_Book b, int quantity)
 {
     CartLine line = lineCollection.Where(p => p.Book.BookID == b.BookID).FirstOrDefault();
     if (line == null)
     {
         lineCollection.Add(new CartLine(b, quantity));
     }
     else
     {
         line.Quantity += quantity;
     }
 }
Ejemplo n.º 2
0
 public void UpdateQuantity(V_Book b, int quantity)
 {
     CartLine line = lineCollection.Where(p => p.Book.BookID == b.BookID).FirstOrDefault();
     if (line == null)
     {
     }
     else
     {
         line.Quantity = quantity;
     }
     if (line.Quantity == 0)
     {
         lineCollection.Remove(line);
     }
 }
Ejemplo n.º 3
0
 public CartLine(V_Book b, int quantity)
 {
     this.Book = b;
     this.Quantity = quantity;
 }