void AddRecepieToGroceryList(Recepie rec) { if (rec == null) { return; } foreach (Ingredient ing in rec.Ingredients) { if (!inList.Contains(ing.Name)) { inList.Add(ing.Name); GroceryList.Add(new Ingredient(ing.Name, ing.Count, ing.Units)); } else { for (int k = 0; k < GroceryList.Count; k++) { if (GroceryList[k].Name == ing.Name) { GroceryList[k].SumIngredient(ing); k = GroceryList.Count; } } } } }
public static void GetItemDetails() { var product = new CartItem(); CreateProduct(product); SubTotal += product.Quantity * product.Price; ConsoleLogging.IsImported(product); ConsoleLogging.IsTaxable(product); GroceryList.Add(product); }