Beispiel #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);
            }
        }
Beispiel #2
0
        private static HtmlAnchor CreateAdminOfficialsAnchor(string anchorText,
                                                             string stateCode, string countyCode = "", string localCode = "")
        {
            var a = new HtmlAnchor
            {
                HRef =
                    SecureAdminPage.GetOfficialsPageUrl(stateCode, countyCode, localCode),
                InnerHtml = anchorText
            };

            return(a);
        }