public async Task <IActionResult> Put([FromForm] MedicalExaminationView medicalExaminationView) { try { if (!ModelState.IsValid) { return(BadRequest("Invalid data.")); } if (medicalExaminationView == null) { return(BadRequest("medicalExaminationView is null")); } await _uploadFileAndSavePath.UloadFile(medicalExaminationView); if (_medicalExaminationRepository.UpdateFull(medicalExaminationView.ViewToEntity())) { return(Ok()); } return(NotFound()); } catch (Exception) { return(BadRequest()); } }
public async Task <IActionResult> Post([FromForm] PatientView patient) { try { if (patient == null) { return(BadRequest("Owner object is null")); } if (!ModelState.IsValid) { return(BadRequest("Invalid model object")); } await _uploadFileAndSavePath.UloadFile(patient); _patientRepository.InsertWithDefaultGeneralInformation(patient.ViewToEntity()); return(Ok()); } catch (Exception ex) { return(StatusCode(500, "Internal server error" + ex.Message)); } }
public async Task <IActionResult> Put([FromForm] InjuriesDiseasesView injuriesDiseasesView) { try { if (!ModelState.IsValid) { return(BadRequest("Invalid data.")); } await _uploadFileAndSavePath.UloadFile(injuriesDiseasesView); if (_injuriesDiseasesRepository.UpdateFull(injuriesDiseasesView.ViewToEntity())) { return(Ok()); } return(NotFound()); } catch { return(BadRequest()); } }