public IEnumerable <SchoolView> GetSchoolByLoginName(string loginName)
        {
            var school = new SchoolAppl().GetSchoolOfUser(loginName);

            school = school.OrderBy <School, string>(t => t.Name);
            return(_adapter.Adapt <SchoolView>(school));
        }
        /// <summary>
        /// 根据登录名取学院
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public IEnumerable <SchoolView> GetSchoolByloginName(string loginName)
        {
            //系统用户
            var user = new TbmisUserAppl(loginName).GetUser();

            //取当前登录用户的学院

            var schoolAppl = new SchoolAppl();
            var school     = schoolAppl.GetSchoolOfUser(loginName);

            return(_adapter.Adapt <SchoolView>(school));
        }
        public IEnumerable <SchoolView> GetSchoolByLoginName(string loginName)
        {
            var user = new TbmisUserAppl(loginName).GetUser();
            IEnumerable <School> schools = new List <School>();

            //领导,显示全部学院
            if (user.IsInRole("教材科") || user.IsInRole("教务处"))
            {
                schools = new SchoolAppl().GetSchools();
            }
            else
            {
                schools = new SchoolAppl().GetSchoolOfUser(loginName);
            }

            schools = schools.OrderBy(t => t.Name);

            return(_adapter.Adapt <SchoolView>(schools));
        }
        /// <summary>
        /// 根据登录名取学院
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public IEnumerable<SchoolView> GetSchoolByloginName(string loginName)
        {
            //系统用户
            var user = new TbmisUserAppl(loginName).GetUser();

            //取当前登录用户的学院

            var schoolAppl = new SchoolAppl();
            var school = schoolAppl.GetSchoolOfUser(loginName);
            return _adapter.Adapt<SchoolView>(school);
        }
Example #5
0
        /// <summary>
        /// 根据登录名取学院
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public IEnumerable <SchoolView> GetSchoolByloginName(string loginName)
        {
            var schools = new SchoolAppl().GetSchoolOfUser(loginName);

            return(_adapter.Adapt <SchoolView>(schools));
        }
        public IEnumerable<SchoolView> GetSchoolByLoginName(string loginName)
        {
            var user = new TbmisUserAppl(loginName).GetUser();
            IEnumerable<School> schools = new List<School>();

            //领导,显示全部学院
            if (user.IsInRole("教材科") || user.IsInRole("教务处"))
            {
                schools = new SchoolAppl().GetSchools();
            }
            else
            {
                schools = new SchoolAppl().GetSchoolOfUser(loginName);
            }

            schools = schools.OrderBy(t => t.Name);

            return _adapter.Adapt<SchoolView>(schools);
        }
 public IEnumerable<SchoolView> GetSchoolByLoginName(string loginName)
 {
     var school = new SchoolAppl().GetSchoolOfUser(loginName);
     school = school.OrderBy<School, string>(t => t.Name);
     return _adapter.Adapt<SchoolView>(school);
 }
 /// <summary>
 /// 根据登录名取学院
 /// </summary>
 /// <param name="loginName"></param>
 /// <returns></returns>
 public IEnumerable<SchoolView> GetSchoolByloginName(string loginName)
 {
     var schools = new SchoolAppl().GetSchoolOfUser(loginName);
     return _adapter.Adapt<SchoolView>(schools);
 }