public ActionResult DeleteCall(string id) { Guid callIdGuid; if (!Guid.TryParse(id, out callIdGuid)) { return(RedirectToAction("Index", "Home")); } var call = _callRepository.GetCallInfoById(callIdGuid); if (call == null) { return(RedirectToAction("Index", "Home")); } var model = new DeleteCallViewModel() { CallId = callIdGuid, CallFromSipAddress = call.FromSipAddress, CallToSipAddress = call.ToSipAddress, CallStarted = call.Started.ToLocalTime() }; return(View(model)); }
public ActionResult DeleteCall(DeleteCallViewModel model) { if (model.CallId != Guid.Empty && model.IHaveChecked && model.ImSure) { _callRepository.CloseCall(model.CallId); } return(RedirectToAction("Index", "Home")); }