Beispiel #1
0
        protected override void UpdateProjectTaskUser(TaskWork taskWork, DataModels.ProjectTeamMembers projectTeamMembers)
        {
            switch (taskWork.TypeCode)
            {
            case FlowCode.Renewal_Letter:
            case FlowCode.Renewal_LLNegotiation:
            case FlowCode.Renewal_Analysis:
            case FlowCode.Renewal_ClearanceReport:
            case FlowCode.Renewal_ConfirmLetter:
            case FlowCode.Renewal_LegalApproval:
            case FlowCode.Renewal_Package:
            case FlowCode.Renewal_ContractInfo:
                taskWork.ReceiverAccount  = projectTeamMembers.AssetActor.UserAccount;
                taskWork.ReceiverNameENUS = projectTeamMembers.AssetActor.UserNameENUS;
                taskWork.ReceiverNameZHCN = projectTeamMembers.AssetActor.UserNameZHCN;
                break;

            case FlowCode.Renewal_ConsInfo:
            case FlowCode.Renewal_SiteInfo:
                taskWork.ReceiverAccount  = projectTeamMembers.PM.UserAccount;
                taskWork.ReceiverNameENUS = projectTeamMembers.PM.UserNameENUS;
                taskWork.ReceiverNameZHCN = projectTeamMembers.PM.UserNameZHCN;
                break;

            case FlowCode.Renewal_Tool:
                taskWork.ReceiverAccount  = projectTeamMembers.Finance.UserAccount;
                taskWork.ReceiverNameENUS = projectTeamMembers.Finance.UserNameENUS;
                taskWork.ReceiverNameZHCN = projectTeamMembers.Finance.UserNameZHCN;
                break;
            }
        }
Beispiel #2
0
        protected override void ChangeProjectApprover(List <TaskWork> taskWorks, DataModels.ProjectTeamMembers projectTeamMembers)
        {
            foreach (var taskWork in taskWorks)
            {
                List <ProcessDataField> dataFields = null;
                switch (taskWork.TypeCode)
                {
                case FlowCode.Renewal_Tool:
                    dataFields = new List <ProcessDataField>
                    {
                        new ProcessDataField("dest_AssetActor", projectTeamMembers.AssetActor.UserAccount)
                    };
                    if (projectTeamMembers.Legal.UserAccount != AssetActorAccount &&
                        taskWork.ReceiverAccount == AssetActorAccount)
                    {
                        RedirectWorkflowTask(taskWork.K2SN, taskWork.ReceiverAccount, projectTeamMembers.AssetActor.UserAccount, dataFields);

                        taskWork.ReceiverAccount  = projectTeamMembers.AssetActor.UserAccount;
                        taskWork.ReceiverNameENUS = projectTeamMembers.AssetActor.UserNameENUS;
                        taskWork.ReceiverNameZHCN = projectTeamMembers.AssetActor.UserNameZHCN;
                    }
                    else
                    {
                        if (taskWork.ProcInstID.HasValue)
                        {
                            UpdateWorkflowDataField(taskWork.ProcInstID.Value, dataFields);
                        }
                    }
                    break;

                case FlowCode.Renewal_LegalApproval:
                    dataFields = new List <ProcessDataField>()
                    {
                        new ProcessDataField("dest_LegalUser", projectTeamMembers.Legal.UserAccount)
                    };
                    if (projectTeamMembers.Legal != null &&
                        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);
                        }
                    }
                    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);
        }