public async Task <ActionResult> EducationOrganizationList()
        {
            var api = await _odsApiFacadeFactory.Create();

            var schools = api.GetAllSchools();
            var localEducationAgencies = api.GetAllLocalEducationAgencies();

            var requiredApiDataExist = (await _odsApiFacadeFactory.Create()).DoesApiDataExist();

            var model = new EducationOrganizationViewModel
            {
                Schools = schools,
                LocalEducationAgencies       = localEducationAgencies,
                ShouldAllowMultipleDistricts = CloudOdsAdminAppSettings.Instance.Mode != ApiMode.DistrictSpecific,
                AddSchoolModel = new AddSchoolModel
                {
                    GradeLevelOptions    = api.GetAllGradeLevels(),
                    StateOptions         = api.GetAllStateAbbreviations(),
                    RequiredApiDataExist = requiredApiDataExist
                },
                AddLocalEducationAgencyModel = new AddLocalEducationAgencyModel
                {
                    LocalEducationAgencyCategoryTypeOptions = api.GetLocalEducationAgencyCategories(),
                    StateOptions         = api.GetAllStateAbbreviations(),
                    RequiredApiDataExist = requiredApiDataExist
                }
            };

            if (CloudOdsAdminAppSettings.Instance.Mode == ApiMode.DistrictSpecific)
            {
                model.AddLocalEducationAgencyModel.LocalEducationAgencyId = OdsInstanceIdentityHelper.GetIdentityValue(_instanceContext.Name);
            }

            return(PartialView("_EducationOrganizations", model));
        }
Exemple #2
0
        public async Task <ActionResult> EducationOrganizationList()
        {
            var api = await _odsApiFacadeFactory.Create();

            var schools = api.GetAllSchools();
            var localEducationAgencies = api.GetAllLocalEducationAgencies();

            var model = new EducationOrganizationViewModel
            {
                Schools = schools,
                LocalEducationAgencies       = localEducationAgencies,
                ShouldAllowMultipleDistricts = CloudOdsAdminAppSettings.Instance.Mode != ApiMode.DistrictSpecific
            };

            return(PartialView("_EducationOrganizations", model));
        }