public ActionResult Cancel(int id) { Visit visit = _repo.GetById(id); _visitManager.CancelVisit(visit); return(Json(new { status = true })); }
public ActionResult Cancel(int id) { Visit visit = _repo.GetById(id); try { _visitManager.CancelVisit(visit); return(Json(new { status = true })); } catch (ArgumentException ex) { return(Json(new { status = false, message = ex.Message })); } }