Beispiel #1
0
        public static void AddNewNutrition(NutritionData item, string typeString)
        {
            TypeFood type = (TypeFood)Enum.Parse(typeof(TypeFood), typeString);

            switch (type)
            {
            case TypeFood.Meat: meat.AddNewNutrution(item);
                break;

            case TypeFood.Fruit: fruit.AddNewNutrution(item);
                break;

            case TypeFood.Nuts: nuts.AddNewNutrution(item);
                break;

            case TypeFood.Vegetables: vegetables.AddNewNutrution(item);
                break;

            case TypeFood.Fish: fish.AddNewNutrution(item);
                break;

            case TypeFood.Cereals: cereals.AddNewNutrution(item);
                break;

            case TypeFood.Bread: bread.AddNewNutrution(item);
                break;

            case TypeFood.Alchohol: alchohol.AddNewNutrution(item);
                break;

            case TypeFood.SoftDrinks: softDrinks.AddNewNutrution(item);
                break;
            }
        }