Exemple #1
0
        //查找某个小组的成员
        public List <User> getGroupMembers(string groupId)
        {
            UserCourseDBContext ucdb       = new UserCourseDBContext();
            List <UserCourse>   list       = ucdb.userCourses.ToList();
            List <UserCourse>   tempList   = ucdb.userCourses.ToList();
            List <User>         resultList = new List <User>();

            foreach (UserCourse u in list)
            {
                if (u.groupId == groupId)
                {
                    tempList.Add(u);
                }
            }
            foreach (UserCourse uc in tempList)
            {
                User u = findUser(uc.userId);
                if (u != null)
                {
                    resultList.Add(u);
                }
            }
            ucdb = null;
            return(resultList);
        }
Exemple #2
0
        public List <UserCourse> getUserCourses()
        {
            UserCourseDBContext userCoursedb = new UserCourseDBContext();
            List <UserCourse>   userCourses  = userCoursedb.userCourses.ToList();

            userCoursedb = null;
            return(userCourses);
        }