Exemple #1
0
        protected override void UpdateProjectCreateUser(ProjectTeamMembers projectTeamMembers)
        {
            var projectInfo = ProjectInfo.Search(i => i.ProjectId == this.ProjectId && i.FlowCode.Contains(FlowCode.Closure));

            foreach (var projectInfoItem in projectInfo)
            {
                switch (projectInfoItem.FlowCode)
                {
                case FlowCode.Closure:
                case FlowCode.Closure_LegalReview:
                case FlowCode.Closure_ExecutiveSummary:
                case FlowCode.Closure_ClosurePackage:
                case FlowCode.Closure_Memo:
                case FlowCode.Closure_ContractInfo:
                    projectInfoItem.CreateUserAccount = projectTeamMembers.AssetActor.UserAccount;
                    break;

                case FlowCode.Closure_WOCheckList:
                case FlowCode.Closure_ConsInvtChecking:
                    projectInfoItem.CreateUserAccount = projectTeamMembers.PM.UserAccount;
                    break;

                case FlowCode.Closure_ClosureTool:
                    projectInfoItem.CreateUserAccount = projectTeamMembers.Finance.UserAccount;
                    break;
                }
            }
            ProjectInfo.Update(projectInfo.ToArray());
        }
Exemple #2
0
        public override string Edit()
        {
            var taskWork = TaskWork.FirstOrDefault(e => e.ReceiverAccount == ClientCookie.UserCode && e.SourceCode == FlowCode.Closure && e.TypeCode == FlowCode.Closure_ExecutiveSummary && e.RefID == this.ProjectId);


            taskWork.Status         = TaskWorkStatus.UnFinish;
            taskWork.StatusNameZHCN = "任务";
            taskWork.StatusNameENUS = "任务";

            var closureEntity = ClosureInfo.GetByProjectId(this.ProjectId);

            taskWork.ReceiverAccount  = closureEntity.AssetActorAccount;
            taskWork.ReceiverNameENUS = closureEntity.AssetActorNameENUS;
            taskWork.ReceiverNameZHCN = closureEntity.AssetActorNameZHCN;
            taskWork.Id           = Guid.NewGuid();
            taskWork.CreateTime   = DateTime.Now;
            taskWork.Url          = TaskWork.BuildUrl(FlowCode.Closure_ExecutiveSummary, this.ProjectId, "");
            taskWork.ActivityName = NodeCode.Start;
            taskWork.ProcInstID   = null;
            taskWork.FinishTime   = null;
            taskWork.ActionName   = SetTaskActionName(ProjectId);
            TaskWork.Add(taskWork);

            this.IsHistory = true;

            this.Save();

            var objectCopy = new ObjectCopy();
            var newEntity  = objectCopy.AutoCopy(this);

            newEntity.Id         = Guid.NewGuid();
            newEntity.ProcInstID = 0;
            newEntity.IsHistory  = false;
            newEntity.Add();

            var projectEntity = ProjectInfo.Get(this.ProjectId, FlowCode.Closure_ExecutiveSummary);

            projectEntity.Status = ProjectStatus.UnFinish;

            ProjectInfo.Update(projectEntity);
            ProjectInfo.Reset(ProjectId, FlowCode.Closure_ExecutiveSummary);
            ProjectInfo.Reset(ProjectId, FlowCode.Closure);
            var attList = Attachment.Search(e => e.RefTableID == this.Id.ToString() && e.RefTableName == ClosureExecutiveSummary.TableName).AsNoTracking().ToList();

            var newList = new List <Attachment>();

            foreach (var att in attList)
            {
                var newAtt = objectCopy.AutoCopy(att);
                newAtt.RefTableID = newEntity.Id.ToString();
                newAtt.ID         = Guid.NewGuid();
                newList.Add(newAtt);
            }
            Attachment.Add(newList.ToArray());
            return(taskWork.Url);
        }
Exemple #3
0
        protected override void UpdateProjectCreateUser(ProjectTeamMembers projectTeamMembers)
        {
            var projectInfo = ProjectInfo.Search(i => i.ProjectId == this.ProjectId && i.FlowCode.Contains(FlowCode.TempClosure));

            foreach (var projectInfoItem in projectInfo)
            {
                switch (projectInfoItem.FlowCode)
                {
                case FlowCode.TempClosure:
                case FlowCode.TempClosure_LegalReview:
                case FlowCode.TempClosure_ClosurePackage:
                case FlowCode.TempClosure_ClosureMemo:
                case FlowCode.TempClosure_ReopenMemo:
                    projectInfoItem.CreateUserAccount = projectTeamMembers.AssetActor.UserAccount;
                    break;
                }
            }
            ProjectInfo.Update(projectInfo.ToArray());
        }
