protected List<long> GetCustomListStudentIds(long staffUSI, int schoolId, StudentListIdentity studentListIdentity)
        {
            var customStudentIdList = new List<long>();

            switch (studentListIdentity.StudentListType)
            {
                case StudentListType.CustomStudentList:
                    var sectionOrCohortId = studentListIdentity.Id;

                    customStudentIdList =
                        (from s in StaffCustomStudentListStudentRepository.GetAll()
                         where s.StaffCustomStudentListId == sectionOrCohortId
                         select s.StudentUSI)
                            .ToList();

                    break;
            }

            return customStudentIdList;
        }
Exemple #2
0
        protected List<long> GetCustomListStudentIds(long staffUSI, int schoolId, StudentListIdentity studentListIdentity)
        {
            var customStudentIdList = new List<long>();

            switch (studentListIdentity.StudentListType)
            {
                case StudentListType.CustomStudentList:
                    long sectionOrCohortId = studentListIdentity.Id;

                    customStudentIdList =
                        (from s in StaffCustomStudentListStudentRepository.GetAll()
                         where s.StaffCustomStudentListId == sectionOrCohortId
                         select s.StudentUSI)
                            .ToList();

                    break;

                case StudentListType.All:
                    customStudentIdList = (from csl in StaffCustomStudentListRepository.GetAll()
                                           join csls in StaffCustomStudentListStudentRepository.GetAll() on
                                               csl.StaffCustomStudentListId equals csls.StaffCustomStudentListId
                                           where csl.StaffUSI == staffUSI && csl.EducationOrganizationId == schoolId
                                           select csls.StudentUSI)
                                            .Distinct()
                                            .ToList();
                    break;
            }

            return customStudentIdList;
        }
Exemple #3
0
        protected virtual List<EnhancedStudentInformation> GetStudentListEntities(int schoolId, long staffUSI, 
            StudentListIdentity studentListIdentity, List<MetadataColumnGroup> listMetadata, 
            List<long> customStudentIdList, int? sortColumn, string sortDirection)
        {
            var queryOptions = new StudentMetricsProviderQueryOptions
                {
                    MetricVariantIds = listMetadata.GetMetricVariantIds(),
                    SchoolId = schoolId,
                    StaffUSI = staffUSI,
                    StudentIds = customStudentIdList
                };

            switch (studentListIdentity.StudentListType)
            {
                case StudentListType.Section:
                    queryOptions.TeacherSectionIds = new[]
                    {
                        studentListIdentity.Id
                    };

                    break;
                case StudentListType.Cohort:
                    queryOptions.StaffCohortIds = new[]
                    {
                        studentListIdentity.Id
                    };

                    break;
            }

            return
                StudentListWithMetricsProvider.GetOrderedStudentList(queryOptions, GetSortColumn(listMetadata, sortColumn), sortDirection).ToList();
        }