public override ExecutionResult Run(IStepExecutionContext context) { AuditWorkflowData auditWorkflowData = _auditRepository.GetOneByWorkflowId(context.Workflow.Id); auditWorkflowData.AuditStateID = _auditStateRepository.GetOneByCode("PRZ"); auditWorkflowData.ApprovePlanComments = ApprovePlanComments; _auditRepository.ApproveOrRejectAuditPlan(auditWorkflowData); List <string> sectorPlantReferrents = _sectorPlantRepository.GetSectorPlantReferredEmail(auditWorkflowData.PlantID, auditWorkflowData.SectorID); EmailAddresses.AddRange(_userWorkflowRepository.GetUsersEmailResponsibleSGC()); ////If auditor is internal, send email if (!string.IsNullOrEmpty(auditWorkflowData.AuditorID)) { EmailAddresses.Add(_auditRepository.GetAuditorEmail(auditWorkflowData.AuditorID)); } //Left responsible of SGC auditWorkflowData = _auditRepository.GetOneByWorkflowId(auditWorkflowData.WorkflowId); var emailType = "rejectplan"; this.EmailSubject = EmailStrings.GetSubjectAudit(auditWorkflowData.AuditTypeName, emailType); this.EmailMessage = EmailStrings.GetMessageAudit(auditWorkflowData, _emailSettings.Url, emailType); return(ExecutionResult.Next()); }