Пример #1
0
        /// <summary>
        /// 获得在companyID公司内employeeID所管辖的部门
        /// </summary>
        /// <param name="employeeID"></param>
        /// <param name="companyID"></param>
        /// <returns></returns>
        public List <Department> GetDepartmentAndChildrenDeptByEmployeeIDAndCompanyID(int employeeID, int companyID)
        {
            List <Department> dept1 = _IDepartmentBll.GetDepartmentAndChildrenDeptByLeaderID(employeeID);
            List <Department> dept2 = GetDepartmentByCompanyID(companyID);

            //dept1与dept2取交集
            return(_IDepartmentBll.MixDepartmentList(dept1, dept2));
        }
Пример #2
0
        private void GetDeptAndChildrenDeptByAccountID(int accountid)
        {
            string result = String.Empty;


            IDepartmentBll    _IDepartmentBll = BllInstance.DepartmentBllInstance;
            List <Department> all             = _IDepartmentBll.GetDepartmentAndChildrenDeptByLeaderID(accountid);

            foreach (Department item in all)
            {
                result += string.IsNullOrEmpty(result) ? item.Name : "\n" + item.Name;
            }

            Response.Write(result);
            Response.End();
        }
Пример #3
0
        /// <summary>
        /// 为当前员工增加额外权限,如对于一个主管来说考勤统计可以查看自己部门下所有员工的信息
        /// </summary>
        private void SetLoginUserExtendAuth(Account account)
        {
            List <Department> deptList = _IDepartmentBll.GetDepartmentAndChildrenDeptByLeaderID(account.Id);

            if (deptList.Count > 0)
            {
                Tools.MakeAccountHaveAuth(account,
                                          AuthType.HRMIS, HrmisPowers.A401, deptList);
                Tools.MakeAccountHaveAuth(account,
                                          AuthType.HRMIS, HrmisPowers.A405, deptList);
                Tools.MakeAccountHaveAuth(account,
                                          AuthType.HRMIS, HrmisPowers.A507, deptList);
                Tools.MakeAccountHaveAuth(account,
                                          AuthType.HRMIS, HrmisPowers.A607, deptList);
            }
        }