Exemplo n.º 1
0
        public void DeleteStudent(int userId)
        {
            List <SubArea> userSubAreas = subAreaController.GetUserSubAreas(userId);

            ResetSubAreasProxy(userSubAreas);
            List <string> assignmentsToDelete = SubAreaUtils.GetSubAreasStrings(userSubAreas).ToList();

            SubAreaAssignUtils.UnAssignSubAreasToUser(userId, subAreaController, assignmentsToDelete.ToArray());
            StudentExamController         studentExamController         = new StudentExamController();
            StudentExamQuestionController studentExamQuestionController = new StudentExamQuestionController();
            List <StudentExam>            allStudentExamIds             = studentExamController.GetAllStudentExams(userId);

            foreach (StudentExam studentExam in allStudentExamIds)
            {
                studentExamQuestionController.DeleteAllStudentExamQuestions(studentExam.Id);
                studentExamController.DeleteStudentExam(studentExam.Id);
            }
            userController.DeleteStudent(userId);
        }