Exemple #1
0
        /// <summary>
        /// Used to add recipe id to meal id in Meal_Recipes table.
        /// Can be called in a loop to handle a list of recipes since
        /// It would be hard to make an array datatype for the database.
        /// It is should only be called <strong>AFTER</strong>
        /// <i>MealNameExists</i> because a valid mealId will be passed back.
        /// </summary>
        /// <param name="mealId"> Integer that is a valid meal</param>
        /// <param name="recipeName"> Name of recipe, which is assumed ot be valid since
        ///                         this is only called after MealNameExists</param>
        ///
        /// <returns>An integer from the query execution, the Mealid having operations done with</returns>
        private int PutRecipesWithMeal(int mealId, string recipeName)
        {
            if (recipeName == null)
            {
                return(-1);
            }
            SpeedyChefDataContext scdc = new SpeedyChefDataContext();
            int result;

            result = scdc.AddRecipeToMeal(mealId, recipeName);
            return(result);
        }
 /// <summary>
 /// Used to add recipe id to meal id in Meal_Recipes table.
 /// Can be called in a loop to handle a list of recipes since 
 /// It would be hard to make an array datatype for the database.
 /// It is should only be called <strong>AFTER</strong> 
 /// <i>MealNameExists</i> because a valid mealId will be passed back.
 /// </summary>
 /// <param name="mealId"> Integer that is a valid meal</param>
 /// <param name="recipeName"> Name of recipe, which is assumed ot be valid since 
 ///                         this is only called after MealNameExists</param>
 /// 
 /// <returns>An integer from the query execution, the Mealid having operations done with</returns>
 private int PutRecipesWithMeal(int mealId, string recipeName)
 {
     if (recipeName == null)
     {
         return -1;
     }
     SpeedyChefDataContext scdc = new SpeedyChefDataContext();
     int result;
     result = scdc.AddRecipeToMeal(mealId, recipeName);
     return result;
 }