public IHttpActionResult Create([FromBody] EmergencyContact emergencyContact) { try { return(Content(HttpStatusCode.OK, _emergencyContactManager.Add(emergencyContact))); } 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(); } }