Ejemplo n.º 1
0
        [HttpPost]      // POST /api/medicalRecord
        public IActionResult RegisterPatient(MedicalRecordDto dto)
        {
            MedicalRecordValidation medicalRecordValidation = new MedicalRecordValidation();

            if (!medicalRecordValidation.ValidateMedicalRecord(dto))
            {
                return(BadRequest("The data which were entered are incorrect!"));
            }
            App.Instance().MedicalRecordService.CreatePatientMedicalRecord(new MailAddress(dto.Patient.EMail), MedicalRecordMapper.MedicalRecordDtoToMedicalRecord(dto));
            App.Instance().MedicalRecordService.WritePatientProfilePictureInFile(dto.Patient.Username, dto.ProfilePicture);
            return(Ok(200));
        }
Ejemplo n.º 2
0
        public override bool IsValid()
        {
            ValidationResult = new MedicalRecordValidation().Validate(this);

            return(ValidationResult.IsValid);
        }