Exemplo n.º 1
0
 public static BundeslandWithWahlkreiseViewModel<WahlkreisViewModel> GetBundeslandListViewModel(Bundesland bundesland,
     IEnumerable<Wahlkrei> wahlkreise)
 {
     return new BundeslandWithWahlkreiseViewModel<WahlkreisViewModel>
     {
         Bundesland = new BundeslandViewModel
         {
             Id  = bundesland.Id,
             Name = bundesland.Name
         },
         Wahlkreise = GetWahlkreisListViewModels(wahlkreise).ToList().OrderBy(r => r)
     };
 }
Exemplo n.º 2
0
 public static WahlkreisOverviewViewModel GetWahlkreisOverviewViewModel(int electionId, Bundesland bundesland,
     BasicWahlkreisOverview overview, IEnumerable<ErststimmeWahlkreisOverview> firstVotes,
     IEnumerable<ZweitstimmeWahlkreisOverview> secondVotes)
 {
     return new WahlkreisOverviewViewModel
     {
         ElectionId = electionId,
         Bundesland = new BundeslandViewModel
         {
             Id = bundesland.Id,
             Name = bundesland.Name
         },
         Wahlkreis = new WahlkreisViewModel
         {
             Id = overview.Wahlkreis_Id,
             Name = overview.Wahlkreis_Name
         },
         Participation = overview.Participation ?? -1,
         Candidate = new PersonWithPartyViewModel
         {
             Person = new PersonViewModel
             {
                 Id = overview.Person_Id ?? -1,
                 Title = overview.Title,
                 Firstname = overview.Firstname,
                 Lastname = overview.Lastname
             },
             Party = new PartyViewModel
             {
                 Id = overview.Party_Id,
                 Name = overview.Party_Name
             }
         },
         FirstVotes = GetWahlkreisFirstVotesViewModels(electionId, overview.Wahlkreis_Id, firstVotes).ToList().OrderBy(r => r),
         SecondVotes = GetWahlkreisSecondVotesViewModels(electionId, overview.Wahlkreis_Id, secondVotes).ToList().OrderBy(r => r)
     };
 }