public void Delete(MissionDTO mission) { IWindowManager manager = new WindowManager(); DeleteConfirmationViewModel modify = new DeleteConfirmationViewModel(); bool?showDialogResult = manager.ShowDialog(modify, null, null); if (showDialogResult != null && showDialogResult == true) { mission.InformObservers(); MissionService.Delete(mission); } Reload(); }
public ActionResult DeleteMission(int id) { string message; if (id > 0) { message = MissionService.Delete(id, User.Identity.Name); if (String.IsNullOrEmpty(message)) { TempData["Error"] = Messages.Deleted; return(RedirectToAction("Index")); } else { ViewData["Warning"] = message; } } else { ViewData["Warning"] = Messages.InvalidField; } return(View()); }
public IActionResult Delete(int id) { _missionService.Delete(_missionService.Finds(id)); return(RedirectToAction("Index", "mission")); }