public ActionResult Delete(DestinationViewModel destViewModel) { try { if (ModelState.IsValid) { destViewModel.DeleteDestination(destViewModel); return(RedirectToAction("Index", "Destination")); } return(RedirectToAction("Index", "Destination")); } catch (Exception ex) { errorlogviewmodel = new ErrorLogViewModel(); errorlogviewmodel.LogError(ex); return(View("Error")); } }
private void DeleteDestinationButton_Click(object sender, RoutedEventArgs e) { var button = sender as Button; _viewModel.DeleteDestination((int)button.Tag); }