private void SelectCourse(object courseId) { if (courseId == null) { return; } this.selectedCourseId = (int)courseId; this.Students = studentService .GetTeacherStudents(selectedCourseId); this.SelectedCourseName = courseService .GetCourseName(selectedCourseId); this.ExceptionMessage = string.Empty; }
private void Initialize() { this.courseService = new TeacherCourseService(); this.studentService = new TeacherStudentService(); this.Courses = courseService .GetTeacherCourses(User.UserId); var initializedCourse = this.Courses .FirstOrDefault(); if (initializedCourse != null) { this.Students = studentService .GetTeacherStudents(initializedCourse.CourseId); this.SelectedCourseName = courseService .GetCourseName(initializedCourse.CourseId); this.selectedCourseId = initializedCourse.CourseId; } }