public Student GetStudentDetails(int studentId, int schoolYearId) { var student = StudentStorage.GetById(studentId); var isEnrolled = ((DemoSchoolYearService)ServiceLocator.SchoolYearService).IsStudentEnrolled(studentId, schoolYearId); return(BuildStudentDetailsData(student, !isEnrolled)); }
public Student GetById(int id, int schoolYearId) { var student = StudentStorage.GetById(id); var isEnrolled = ServiceLocator.SchoolYearService.GetStudentAssignments().Any(x => x.StudentRef == id && x.SchoolYearRef == schoolYearId && x.IsEnrolled); return(BuildStudentDetailsData(student, !isEnrolled)); }