コード例 #1
0
        public static List <UserCourseRoleMappingModel> GetUsersByRole(string role, int courseID)
        {
            try
            {
                var users = SQLAdapter.GetUsersByRole(role, courseID);

                return(ModelMapper.MapToUsersModel(users));
            }
            catch (Exception e)
            {
                return(null);
            }
        }
コード例 #2
0
        public static List <UserCourseRoleMappingModel> GetAllAdmins(int courseID)
        {
            try
            {
                var admins        = new List <UserCourseRoleMappingModel>();
                var demonstrators = SQLAdapter.GetUsersByRole("Demonstrator", courseID);
                var lecturers     = SQLAdapter.GetUsersByRole("Lecturer", courseID);

                admins.AddRange(ModelMapper.MapToUsersModel(demonstrators));
                admins.AddRange(ModelMapper.MapToUsersModel(lecturers));

                return(admins);
            }
            catch (Exception e)
            {
                return(null);
            }
        }