public ServiceResult<Professional> GetProfessionalById(int professionalId)
        {
            var getProfessional = _repository.GetProfessionalById(professionalId);

            return new ServiceResult<Professional>
            {
                Success = true,
                Errors = new[] { string.Empty },
                Result = getProfessional
            };
        }
Example #2
0
        private void AssignmentMail(AssignService assignService)
        {
            if (assignService.AssignServiceId > 0)
            {
                if (assignService.ProfessionalId > 0)
                {
                    var professional         = _professionalRepository.GetProfessionalById(assignService.ProfessionalId);
                    var service              = _serviceRepository.GetServiceById(assignService.ServiceId);
                    var patient              = _patientRepository.GetPatientById(assignService.PatientId);
                    var professionalFullName = $" {professional.FirstName} {professional.SecondName} {professional.Surname} {professional.SecondSurname} ";
                    var patientFullName      = $"{patient.FirstName} {patient.SecondName} {patient.Surname} {patient.SecondSurname} ";
                    var copaymentFrecuency   = _copaymentFrecuencyRepository.GetCoPaymentFrecuencyById(assignService.CoPaymentFrecuencyId);
                    var serviceFrecuency     = _serviceFrecuencyRepository.GetServiceFrecuencyById(assignService.ServiceFrecuencyId);

                    var body = string.Format(AdomMailContent.AssignServiceMailText,
                                             professionalFullName,
                                             patient.Document,
                                             patientFullName,
                                             patient.Address,
                                             patient.Telephone1,
                                             assignService.AuthorizationNumber,
                                             service.Name,
                                             assignService.InitialDate,
                                             assignService.FinalDate,
                                             serviceFrecuency.Name,
                                             assignService.CoPaymentAmount,
                                             copaymentFrecuency.Name);

                    var mailMessage = new MailMessage
                    {
                        Body    = body,
                        Subject = "Nuevo servicio asignado – ADOM",
                        To      = new MailAccount(professional.FirstName, professional.Email)
                    };
                    _mailService.SendMail(mailMessage);
                }
            }
        }
Example #3
0
 public async Task <ProfessionalViewModel> GetProfessionalById(Guid id)
 => _mapper.Map <ProfessionalViewModel>(await _repository.GetProfessionalById(id));