Esempio n. 1
0
        public IHttpActionResult ReturnTask(WorkflowStepInfo info)
        {
            var task = TaskWork.GetTaskBySN(info.SN);

            if (task == null || task.Status != TaskWorkStatus.UnFinish)
            {
                return(Ok());
            }

            var    entityId  = new Guid(info.EntityID);
            string projectId = string.Empty;

            switch (info.WorkflowName)
            {
            case FlowCode.Closure_ClosurePackage:
                var closurePackage = ClosurePackage.Get(entityId);
                projectId = closurePackage.ProjectId;
                break;

            case FlowCode.TempClosure_ClosurePackage:
                var tempClosurePackage = TempClosurePackage.Get(entityId);
                projectId = tempClosurePackage.ProjectId;
                break;

            case FlowCode.MajorLease_Package:
                var majorLeasePackage = MajorLeaseChangePackage.Get(entityId);
                projectId = majorLeasePackage.ProjectId;
                break;

            case FlowCode.Rebuild_Package:
                var rebuildPackage = RebuildPackage.Get(entityId);
                projectId = rebuildPackage.ProjectId;
                break;

            case FlowCode.Renewal_Package:
                var renewalPackage = RenewalPackage.Get(entityId);
                projectId = renewalPackage.ProjectId;
                break;

            case FlowCode.Reimage_Package:
                var reimagePackage = RenewalPackage.Get(entityId);
                projectId = reimagePackage.ProjectId;
                break;

            default:
                break;
            }
            if (!string.IsNullOrEmpty(projectId))
            {
                TaskWork.Finish(e => e.RefID == projectId && e.TypeCode == info.WorkflowName && e.Status == TaskWorkStatus.UnFinish && e.ActivityName != "Originator");
            }
            return(Ok());
        }