/// <summary> /// Method for adding new Recipe /// </summary> private void SaveExecute() { try { //if() AddIngredientToRecipeViewModel.IngrediantAmountListCount = 0; allRecipesWindow.filteredRecipes = new List <tblRecipe>(); AllRecipesWindow.filteredList = new List <tblRecipe>(); allRecipesWindow.DataGridOrder.ItemsSource = new List <tblRecipe>(); addRecipe.Close(); } catch (Exception ex) { Xceed.Wpf.Toolkit.MessageBox.Show(ex.ToString()); } }
private void SaveExecute() { try { recipe.type = selectedType; service.AddRecipe(recipe); tblRecipe addedRecipe = service.AddRecipe(recipe); MessageBox.Show("Recipe has been added. Add ingredients for this recipe"); addRecipe.Close(); AddIngredients addIngredients = new AddIngredients(addedRecipe); addIngredients.ShowDialog(); isUpdated = true; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }