private void ReassignProfessionalMail(AssignServiceDetail assignServiceDetail, int detailCount) { var result = _assignServiceDomainService.GetAssignServiceById(assignServiceDetail.AssignServiceId); var assingService = result.Result; if (assingService == null) { return; } var patientResult = _patientDomainService.GetPatientById(assingService.PatientId); var serviceResult = _serviceDomainService.GetServiceById(assingService.ServiceId); var service = serviceResult.Result; var patient = patientResult.Result; var professionalResult = _professionalDomainService.GetProfessionalById(assignServiceDetail.ProfessionalId); var professional = professionalResult.Result; var professionalFullName = $"{professional.FirstName} {professional.SecondName} {professional.Surname} {professional.SecondSurname}"; var patientFullName = $"{patient.FirstName} {patient.SecondName} {patient.Surname} {patient.SecondSurname}"; var mailMessage = new MailMessage { Body = string.Format(AdomMailContent.ProfessionalReasigmentMail, professionalFullName, patient.Document, patientFullName, service.Name, detailCount), Subject = "Cambios en tus servicios - ADOM", To = new MailAccount(professional.FirstName, professional.Email) }; _mailService.SendMail(mailMessage); }
public ServiceResult <AssignService> GetAssignServiceById(int AssignServiceId) { return(service.GetAssignServiceById(AssignServiceId)); }