コード例 #1
0
        // Randomizes the order of candidates on the open polls.
        public static void Run()
        {
            // TODO: Foreach open poll...

            MeetingElectionCandidates candidates = MeetingElectionCandidates.ForPoll(MeetingElection.Primaries2010);

            foreach (MeetingElectionCandidate candidate in candidates)
            {
                candidate.RandomizeSortOrder();
            }
        }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MeetingElectionCandidates candidates = MeetingElectionCandidates.ForPoll(MeetingElection.Primaries2010);

        string pollIdString = Request.QueryString["PollId"];

        if (!string.IsNullOrEmpty(pollIdString))
        {
            int pollId = Int32.Parse(pollIdString);
            candidates = MeetingElectionCandidates.ForPoll(MeetingElection.FromIdentity(pollId));
        }


        this.RepeaterCandidates.DataSource = candidates;
        this.RepeaterCandidates.DataBind();
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Dictionary <int, bool> personLookup = new Dictionary <int, bool>();

        for (int pollId = 9; pollId <= 36; pollId++)
        {
            MeetingElectionCandidates candidates = MeetingElectionCandidates.ForPoll(MeetingElection.FromIdentity(pollId));

            foreach (MeetingElectionCandidate candidate in candidates)
            {
                personLookup[candidate.PersonId] = true;
            }
        }

        foreach (int personId in personLookup.Keys)
        {
            this.LiteralMailAddresses.Text += Person.FromIdentity(personId).Email + "<br/>";
        }
    }