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");
     }
 }
예제 #3
0
 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());
     }
 }
예제 #4
0
 public UpdateRecipeViewModel(UpdateRecipeView urv, tblRecipe rec, tblPerson personLogedIn)
 {
     view   = urv;
     Recipe = rec;
     User   = personLogedIn;
 }