public StudentRaceReport Execute(string instanceName, ApiMode apiMode, int localEducationAgencyId)
        {
            using (var sqlConnection = _connectionProvider.CreateNewConnection(instanceName, apiMode))
            {
                var studentDemographicData = sqlConnection.Query <StudentDemographicData>(Query, new { LEAid = localEducationAgencyId }).ToList();

                var localEducationAgencyName = new GetLocalEducationAgencyByIdQuery(_connectionProvider).Execute(instanceName, apiMode, localEducationAgencyId);

                return(new StudentRaceReport(studentDemographicData, localEducationAgencyName, localEducationAgencyId));
            }
        }
        public TotalEnrollmentReport Execute(string instanceName, ApiMode apiMode, int localEducationAgencyId)
        {
            using (var sqlConnection = _databaseConnectionProvider.CreateNewConnection(instanceName, apiMode))
            {
                var enrollmentCount = sqlConnection.QueryFirstOrDefault <int>(EnrollmentsCountQuery, new { LEAId = localEducationAgencyId });

                var localEducationAgencyName = new GetLocalEducationAgencyByIdQuery(_databaseConnectionProvider).Execute(instanceName, apiMode, localEducationAgencyId);

                return(new TotalEnrollmentReport
                {
                    EnrollmentCount = enrollmentCount,
                    LocalEducationAgencyName = localEducationAgencyName,
                    LocalEducationAgencyId = localEducationAgencyId
                });
            }
        }
Exemple #3
0
        public SchoolTypeReport Execute(string instanceName, ApiMode apiMode, int localEducationAgencyId)
        {
            using (var sqlConnection = _databaseConnectionProvider.CreateNewConnection(instanceName, apiMode))
            {
                var schoolCounts = sqlConnection.Query <SchoolCount>(SchoolsCountQuery, new { LEAId = localEducationAgencyId }).ToList();

                var localEducationAgencyName = new GetLocalEducationAgencyByIdQuery(_databaseConnectionProvider).Execute(instanceName, apiMode, localEducationAgencyId);

                return(new SchoolTypeReport
                {
                    SchoolCounts = schoolCounts,
                    LocalEducationAgencyName = localEducationAgencyName,
                    LocalEducationAgencyId = localEducationAgencyId
                });
            }
        }