public ActionResult CreatePatient(CreatePatientViewModel model) { try { string returnUrl = Url.Action("Patient", "Patient", new { area = "PatientManagement" }); PatientViewModel response = _IPatientHandler.CreatePatient(model); PatientId = response.PatientId; return(JavaScript("window.location='" + returnUrl + "'")); } catch (ModelException ex) { return(Json(new { errors = ex.ModelErrors })); } }
public ActionResult CreatePatient(CreatePatientViewModel model) { try { string returnUrl = Url.Action("Patient", "Patient", new { area = "PatientManagement" }); PatientViewModel response = _IPatientHandler.CreatePatient(model); PatientId = response.PatientId; return(Json(new { ok = true, url = returnUrl })); } catch (ModelException ex) { return(Json(new { errors = ex.ModelErrors })); } }