public ActionResult Save(PatientModel patientModel) { try { Patient patient = _document.SavePatient(Mappings.MapPatient(patientModel)); if (patient != null) { //PatientModel model = Mappings.MapPatient(patient); //return View("Patient", model); Session["PatientID"] = patient.PatientId; } return(RedirectToAction("Patient", "Patient", new { usertype = (int)Session["UserTypeID"] })); } catch (Exception ex) { return(View()); } }
public HttpResponseMessage SavePatient([FromBody] Patient value) { try { bool saved = _document.SavePatient(value); if (saved) { return(Request.CreateResponse(HttpStatusCode.OK, CommonUnit.oSuccess)); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest, CommonUnit.oFailed)); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }