public UpdateRecipeViewModel(UpdateRecipeView updateViewOpen, tblRecipe recipe, tblUser user) { updateView = updateViewOpen; Recipe = recipe; RecipeTypes = GetRecipeTypes(); User = user; EmptyTxtFile(); }
private void UpdateRecipeExecute() { if (User.UserID == Recipe.UserID || User.UserName == "Admin") { UpdateRecipeView view = new UpdateRecipeView(Recipe, User); view.ShowDialog(); AllRecipes = GetAllRecipes(); } else { MessageBox.Show("You can not Update Recipe that you did not create"); } }
private void UpdateRecipeExecute() { try { using (CookbookDatabaseEntities1 context = new CookbookDatabaseEntities1()) { tblRecipe recipeToUpdate = ConvertTotblRepcipe(Recipe); UpdateRecipeView recipeView = new UpdateRecipeView(recipeToUpdate, User); recipeView.ShowDialog(); RecipeList = recipeService.GetAllvwRecipes(); } } catch (Exception ex) { MessageBox.Show("Exception" + ex.Message.ToString()); } }
public UpdateRecipeViewModel(UpdateRecipeView urv, tblRecipe rec, tblPerson personLogedIn) { view = urv; Recipe = rec; User = personLogedIn; }