Exemple #1
0
        public FileResult ReportAverageAndMedianGradeAttainedBySubjectAcrossAllRolesAndyearBtwnYearsAcrossSubjectContains(int yearStart, int yearEnd, string subject, string studentRole = "")
        {
            if (string.IsNullOrEmpty(subject))
            {
                return(null);
            }
            AverageMedianAttainedGrade[] reportSubmissions = null;
            using (var dbContext = new TeachersAssistantDbContext())
            {
                adhocPatchAndReportingRepository.DbContextTeachersAssistant = dbContext;
                reportSubmissions = adhocPatchAndReportingRepository.AverageAndMedianGradeAttainedBySubjectAcrossAllRolesAndyearBtwnYearsAcrossSubject(yearStart, yearEnd, subject, studentRole);
            }

            var fileName = string.Format("MedaianGrades_{0}_{1}_{2}.xlsx", yearStart, yearEnd, DateTime.Now.ToString("dd-MM-yyyy HH:mm"));

            return(File(ReportingFacilities.ReportAverageAndMedianGradeAttainedBySubjectAcrossAllRolesAndyearBtwnYears(fileName, reportSubmissions), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName));
        }
Exemple #2
0
        public FileResult ReportsAverageGradeBySubjectRoleAndYearForParticualarSubjectBtwnYears(int yearStart, int yearEnd, int subjectId, string studentRole)
        {
            if (string.IsNullOrEmpty(studentRole) || subjectId < 1)
            {
                return(null);
            }
            AverageGradeSubjectYear[] reportSubmissions = null;

            using (var dbContext = new TeachersAssistantDbContext())
            {
                adhocPatchAndReportingRepository.DbContextTeachersAssistant = dbContext;
                reportSubmissions = adhocPatchAndReportingRepository.AverageGradeBySubjectRoleAndYearForParticualarSubjectBtwnYears(yearStart, yearEnd, subjectId, studentRole);
            }
            var fileName = string.Format("AverageGrades_{0}_{1}_{2}.xlsx", yearStart, yearEnd, DateTime.Now.ToString("dd-MM-yyyy HH:mm"));

            return(File(ReportingFacilities.ReportAverageGradeAttainedGradeBySubjectRoleAndYear(fileName, reportSubmissions), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName));
        }
Exemple #3
0
        public FileResult ReportMedianGradeAttainedGradeBySubjectAcrossAllRolesAndYearForParticualarSubjectBtwnYears(int yearStart, int yearEnd, int subjectId)
        {
            if (subjectId < 1)
            {
                return(null);
            }
            MedianGradeAttainedGrade[] reportSubmissions = null;
            using (var dbContext = new TeachersAssistantDbContext())
            {
                adhocPatchAndReportingRepository.DbContextTeachersAssistant = dbContext;
                reportSubmissions = adhocPatchAndReportingRepository.MedianGradeAttainedGroupedByGradeAndSubjectAcrossAllRolesAndyearBtwnYears(yearStart, yearEnd, subjectId);
            }

            var fileName = string.Format("MedaianGrades_{0}_{1}_{2}.xlsx", yearStart, yearEnd, DateTime.Now.ToString("dd-MM-yyyy HH:mm"));

            return(File(ReportingFacilities.ReportMedianGradeAttainedGradeBySubjectRoleAndYearAcrossAllRoles(fileName, reportSubmissions), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName));
        }
Exemple #4
0
        public FileResult ReportGroupByNumberOfStudentsReceivedGradesInSubjectAndyearBtwnAcrossSubjectContains(int yearStart, int yearEnd, string subject, string studentRole)
        {
            if (string.IsNullOrEmpty(studentRole) || string.IsNullOrEmpty(subject))
            {
                return(null);
            }
            ReportingGroupSubmission[] reportSubmissions = null;

            using (var dbContext = new TeachersAssistantDbContext())
            {
                adhocPatchAndReportingRepository.DbContextTeachersAssistant = dbContext;
                reportSubmissions = adhocPatchAndReportingRepository.GroupByNumberOfStudentsReceivedGradesInSubjectAndyearBtwnAcrossSubject(yearStart, yearEnd, subject, studentRole);
            }
            var fileName = string.Format("NumberOfStudentsGroupReceivedGrades_{0}_{1}_{2}.xlsx", yearStart, yearEnd, DateTime.Now.ToString("dd-MM-yyyy HH:mm"));

            return(File(ReportingFacilities.ReportNumberOfStudentsReceivedGradeBySubjectRoleAndYear(fileName, reportSubmissions), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName));
        }