public string AddOrUpdateIngredientInFood(Food newFood)
        {
            FoodManager foodManager = new FoodManager();
            int foodID = foodManager.GetFoodIDByName(newFood.Name);
            string res = DeleteIngredientInFood(foodID);
            if (res != "")
                return res;
            if (newFood.GetIngredients() == null)
                return "";
            foreach (Ingredient igr in newFood.GetIngredients())
            {
                res = AddOrUpdateIngredientDetails(igr.GetIngredientDetails());
                if (res != "")
                    return res;
                try
                {
                    int ingredientDetailsID = GetIngredientDetailsID(igr.Name);

                    DAL.Ingredient newIgredient = new DAL.Ingredient();
                    newIgredient.ingredientDetailsID = ingredientDetailsID;
                    newIgredient.quantity = igr.Quantity;
                    Table<DAL.Ingredient> igrTable = GetIngredientsTable();
                    igrTable.InsertOnSubmit(newIgredient);
                    igrTable.Context.SubmitChanges();

                    DAL.IngredientsInFood newIgrInFood = new DAL.IngredientsInFood();
                    newIgrInFood.foodID = foodID;
                    newIgrInFood.ingredientID = newIgredient.ingredientID;
                    Table<DAL.IngredientsInFood> igrInFoodTable = GetIngredientsInFoodTable();
                    igrInFoodTable.InsertOnSubmit(newIgrInFood);
                    igrInFoodTable.Context.SubmitChanges();
                }
                catch (Exception ex)
                {
                    return ex.Message;
                }
            }
            return "";
        }
        public List<Ingredient> GetFoodIngredientList(string foodName)
        {
            FoodManager foodManager = new FoodManager();
            Table<DAL.Food> foodTable = foodManager.GetFoodTable();
            Table<DAL.IngredientsInFood> ingredientsInFoodTable = GetIngredientsInFoodTable();
            Table<DAL.Ingredient> ingredientTable = GetIngredientsTable();
            Table<DAL.IngredientDetail> ingredientDetailTable = GetIngredientDetailTable();

            var res = (from food in foodTable
                       join ingreInFood in ingredientsInFoodTable on food.foodID equals ingreInFood.foodID
                       join ingre in ingredientTable on ingreInFood.ingredientID equals ingre.ingredientID
                       join ingreDetails in ingredientDetailTable on ingre.ingredientDetailsID equals ingreDetails.ingredientDetailsID
                       where food.name == foodName
                       select new Ingredient
                       {
                           Name = ingreDetails.name,
                           Description = ingreDetails.description,
                           Quantity = ingre.quantity
                       });

            return res.ToList();
        }