/// <summary>
 /// This method invokes method for deleting order.
 /// </summary>
 public void CancelRecipeExecute()
 {
     try
     {
         MessageBoxResult result = MessageBox.Show("Are you sure you want to cancel creating the recipe?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             bool isCanceled = recipes.DeleteRecipe(Recipe);
             if (isCanceled == true)
             {
                 MessageBox.Show("Creating recipe is canceled.", "Notification", MessageBoxButton.OK);
                 if (recipe.Author == "Administrator")
                 {
                     AdminView adminView = new AdminView();
                     addIngredients.Close();
                     adminView.ShowDialog();
                 }
                 else
                 {
                     UserView userView = new UserView(users.FindUser(recipe.UserId));
                     addIngredients.Close();
                     userView.ShowDialog();
                 }
             }
             else
             {
                 MessageBox.Show("Creating recipe cannot be canceled.", "Notification", MessageBoxButton.OK);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #2
0
 private void CloseExecute()
 {
     try
     {
         view.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Exception" + ex.Message.ToString());
     }
 }