示例#1
0
 public IHttpActionResult Create([FromBody] EmergencyContact emergencyContact)
 {
     try
     {
         return(Content(HttpStatusCode.OK, _emergencyContactManager.Add(emergencyContact)));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
示例#2
0
 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();
     }
 }