public void Delete_Bug()
 {
     Pages.Header.Logout();
     if (TestContext.CurrentTestOutcome == UnitTestOutcome.Passed)
     {
         Bug.Delete(bugSummary);
     }
 }
        public ActionResult Delete(int id, Bug bugModel)
        {
            var golfer = Bug.SingleOrDefault(id);

            if (ModelState.IsValid)
            {
                bugModel.BugId = id;
                bugModel.Delete();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult Result = MessageBox.Show("Are you sure you want to delete this bug?",
                                                      "Delete Bug", MessageBoxButton.YesNo);

            if (Result == MessageBoxResult.Yes)
            {
                if (MyBug.Delete())
                {
                    Data.Bugs.Remove(MyBugControl.MyBug);
                    MyBugControl.MyHomeWindow.UpdateBugList();

                    MessageBox.Show("Bug deleted successfully!", "Success",
                                    MessageBoxButton.OK, MessageBoxImage.Information);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("There was an error deleting this bug. Bug was not deleted", "Error",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }