public UserStatisticViewModel(int userId, bool onlyLastResult)
 {
     _resultQuizContext = new ResultQuizContext();
     var lastResultLoaded = _resultQuizContext.Load(_resultQuizContext.GetLastQuizResultsForUserQuery(userId));
     _userContext = new UserContext();
     var result = _userContext.Load(_userContext.GetUserByIdQuery(userId));
     result.Completed += new EventHandler(result_Completed);
     lastResultLoaded.Completed += new EventHandler(lastResultLoaded_Completed);
 }
 public UserStatisticViewModel(int userId)
 {
     _resultQuizContext = new ResultQuizContext();
     var quizResult = _resultQuizContext.Load(_resultQuizContext.GetAllQuizResultsForUserQuery(userId));
     quizResult.Completed += new EventHandler(quizResult_Completed);
     _userContext = new UserContext();
     var result = _userContext.Load(_userContext.GetUserByIdQuery(userId));
     result.Completed += new EventHandler(result_Completed);
 }
Exemple #3
0
        public StatisticViewModel()
        {
            studentContext = new UserContext();
            var studentsLoad = studentContext.Load(studentContext.GetStudentsQuery());
            studentsLoad.Completed += new EventHandler(studentsLoad_Completed);
            groupContaxt = new GroupContext();
            groupContaxt.Load(groupContaxt.GetGroupsQuery());

            resultQuizContext = new ResultQuizContext();
        }
Exemple #4
0
 private void RefreshUserGrid()
 {
     userService = new UserContext();
     var loadUsersResult = userService.Load(userService.GetUsersQuery());
     loadUsersResult.Completed += new EventHandler(loadUsersResult_Completed);
 }