Exemplo n.º 1
0
 public static List <SimpleListItem> GetPreviewCandidateItems(string electionKey,
                                                              string officeKey)
 {
     return(new List <SimpleListItem> {
         new SimpleListItem(Empty, "<none>")
     }.Union(
                ElectionsPoliticians.GetPoliticiansForOfficeInElection(electionKey, officeKey).Rows
                .Cast <DataRow>().Select(row =>
                                         new SimpleListItem(row.PoliticianKey(), Politicians.FormatName(row)))).ToList());
 }
Exemplo n.º 2
0
 public List <VoteUsaCandidate> GetVoteUsaCandidates(string electionKey,
                                                     string officeKey) =>
 ElectionsPoliticians
 .GetPoliticiansForOfficeInElection(electionKey, officeKey)
 .Rows.Cast <DataRow>()
 .Select(
     row =>
     new VoteUsaCandidate
 {
     Value      = row.PoliticianKey(),
     Text       = Politicians.FormatName(row),
     FirstThree = row.LastName().Substring(0,
                                           Math.Min(3, row.LastName().Length)).ToLowerInvariant()
 })
 .ToList();