Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
 public bool EqualKey(ShoppingListItem ItemToCompare)
 {
     //            return Symbol.Equals(ItemToCompare.Symbol);
     return(false); //muss noch angepasst werden.
 }