public IEnumerable<DepartmentView> GetDepartments(string schoolId)
 {
     var id = schoolId.ConvertToGuid();
     //显示全部教研室
     var departments = new DepartmentAppl().GetDepartmentBySchoolId(id);
     //排序
     departments = departments.OrderBy<Department, string>(t => t.Name);
     return _adapter.Adapt<DepartmentView>(departments);
 }
Esempio n. 2
0
        public IEnumerable <DepartmentView> GetDepartmentByLoginName(string loginName, string schoolId)
        {
            var id = schoolId.ConvertToGuid();
            //显示全部教研室
            var departments = new DepartmentAppl().GetDepartmentBySchoolId(id);

            //排序
            departments = departments.OrderBy <Department, string>(t => t.Name);
            return(_adapter.Adapt <DepartmentView>(departments));
        }
        public IEnumerable <DepartmentView> GetDepartmentBySchoolId(string loginName, string schoolId)
        {
            var id   = schoolId.ConvertToGuid();
            var user = new TbmisUserAppl(loginName).GetUser();
            IEnumerable <Department> departments = new List <Department>();

            ////领导角色,显示全部教研室
            //if (user.IsInRole("学院院长") || user.IsInRole("教材科") || user.IsInRole("教务处"))
            //{
            //    departments = new DepartmentAppl().GetDepartmentBySchoolId(id);
            //}
            //else
            //{
            //    departments = new DepartmentAppl().GetDepartmentBySchoolId(loginName, id);
            //}

            //显示全部教研室
            departments = new DepartmentAppl().GetDepartmentBySchoolId(id);

            departments = departments.OrderBy(t => t.Name);
            return(_adapter.Adapt <DepartmentView>(departments));
        }
        public IEnumerable<DepartmentView> GetDepartmentBySchoolId(string loginName, string schoolId)
        {
            var id = schoolId.ConvertToGuid();
            var user = new TbmisUserAppl(loginName).GetUser();
            IEnumerable<Department> departments = new List<Department>();

            ////领导角色,显示全部教研室
            //if (user.IsInRole("学院院长") || user.IsInRole("教材科") || user.IsInRole("教务处"))
            //{
            //    departments = new DepartmentAppl().GetDepartmentBySchoolId(id);
            //}
            //else
            //{
            //    departments = new DepartmentAppl().GetDepartmentBySchoolId(loginName, id);
            //}

            //显示全部教研室
            departments = new DepartmentAppl().GetDepartmentBySchoolId(id);

            departments = departments.OrderBy(t => t.Name);
            return _adapter.Adapt<DepartmentView>(departments);
        }