コード例 #1
0
        private static void AddJurisdictionsMenu(Control ul)
        {
            var stateCode = SecurePage.GetViewStateStateCode();

            if (!StateCache.IsValidStateCode(stateCode))
            {
                stateCode = string.Empty;
            }
            AddMenuItem(ul, "Jurisdictions",
                        SecureAdminPage.GetUpdateJurisdictionsPageUrl(stateCode,
                                                                      SecurePage.GetViewStateCountyCode(), SecurePage.GetViewStateLocalCode()));
        }
コード例 #2
0
        private void AddCountiesMenu(Control ul)
        {
            // State Admins always see a counties menu
            // Masters see it if they are on any Admin page
            string stateCode = null;

            if (SecurePage.IsStateAdminUser ||
                (SecurePage.IsMasterUser && SecurePage.IsAdminPage))
            {
                stateCode = SecurePage.GetViewStateStateCode();
            }
            if (StateCache.IsValidStateCode(stateCode))
            {
                AddMenuItem(ul, stateCode + " Counties",
                            GetCountiesMenu("/admin?state={StateCode}&county={CountyCode}", stateCode));
            }
        }
コード例 #3
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.IsAdminUser ||
                (SecurePage.IsMasterUser && SecurePage.IsAdminPage))
            {
                stateCode = SecurePage.GetViewStateStateCode();
            }
            if (StateCache.IsValidStateCode(stateCode))
            {
                AddMenuItem(ul, "Elections",
                            SecureAdminPage.GetUpdateElectionsPageUrl(stateCode,
                                                                      SecurePage.GetViewStateCountyCode(), SecurePage.GetViewStateLocalCode()));
            }
        }
コード例 #4
0
        private void AddLocalsMenu(Control ul)
        {
            // County Admins always see a local menu
            // Masters and State Admins see it if they are on a County or Local Admin page
            string stateCode  = null;
            string countyCode = null;

            if (SecurePage.IsCountyAdminUser ||
                ((SecurePage.IsMasterUser || SecurePage.IsStateAdminUser) &&
                 (SecurePage.IsCountyAdminPage || SecurePage.IsLocalAdminPage)))
            {
                stateCode  = SecurePage.GetViewStateStateCode();
                countyCode = SecurePage.GetViewStateCountyCode();
            }
            if ((stateCode != null) && (countyCode != null))
            {
                AddMenuItem(ul, Counties.GetCounty(stateCode, countyCode),
                            GetLocalsMenu(
                                "/admin?state={StateCode}&county={CountyCode}&local={LocalCode}",
                                stateCode, countyCode));
            }
        }