private void AddIngredientsExecute()
 {
     try
     {
         AddIngredientsView ingredientsView = new AddIngredientsView(Recipe);
         ingredientsView.ShowDialog();
         if ((ingredientsView.DataContext as AddIngredientsViewModel).IngredientsAdded == true)
         {
             hasIngredients = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Exception" + ex.Message.ToString());
     }
 }
 private void AddIngredientsExecute()
 {
     if (String.IsNullOrEmpty(Recipe.RecipeName) || String.IsNullOrEmpty(Recipe.Type) || String.IsNullOrEmpty(Recipe.NumberOfPersons.ToString()) ||
         Recipe.NumberOfPersons == 0 || String.IsNullOrEmpty(Recipe.Description))
     {
         MessageBox.Show("Please fill all fields.", "Notification");
     }
     else
     {
         try
         {
             recipes.CreateRecipe(Recipe, out int id);
             Recipe.RecipeId = id;
             AddIngredientsView addIngredients = new AddIngredientsView(Recipe);
             addRecipe.Close();
             addIngredients.ShowDialog();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }