public void TransferToShoppingList(ShoppingListItemSet ShoppingListItems) { ShoppingListItem newItem; double quantityFactor; foreach (FoodPlanItem ListItem in this) { quantityFactor = ListItem.TotalPortions / ListItem.PlannedRecipe.PortionQuantity; foreach (RecipeIngredient RecipeIngredient in ListItem.PlannedRecipe.Ingredients) { newItem = new ShoppingListItem(); newItem.Quantity = quantityFactor * RecipeIngredient.Quantity; newItem.Unit = RecipeIngredient.Unit; newItem.Ingredient = RecipeIngredient.Ingredient; newItem.ReferredFoodPlanItem = ListItem; ShoppingListItems.AddItem(newItem); } } }
public bool EqualKey(ShoppingListItem ItemToCompare) { // return Symbol.Equals(ItemToCompare.Symbol); return(false); //muss noch angepasst werden. }