コード例 #1
0
        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 }));
            }
        }
コード例 #2
0
        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 }));
            }
        }