Beispiel #1
0
 public void ToShoppingCart(List <ShoppingCartDetails> details)
 {
     if (details.Count != 0)
     {
         foreach (var grocery in details)
         {
             Grocery newGrocery = new Grocery(grocery.Grocery.Name, Grocery.ParseEnum <Unit>(grocery.Grocery.Unit), Grocery.ParseEnum <Category>(grocery.Grocery.Category), grocery.Amount);
             Groceries.AddToList(newGrocery);
         }
     }
     else
     {
         Groceries = new AvailableGroceries();
     }
 }
Beispiel #2
0
 public void RemoveFromShoppingCart(Grocery grocery)
 {
     Groceries.Groceries.Remove(grocery);
 }