Esempio n. 1
0
        public void GetData(OfficesAdminReportViewOptions options)
        {
            DataTable = OfficesAdminReportView.GetData(options);

            // Get the OfficesAllIdentified row(s) and make a dictionary of
            // only the true values
            var table = options.OfficeClass == OfficeClass.All
        ? OfficesAllIdentified.GetDataByStateCode(options.StateCode)
        : OfficesAllIdentified.GetData(options.StateCode, options.OfficeClass.ToInt());

            _AllIdentifiedDictionary = table.Where(row => row.IsOfficesAllIdentified)
                                       .ToDictionary(row => row.OfficeLevel.ToOfficeClass(), row => null as object);
        }
Esempio n. 2
0
        private void CreateOfficeClassRadioButtons()
        {
            // initial office class selection is from Query String as string ordinal
            var initialOfficeClass =
                Offices.GetValidatedOfficeClass(GetQueryString("class"));

            // iterator options
            var iteratorOptions = GetOfficeClassesOptions.IncludeAll;

            switch (AdminPageLevel)
            {
            case AdminPageLevel.State:
                iteratorOptions |= GetOfficeClassesOptions.IncludeCongress |
                                   GetOfficeClassesOptions.IncludeState;
                break;

            case AdminPageLevel.County:
                iteratorOptions |= GetOfficeClassesOptions.IncludeCounty;
                break;

            case AdminPageLevel.Local:
                iteratorOptions |= GetOfficeClassesOptions.IncludeLocal;
                break;
            }

            // create a button for each OfficeClass returned by the iterator
            foreach (var officeClass in Offices.GetOfficeClasses(iteratorOptions))
            {
                var listItem = new ListItem();
                RadioButtonListOfficeClass.Items.Add(listItem);
                listItem.Value = officeClass.ToInt()
                                 .ToString(CultureInfo.InvariantCulture);
                listItem.Selected = officeClass == initialOfficeClass;

                var text =
                    GetOfficeClassDescription(officeClass.ToOfficeClass(), shortDesc: true) +
                    " ({0})";

                var officeCount =
                    OfficesAdminReportView.CountData(GetOfficesAdminReportOptions(officeClass));

                listItem.Text = string.Format(text, officeCount);
            }
        }
Esempio n. 3
0
 public void GetData(OfficesAdminReportViewOptions options)
 {
     DataTable = OfficesAdminReportView.GetData(options);
 }