コード例 #1
0
        private void HandleCompareCandidatesPage()
        {
            var officeKey = string.Empty;

            var electionKey = MemCache.IsValidElection(GetQueryParm("Election"))
        ? GetQueryParm("Election")
        : FixElectionKeyFromQueryString();

            if (!string.IsNullOrEmpty(electionKey))
            {
                if (Offices.IsInElection(GetQueryParm("Office"), electionKey))
                {
                    officeKey = GetQueryParm("Office");
                }
            }

            var stateCode = Elections.GetStateCodeFromKey(electionKey);

            if (!string.IsNullOrEmpty(electionKey) && !string.IsNullOrEmpty(officeKey))
            {
                NormalizedUri = UrlManager.GetCompareCandidatesPageUri(stateCode, electionKey,
                                                                       officeKey);
            }
            else
            {
                ErrorMessage =
                    "Cannot find this combination of State, Election and Office";
            }
        }
コード例 #2
0
ファイル: Issue.aspx.cs プロジェクト: cloughin/VoteProject.5
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.RedirectPermanent(
         UrlManager.GetCompareCandidatesPageUri(DomainData.FromQueryStringOrDomain,
                                                QueryElection, QueryOffice)
         .ToString(), true);
 }
コード例 #3
0
 private void WriteCompareCandidatesPages()
 {
     foreach (var key in _CompareCandidatesPages.Keys.OrderBy(key => key))
     {
         WriteUrl(UrlManager.GetCompareCandidatesPageUri(key.String1, key.String2));
     }
 }