protected async override Task <Email> ProcessEmail(string workflowTaskId, string projectId, string comments, string recipient, string user, string pageUrl)
        {
            Email email;

            if (workflowTaskId == Constants.CloseProjectTaskId.ToString())
            {
                email = new RejectCloseProjectEmail();
            }
            else if (workflowTaskId == Constants.ArchiveProject.ToString())
            {
                email = new RejectArchiveProjectEmail();
            }
            else
            {
                email = new RejectProjectWorkflowEmail();
            }

            await email.SetEmailPeople(_ampRepository, _personService, user, recipient, projectId);

            email.SetSROText();
            email.Subject = String.Format(email.Subject, projectId, _ampRepository.GetProject(projectId).Title);
            email.AMPlink = String.Format(email.AMPlink, AMPUtilities.BaseUrl(), projectId, workflowTaskId);
            email.Body    = String.Format(email.Body, email.Recipient.Forename, email.Sender.Forename, email.AMPlink, email.sroText);

            return(email);
        }
        protected override async Task <Email> ProcessEmail(string workflowTaskId, string projectId, string comments,
                                                           string recipient, string user, string pageUrl)
        {
            Email email = new HoDAlertEmail();

            //Get the HoD alert List

            //Decide who gets the e-mail and who is on the cc list.
            await email.SetHoDAlertPeople(_ampRepository, _personService, user, projectId);

            //Get the project approved budget.

            email.SetSROText();
            email.AMPlink = email.AMPlink = String.Format(email.AMPlink, AMPUtilities.BaseUrl(), projectId, workflowTaskId);
            email.Subject = String.Format(email.Subject, projectId, _ampRepository.GetProject(projectId).Title);
            email.Body    = String.Format(email.Body, email.Recipient.Forename, email.Sender.Forename + ' ' + email.Sender.Surname, email.AMPlink, email.sroText);

            return(email);
        }
コード例 #3
0
        protected async override Task <Email> ProcessEmail(string workflowTaskId, string projectId, string comments, string recipient, string user, string pageUrl)
        {
            Email email;

            //switch (workflowTaskId)
            //{
            //    case Constants.WorkflowTaskId.ApproveProject:

            //    default:
            //}

            if (workflowTaskId == Constants.ArchiveProject.ToString())
            {
                email = new RequestArchiveEmail();
            }
            else if (workflowTaskId == Constants.ApproveProjectTask.ToString())
            {
                email = new RequestApprovalEmail();
            }
            else if (workflowTaskId == Constants.ReApproveProjectTaskId.ToString())
            {
                email = new RequestReApprovalEmail();
            }
            else if (workflowTaskId == Constants.PlannedEndDate.ToString())
            {
                email = new RequestPlannedEndDateEmail();
            }
            else if (workflowTaskId == Constants.ApproveAD.ToString())
            {
                email = new RequestAandDApprovalEmail();
            }
            else if (workflowTaskId == Constants.FastTrack.ToString())
            {
                email = new RequestFastTrackApprovalEmail();
            }
            else if (workflowTaskId == Constants.CloseProjectTaskId.ToString())
            {
                email = new RequestCloseProjectEmail();
            }
            else if (workflowTaskId == Constants.CancelWorkflow.ToString())
            {
                email = new RequestCancelEmail();
            }
            else if (workflowTaskId == Constants.ReOpenProject.ToString())
            {
                email = new RequestReOpenProjectEmail();
            }
            else
            {
                return(null);
            }

            await email.SetEmailPeople(_ampRepository, _personService, user, recipient, projectId);

            email.SetSROText();
            email.AMPlink = String.Format(email.AMPlink, AMPUtilities.BaseUrl(), projectId, workflowTaskId);
            email.Subject = String.Format(email.Subject, projectId, _ampRepository.GetProject(projectId).Title);
            email.Body    = String.Format(email.Body, email.Recipient.Forename, email.Sender.Forename, comments, email.AMPlink, email.sroText);

            return(email);
        }