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(); } }
public void RemoveFromShoppingCart(Grocery grocery) { Groceries.Groceries.Remove(grocery); }