Exemple #1
0
        private static void AddMasterOfficesMenu(Control parent)
        {
            // Masters only see it if they are on an Admin page
            if (!SecurePage.IsMasterUser)
            {
                return;
            }
            string stateCode = null;

            if (SecurePage.IsAdminPage)
            {
                stateCode = SecurePage.FindStateCode();
            }
            if (StateCache.IsValidStateCode(stateCode))
            {
                var ul         = CreateDropdownMenu();
                var countyCode = SecurePage.FindCountyCode();
                var localKey   = SecurePage.FindLocalKey();
                AddMenuItem(ul, "Manage Offices, Office Templates and Incumbents",
                            SecureAdminPage.GetUpdateOfficesPageUrl(stateCode, countyCode, localKey));
                AddMenuItem(ul, "Offices Report",
                            SecureAdminPage.GetOfficesPageUrl(stateCode, countyCode, localKey));
                AddMenuItem(ul, "Incumbents Report",
                            SecureAdminPage.GetOfficialsPageUrl(stateCode, countyCode, localKey));
                AddMenuItem(ul, "Download County or Local Offices CSV",
                            SecureAdminPage.GetAdminFolderPageUrl("DownloadOfficesCsv", "state", stateCode));
                AddMenuItem(parent, "Offices", ul);
            }
        }
Exemple #2
0
        private static void AddElectionsMenu(Control ul)
        {
            // Admins always see an elections menu
            // Masters see it if they are on any Admin page
            string stateCode = null;

            if (SecurePage.IsMasterUser && SecurePage.IsAdminPage)
            {
                stateCode = SecurePage.FindStateCode();
            }
            if (SecurePage.IsAdminUser || StateCache.IsValidStateCode(stateCode))
            {
                AddMenuItem(ul, "Elections",
                            SecureAdminPage.GetUpdateElectionsPageUrl(stateCode, SecurePage.FindCountyCode(),
                                                                      SecurePage.FindLocalKey()));
            }
        }
Exemple #3
0
        private static void AddJurisdictionsMenu(Control ul)
        {
            var stateCode = SecurePage.FindStateCode();

            AddMenuItem(ul, "Jurisdictions",
                        SecureAdminPage.GetUpdateJurisdictionsPageUrl(stateCode,
                                                                      SecurePage.FindCountyCode(), SecurePage.FindLocalKey()));
        }