public ActionResult PatientRegistration(Patient model) { if (_patientManager.Add(model)) { ViewBag.message = "Patient Added Sucessfully"; } return(View()); }
public IHttpActionResult Create([FromBody] Patient patient) { try { return(Content(HttpStatusCode.OK, _patientManager.Add(patient))); } catch (Exception ex) { return(Content(HttpStatusCode.InternalServerError, ex.Message)); } }
private void Save(object sender, EventArgs e) { if (areTextBoxesFilled()) { var patientId = patientManager.Add(CreatePatient()); addressManager.Add(CreateAddress(patientId)); emergencyContactManager.Add(CreateEmergencyContact(patientId)); consultationManager.Add(CreateConsultation(patientId)); MessageBox.Show("Patient data saved successfully"); this.Close(); } }