示例#1
0
        public IDepartment GetDepartment(SysProcessParticipant part, SysProcessInstance pi, SysActivityInstance ai)
        {
            IDepartment department = null;

            if (part.Param_Participant == null)
            {
                throw new ApplicationException("父部门参与人未指定基于参于人");
            }
            SysProcessParticipant participant = part.Param_Participant;

            if (participant.FunctionType == 3)
            {
                department = new SpecDepartmentFunc(base._context).GetDepartment(participant, pi, ai);
            }
            else if (participant.FunctionType == 2)
            {
                department = new StartDepartmentFunc(base._context).GetDepartment(pi);
            }
            else if (participant.FunctionType == 5)
            {
                department = this.GetDepartment(participant, pi, ai);
            }
            else
            {
                if (participant.FunctionType != 10)
                {
                    throw new ApplicationException("在ParentDepartmentFunc的GetDepartment中FunctionType有误!");
                }
                department = new SpecialLevelParentDeptFunc(base._context).GetDepartment(participant, pi, ai);
            }
            return(base._orgProxy.GetDepartmentById(department.Parent_ID.Value));
        }
示例#2
0
        public IDepartment GetDepartment(SysProcessParticipant part, SysProcessInstance pi, SysActivityInstance ai)
        {
            if (part == null)
            {
                throw new ArgumentNullException("part");
            }
            SysProcessParticipant participant = part.Param_Participant;

            if (participant == null)
            {
                throw new ApplicationException("部门经理参与人未指定基于参于人");
            }
            if (participant.FunctionType == 3)
            {
                SpecDepartmentFunc func = new SpecDepartmentFunc(base._context);
                return(func.GetDepartment(participant, pi, ai));
            }
            if (participant.FunctionType == 2)
            {
                StartDepartmentFunc func2 = new StartDepartmentFunc(base._context);
                return(func2.GetDepartment(pi));
            }
            if (participant.FunctionType == 5)
            {
                ParentDepartmentFunc func3 = new ParentDepartmentFunc(base._context);
                return(func3.GetDepartment(participant, pi, ai));
            }
            if (participant.FunctionType != 10)
            {
                throw new ApplicationException("部门经理参与人获得部门失败,可能是参数类型错误");
            }
            SpecialLevelParentDeptFunc func4 = new SpecialLevelParentDeptFunc(base._context);

            return(func4.GetDepartment(participant, pi, ai));
        }
        public override IList <IUser> GetUsers(SysProcessParticipant part, SysProcessInstance pi, SysActivityInstance ai)
        {
            if (part == null)
            {
                throw new ArgumentNullException("part");
            }
            if (part.Param_Participant == null)
            {
                throw new ApplicationException("部门角色参与人未指定基于参与人");
            }
            if (!part.Param_RoleId.HasValue)
            {
                throw new ApplicationException("未指定参与人的角色");
            }
            SysProcessParticipant participant = part.Param_Participant;
            IDepartment           department  = null;

            if (participant.FunctionType == 3)
            {
                department = new SpecDepartmentFunc(base._context).GetDepartment(participant, pi, ai);
            }
            else if (participant.FunctionType == 2)
            {
                department = new StartDepartmentFunc(base._context).GetDepartment(pi);
            }
            else if (participant.FunctionType == 5)
            {
                department = new ParentDepartmentFunc(base._context).GetDepartment(participant, pi, ai);
            }
            else
            {
                if (participant.FunctionType != 10)
                {
                    throw new ApplicationException("在DepartmentRoleFunc的GetUsers中FunctionType有误!");
                }
                department = new SpecialLevelParentDeptFunc(base._context).GetDepartment(participant, pi, ai);
            }
            return(base._orgProxy.GetDepartmentRoleUsers(department.Department_ID, part.Param_RoleId.Value));
        }