예제 #1
0
        public async Task <IActionResult> OnGetAsync()
        {
            CountyList = await DataPortal.FetchAsync <Counties>();

            SchoolList = await DataPortal.FetchAsync <Schools>();

            StateList = await DataPortal.FetchAsync <States>();

            EthnicityList = await DataPortal.FetchAsync <RaceEthnicities>();

            Vulnerabilities = await DataPortal.FetchAsync <Vulnerabilities>();

            DispositionTypeList = await DataPortal.FetchAsync <DispositionTypes>();

            ReferralTypeList = await DataPortal.FetchAsync <ReferralTypes>();

            CaseTypeList = await DataPortal.FetchAsync <CaseTypes>();

            CaseStatusList = await DataPortal.FetchAsync <CaseStatusTypes>();

            GenderTypeList = await DataPortal.FetchAsync <GenderTypes>();

            LawEnforcementAgencies = await DataPortal.FetchAsync <mcmmodels.LawEnforcement>();

            foreach (var item in EthnicityList)
            {
                RaceEthnicityList.Add(
                    new RaceEthnicityItem {
                    Id = item.Id, Name = item.Name
                });
            }
            foreach (var item in Vulnerabilities)
            {
                VulnerabilityList.Add(
                    new VulnerabilityItem {
                    Id = item.Id, Name = item.Name
                });
            }
            for (int i = 0; i < 3; i++)
            {
                CaseLawEnforcementItemList.Add(
                    new CaseLawEnforcementItem {
                    AgencyId = 0, Denial = false
                });
            }

            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CaseEdit = await DataPortal.FetchAsync <CaseEdit>(id);

            if (CaseEdit == null)
            {
                return(NotFound());
            }

            Counties = await DataPortal.FetchAsync <Counties>();

            Schools = await DataPortal.FetchAsync <Schools>();

            States = await DataPortal.FetchAsync <States>();

            RaceEthnicities = await DataPortal.FetchAsync <RaceEthnicities>();

            Vulnerabilities = await DataPortal.FetchAsync <Vulnerabilities>();

            DispositionTypes = await DataPortal.FetchAsync <DispositionTypes>();

            ReferralType = await DataPortal.FetchAsync <ReferralTypes>();

            CaseTypes = await DataPortal.FetchAsync <CaseTypes>();

            CaseStatuses = await DataPortal.FetchAsync <CaseStatusTypes>();

            GenderTypes = await DataPortal.FetchAsync <GenderTypes>();

            LawEnforcementAgencies = await DataPortal.FetchAsync <mcmmodels.LawEnforcement>();

            foreach (var item in RaceEthnicities)
            {
                RaceEthnicityList.Add(
                    new RaceEthnicityItem {
                    Id = item.Id, Name = item.Name, IsChecked = CaseEdit.RaceEthnicityList.Count(_ => _ == item.Id) > 0
                });
            }
            foreach (var item in Vulnerabilities)
            {
                VulnerabilityList.Add(
                    new VulnerabilityItem {
                    Id = item.Id, Name = item.Name, IsChecked = CaseEdit.VulnerabilityList.Count(_ => _ == item.Id) > 0
                });
            }
            foreach (var item in CaseEdit.CaseLawEnforcementList)
            {
                CaseLawEnforcementItemList.Add(
                    new CaseLawEnforcementItem {
                    AgencyId = item.Key, Denial = item.Value
                });
            }
            for (int i = CaseEdit.CaseLawEnforcementList.Count; i < 3; i++)
            {
                CaseLawEnforcementItemList.Add(
                    new CaseLawEnforcementItem {
                    AgencyId = 0, Denial = false
                });
            }

            return(Page());
        }