Ejemplo n.º 1
0
        private void InitializeForCountyAdmin()
        {
            DialogCredentialMessage.InnerHtml = "Your sign-in credentials allow only " +
                                                Counties.GetFullName(_SecureAdminPage.StateCode,
                                                                     _SecureAdminPage.CountyCode) + " local districts to be selected.";

            StateName.InnerHtml = States.GetName(_SecureAdminPage.StateCode);
            StateDropDownList.AddCssClasses("hidden");
            StateRadioButton.AddCssClasses("invisible");
            CountyName.InnerHtml = Counties.GetName(_SecureAdminPage.StateCode,
                                                    _SecureAdminPage.CountyCode);
            CountyDropDownList.AddCssClasses("hidden");
            LocalName.AddCssClasses("hidden");

            switch (_SecureAdminPage.AdminPageLevel)
            {
            case AdminPageLevel.County:
                CountyRadioButton.Checked = true;
                PopulateLocalDropDown(true);
                break;

            case AdminPageLevel.Local:
                LocalRadioButton.Checked = true;
                PopulateLocalDropDown();
                break;
            }
        }
Ejemplo n.º 2
0
        private Control GenerateReportByJurisdiction(string stateCode, string countyCode, string localKey)
        {
            ReportContainer.ID           = "new-accordions";
            ReportContainer.ClientIDMode = ClientIDMode.Static;
            stateCode = stateCode.ToUpperInvariant();
            _DataManager.GetDataByJurisdiction(stateCode, countyCode, localKey);

            var issueLevelGroups = _DataManager.GetDataSubset()
                                   .GroupBy(row => new
            {
                IssueGroupId = row.IssueGroupId(),
                IssueId      = row.IssueId()
            })
                                   .ToList()
                                   .GroupBy(g => g.Key.IssueGroupId)
                                   .ToList()
                                   .GroupBy(g => g.First().First()
                                            .IssueLevel())
                                   .OrderBy(g => g.Key)
                                   .ToList();

            foreach (var issueLevelGroup in issueLevelGroups)
            {
                switch (issueLevelGroup.Key)
                {
                case Issues.IssueLevelAll:
                    OneReportSection(issueLevelGroup,
                                     "Questions Available to All Candidates");
                    break;

                case Issues.IssueLevelNational:
                    OneReportSection(issueLevelGroup,
                                     "Questions Available to U.S. President, U.S. House and U.S. Senate Candidates");
                    break;

                case Issues.IssueLevelState:
                    OneReportSection(issueLevelGroup,
                                     $"Questions Available to {StateCache.GetStateName(stateCode)}" +
                                     " Statewide, House and Senate Candidates");
                    break;

                case Issues.IssueLevelCounty:
                    OneReportSection(issueLevelGroup,
                                     $"Questions Available to {Counties.GetName(stateCode, countyCode)}" +
                                     $" ({stateCode}) Candidates");
                    break;

                case Issues.IssueLevelLocal:
                    OneReportSection(issueLevelGroup,
                                     $"Questions Available to {LocalDistricts.GetName(stateCode, localKey)}" +
                                     $" ({stateCode}) Candidates");
                    break;
                }
            }

            return(ReportContainer.AddCssClasses("issue-list-report accordion-container"));
        }