/// <summary> /// This method invokes method for adding ingredient to recipe. /// </summary> public void AddIngredientExecute() { if (String.IsNullOrEmpty(Ingredient.name) || String.IsNullOrEmpty(Ingredient.name.ToString()) || Ingredient.quantity == 0) { MessageBox.Show("Please fill all fields.", "Notification"); } else { try { service.AddIngredient(Ingredient); //invokes method to update a list of ingredients IngredientList = service.AllIngredientForRecipe(Recipe.recipeId); Ingredient = new tblIngredient(); Ingredient.recipeId = Recipe.recipeId; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } }