Ejemplo n.º 1
0
 public Workflow(string companyId, string requestorId, string subject, string comment, WorkflowTypeEnum type) : this()
 {
     this.CompanyId             = companyId;
     this.WorkflowType          = type;
     this.WorkflowStatus        = WorkflowStatusEnum.Requested;
     this.WorkflowProcessStatus = WorkflowProcessStatusEnum.Pending;
     this.RequestorId           = requestorId;
     this.RequestTs             = DateTime.UtcNow;
     this.NextStep = 1;
     this.Comment  = comment;
     this.Subject  = subject;
 }
Ejemplo n.º 2
0
 public SessionWorkflow(string companyId, string requestorId, string subject, string comment, WorkflowTypeEnum type, string sessionId)
     : base(companyId, requestorId, subject, comment, type)
 {
     this.SessionId = sessionId;
 }
Ejemplo n.º 3
0
        public Workflow RequestApproval(string companyId, string requestorId, string subject, string comment, WorkflowTypeEnum type, string sessionId)
        {
            if (type == WorkflowTypeEnum.ExternalCourseTake)
            {
                Workflow            workflow = new SessionWorkflow(companyId, requestorId, subject, comment, type, sessionId);
                User                user     = unitOfWork.UserRepository.GetById(requestorId);
                ICreateWorkflowStep stepGen  = new ManagerWorkflowStep(user);
                foreach (var step in stepGen.Create(workflow.Id))
                {
                    workflow.WorkflowSteps.Add(step);
                }

                unitOfWork.WorkflowRepository.Insert(workflow);
                unitOfWork.SaveChanges();
                return(workflow);
            }

            return(null);
        }