예제 #1
0
        public void ExecuteProcess(string employeeCode, string sn, string actionName, string comment, List <ProcessDataField> dataField = null)
        {
            using (var scope = new TransactionScope())
            {
                Save(actionName);
                switch (actionName)
                {
                case ProjectAction.Return:
                case ProjectAction.Recall:
                    ProjectInfo.Reset(ProjectId, WorkflowCode, ProjectStatus.Finished);
                    break;

                case ProjectAction.Decline:
                    ProjectInfo.Reject(ProjectId, WorkflowCode, ProjectStatus.Finished);
                    break;

                default:
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.MajorLease_GBMemo_Input, ProjectStatus.Finished);
                    break;
                }
                //GBMemo alaways is finished
                scope.Complete();
            }
            K2FxContext.Current.ApprovalProcess(sn, employeeCode, actionName, comment, dataField);
        }
예제 #2
0
        public void ExecuteProcess(string employeeCode, string sn, string actionName, string comment, List <ProcessDataField> dataField = null)
        {
            using (var scope = new TransactionScope())
            {
                Save(actionName);
                switch (actionName)
                {
                case ProjectAction.Return:
                case ProjectAction.Recall:
                    ProjectInfo.Reset(ProjectId, WorkflowCode, GetProjectStatus(actionName));
                    break;

                case ProjectAction.Decline:
                    ProjectInfo.Reject(ProjectId, WorkflowCode);
                    break;

                case ProjectAction.Approve:
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.Rebuild_LegalReview_Confirm, GetProjectStatus(actionName));
                    break;

                default:
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.Rebuild_LegalReview_Input, GetProjectStatus(actionName));
                    break;
                }
                scope.Complete();
            }
            K2FxContext.Current.ApprovalProcess(sn, employeeCode, actionName, comment, dataField);
        }
예제 #3
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(this.ProjectId);

            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
            {
                ProjectProgress.SetProgress(ProjectId, "90%");
                var taskcontract = TaskWork.Search(e => e.RefID == ProjectId && e.TypeCode == FlowCode.Renewal_ContractInfo).FirstOrDefault();
                if (taskcontract == null)
                {
                    info.GenerateSubmitTask(FlowCode.Renewal_ContractInfo);
                }
                var taskSiteinfo = TaskWork.Search(e => e.RefID == ProjectId && e.TypeCode == FlowCode.Renewal_SiteInfo).FirstOrDefault();
                if (taskSiteinfo == null)
                {
                    info.GenerateSubmitTask(FlowCode.Renewal_SiteInfo);
                }

                ProjectInfo.CompleteMainIfEnable(ProjectId);
                ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.Renewal_Package_Approval);
            }
            break;

            case TaskWorkStatus.K2ProcessDeclined:
            {
                ProjectInfo.UpdateProjectStatus(ProjectId, FlowCode.Renewal, ProjectStatus.Rejected);
                ProjectInfo.Reject(ProjectId, FlowCode.Renewal_Package);
            }
            break;
            }
        }
예제 #4
0
        public void ExecuteProcess(string employeeCode, string sn, string actionName, string comment, List <ProcessDataField> dataField = null)
        {
            K2FxContext.Current.ApprovalProcess(sn, employeeCode, actionName, comment, dataField);

            using (var scope = new TransactionScope())
            {
                Save(actionName);
                switch (actionName)
                {
                case ProjectAction.Return:
                case ProjectAction.Recall:
                    ProjectInfo.Reset(ProjectId, WorkflowCode, GetProjectStatus(actionName));
                    break;

                case ProjectAction.Decline:
                    ProjectInfo.Reject(ProjectId, WorkflowCode);
                    break;

                case ProjectAction.ReSubmit:
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.MajorLease_FinanceAnalysis_Input, GetProjectStatus(actionName));
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.MajorLease_FinanceAnalysis_Upload, GetProjectStatus(actionName));
                    break;

                default:
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.MajorLease_FinanceAnalysis_Upload, GetProjectStatus(actionName));
                    break;
                }
                scope.Complete();
            }
        }
예제 #5
0
        public void Reject(string comment, string SerialNumber)
        {
            K2FxContext.Current.ApprovalProcess(SerialNumber, ClientCookie.UserCode, ProjectAction.Decline, comment);
            using (TransactionScope tranScope = new TransactionScope())
            {
                ProjectInfo.Reject(this.ProjectId, this.WorkflowCode);
                var SavedComment = ProjectComment.GetSavedComment(this.Id, this.TableName, ClientCookie.UserCode);
                if (SavedComment != null)
                {
                    SavedComment.Status     = ProjectCommentStatus.Submit;
                    SavedComment.Action     = ProjectCommentAction.Decline;
                    SavedComment.Content    = comment;
                    SavedComment.CreateTime = DateTime.Now;
                    SavedComment.Update();
                }
                else
                {
                    ProjectComment.AddComment(
                        ProjectCommentAction.Decline,
                        comment,
                        this.Id,
                        this.TableName,
                        FlowCode.TempClosure,
                        this.ProcInstId,
                        ProjectCommentStatus.Submit
                        );
                }

                tranScope.Complete();
            }
        }
예제 #6
0
 public void Reject(string comment, string SerialNumber)
 {
     K2FxContext.Current.ApprovalProcess(SerialNumber, ClientCookie.UserCode, "Reject", comment);
     using (TransactionScope tranScope = new TransactionScope())
     {
         ProjectInfo.Reject(this.ProjectId, this.WorkflowCode);
         ProjectComment.AddComment(
             ProjectCommentAction.Decline,
             comment,
             this.Id,
             this.TableName,
             FlowCode.Renewal,
             this.ProcInstId,
             ProjectCommentStatus.Submit
             );
         tranScope.Complete();
     }
 }
예제 #7
0
        public void ExecuteProcess(string employeeCode, string sn, string actionName, string comment, List <ProcessDataField> dataField = null)
        {
            using (var scope = new TransactionScope())
            {
                Save(actionName);
                switch (actionName)
                {
                case ProjectAction.ReSubmit:
                    ProjectInfo.FinishNode(ProjectId, FlowCode.Rebuild_ConsInvtChecking, NodeCode.Rebuild_ConsInvtChecking_Downlod);
                    ProjectInfo.FinishNode(ProjectId, FlowCode.Rebuild_ConsInvtChecking, NodeCode.Rebuild_ConsInvtChecking_Input);
                    ProjectInfo.FinishNode(ProjectId, FlowCode.Rebuild_ConsInvtChecking, NodeCode.Rebuild_ConsInvtChecking_Upload);
                    break;

                case ProjectAction.Return:
                case ProjectAction.Recall:
                    ProjectInfo.Reset(ProjectId, WorkflowCode, GetProjectStatus(actionName));
                    break;

                case ProjectAction.Decline:
                    ProjectInfo.Reject(ProjectId, WorkflowCode);
                    break;

                //case ProjectAction.Approve:
                //    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.Rebuild_ConsInvtChecking_Confirm, GetProjectStatus(actionName));
                //    break;
                default:
                    ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.Rebuild_ConsInvtChecking_Upload, GetProjectStatus(actionName));
                    break;
                }

                if (actionName == ProjectAction.Return)
                {
                    TaskWork.Finish(e => e.RefID == ProjectId &&
                                    e.TypeCode == WorkflowCode &&
                                    e.Status == TaskWorkStatus.UnFinish &&
                                    e.K2SN != sn);
                }
                scope.Complete();
            }
            K2FxContext.Current.ApprovalProcess(sn, employeeCode, actionName, comment);
        }