Exemple #4
0
        protected override void UpdateProjectTaskUser(TaskWork taskWork, ProjectTeamMembers projectTeamMembers)
        {
            var projectInfo = ProjectInfo.FirstOrDefault(e => e.FlowCode == taskWork.TypeCode &&
                                                         e.ProjectId == taskWork.RefID);

            if (projectInfo != null)
            {
                switch (taskWork.TypeCode)
                {
                case FlowCode.MajorLease_Package:
                case FlowCode.MajorLease_LegalReview:
                    if (projectTeamMembers.AssetActor != null)
                    {
                        taskWork.ReceiverAccount  = projectTeamMembers.AssetActor.UserAccount;
                        taskWork.ReceiverNameENUS = projectTeamMembers.AssetActor.UserNameENUS;
                        taskWork.ReceiverNameZHCN = projectTeamMembers.AssetActor.UserNameZHCN;

                        projectInfo.CreateUserAccount = projectTeamMembers.AssetActor.UserAccount;
                    }
                    break;

                case FlowCode.MajorLease_FinanceAnalysis:
                    taskWork.ReceiverAccount  = projectTeamMembers.Finance.UserAccount;
                    taskWork.ReceiverNameENUS = projectTeamMembers.Finance.UserNameENUS;
                    taskWork.ReceiverNameZHCN = projectTeamMembers.Finance.UserNameZHCN;

                    projectInfo.CreateUserAccount = projectTeamMembers.Finance.UserAccount;
                    break;

                case FlowCode.MajorLease_ConsInvtChecking:
                case FlowCode.MajorLease_ConsInfo:
                    taskWork.ReceiverAccount  = projectTeamMembers.PM.UserAccount;
                    taskWork.ReceiverNameENUS = projectTeamMembers.PM.UserNameENUS;
                    taskWork.ReceiverNameZHCN = projectTeamMembers.PM.UserNameZHCN;

                    projectInfo.CreateUserAccount = projectTeamMembers.PM.UserAccount;
                    break;
                }

                ProjectInfo.Update(projectInfo);
            }
        }
Exemple #5
0
        public override string Edit()
        {
            //取消未处理完成的任务(主要是Package最后一个环节办理完后,不走K2流程生成的1条回到Actor的任务)
            var oldTask = TaskWork.Search(i => i.SourceCode == FlowCode.Closure && i.TypeCode == FlowCode.Closure_ClosurePackage && i.RefID == this.ProjectId && i.Status == TaskWorkStatus.UnFinish).ToArray();

            foreach (var taskItem in oldTask)
            {
                taskItem.Status = TaskWorkStatus.Cancel;
            }
            TaskWork.Update(oldTask);

            //var taskWork = TaskWork.FirstOrDefault(e => e.ReceiverAccount == ClientCookie.UserCode
            //            && e.SourceCode == FlowCode.Closure
            //            && e.TypeCode == FlowCode.Closure_ClosurePackage && e.RefID == this.ProjectId);


            //taskWork.Status = TaskWorkStatus.UnFinish;
            //taskWork.StatusNameZHCN = "任务";
            //taskWork.StatusNameENUS = "任务";

            //var closureEntity = ClosureInfo.GetByProjectId(this.ProjectId);
            //taskWork.ReceiverAccount = closureEntity.AssetActorAccount;
            //taskWork.ReceiverNameENUS = closureEntity.AssetActorNameENUS;
            //taskWork.ReceiverNameZHCN = closureEntity.AssetActorNameZHCN;
            //taskWork.Id = Guid.NewGuid();
            //taskWork.CreateTime = DateTime.Now;
            //taskWork.Url = TaskWork.BuildUrl(FlowCode.Closure_ClosurePackage, this.ProjectId, "");
            //taskWork.ActivityName = NodeCode.Start;
            //taskWork.ActionName = SetTaskActionName(ProjectId);
            //taskWork.ProcInstID = null;
            //taskWork.FinishTime = null;
            //TaskWork.Add(taskWork);
            var url = GeneratePackageTask(ProjectId);

            this.IsHistory = true;

            this.Save();

            var objectCopy = new ObjectCopy();
            var newEntity  = objectCopy.AutoCopy(this);

            newEntity.Id         = Guid.NewGuid();
            newEntity.ProcInstID = 0;
            newEntity.IsHistory  = false;
            newEntity.Add();

            var projectEntity = ProjectInfo.Get(this.ProjectId, FlowCode.Closure_ClosurePackage);

            projectEntity.Status = ProjectStatus.UnFinish;

            ProjectInfo.Update(projectEntity);
            ProjectInfo.Reset(ProjectId, FlowCode.Closure_ClosurePackage);
            ProjectInfo.Reset(ProjectId, FlowCode.Closure);
            var attList = Attachment.Search(e => e.RefTableID == this.Id.ToString() &&
                                            e.RefTableName == ClosurePackage.TableName).AsNoTracking().ToList();

            var newList = new List <Attachment>();

            foreach (var att in attList)
            {
                var newAtt = objectCopy.AutoCopy(att);
                newAtt.RefTableID = newEntity.Id.ToString();
                newAtt.ID         = Guid.NewGuid();
                newList.Add(newAtt);
            }
            Attachment.Add(newList.ToArray());
            return(url);
        }