Beispiel #1
0
        public override ApproveDialogUser GetApproveDialogUser()
        {
            var approvers = ApproveDialogUser.FirstOrDefault(e => e.RefTableID == Id.ToString());

            if (approvers == null)
            {
                approvers = new ApproveDialogUser();
                var majorLeaesInfo = MajorLeaseInfo.FirstOrDefault(e => e.ProjectId == ProjectId);
                if (majorLeaesInfo != null)
                {
                    approvers.ConstructionManagerCode = majorLeaesInfo.CMAccount;
                }
            }
            return(approvers);
        }
Beispiel #2
0
        protected override void ChangeProjectApprover(List <TaskWork> taskWorks, ProjectTeamMembers projectTeamMembers)
        {
            foreach (var taskWork in taskWorks)
            {
                var work = taskWork;
                var approveDialogUser =
                    ApproveDialogUser.FirstOrDefault(
                        e => e.RefTableID == work.RefTableId.ToString() && e.FlowCode == work.TypeCode);

                List <ProcessDataField> dataFields = null;
                switch (taskWork.TypeCode)
                {
                case FlowCode.MajorLease_LegalReview:
                    var legalReview = new MajorLeaseLegalReview();
                    legalReview.AppUsers = new ApproveUsers()
                    {
                        Legal = new SimpleEmployee()
                        {
                            Code     = projectTeamMembers.Legal.UserAccount,
                            NameENUS = projectTeamMembers.Legal.UserNameENUS,
                            NameZHCN = projectTeamMembers.Legal.UserNameZHCN
                        }
                    };

                    dataFields = legalReview.SetWorkflowDataFields(null);

                    if (projectTeamMembers.Legal.UserAccount != LegalAccount &&
                        taskWork.ReceiverAccount == LegalAccount)
                    {
                        RedirectWorkflowTask(taskWork.K2SN, taskWork.ReceiverAccount, projectTeamMembers.Legal.UserAccount,
                                             dataFields);

                        taskWork.ReceiverAccount  = projectTeamMembers.Legal.UserAccount;
                        taskWork.ReceiverNameENUS = projectTeamMembers.Legal.UserNameENUS;
                        taskWork.ReceiverNameZHCN = projectTeamMembers.Legal.UserNameZHCN;
                    }
                    else
                    {
                        if (taskWork.ProcInstID.HasValue)
                        {
                            UpdateWorkflowDataField(taskWork.ProcInstID.Value, dataFields);
                        }
                    }
                    if (approveDialogUser != null)
                    {
                        approveDialogUser.LegalCode = projectTeamMembers.Legal.UserAccount;
                        ApproveDialogUser.Update(approveDialogUser);
                    }
                    break;
                }
            }

            LegalAccount  = projectTeamMembers.Legal.UserAccount;
            LegalNameENUS = projectTeamMembers.Legal.UserNameENUS;
            LegalNameZHCN = projectTeamMembers.Legal.UserNameZHCN;

            if (projectTeamMembers.AssetActor != null)
            {
                AssetActorAccount  = projectTeamMembers.AssetActor.UserAccount;
                AssetActorNameENUS = projectTeamMembers.AssetActor.UserNameENUS;
                AssetActorNameZHCN = projectTeamMembers.AssetActor.UserNameZHCN;
            }

            AssetRepAccount  = projectTeamMembers.AssetRep.UserAccount;
            AssetRepNameENUS = projectTeamMembers.AssetRep.UserNameENUS;
            AssetRepNameZHCN = projectTeamMembers.AssetRep.UserNameZHCN;

            FinanceAccount  = projectTeamMembers.Finance.UserAccount;
            FinanceNameENUS = projectTeamMembers.Finance.UserNameENUS;
            FinanceNameZHCN = projectTeamMembers.Finance.UserNameZHCN;

            PMAccount  = projectTeamMembers.PM.UserAccount;
            PMNameENUS = projectTeamMembers.PM.UserNameENUS;
            PMNameZHCN = projectTeamMembers.PM.UserNameZHCN;

            Update(this);
        }