public Election GetElectionByID(int id) { Election election = DTOConvertor.GetElectionFromDTO(electionRepository.GetElectionByID(id)); election.PartyProfiles = DTOConvertor.GetPartyProfilesFromDTO(electionRepository.GetAllPartyProfiles(DTOConvertor.GetElectionDTO(election))); return(election); }
public Party GetPartyByID(int id) { Party party = DTOConvertor.GetPartyFromDTO(partyRepository.GetPartyByID(id)); party.History = DTOConvertor.GetPartyList(partyRepository.GetPartyHistory(DTOConvertor.GetPartyDTO(party))); return(party); }
public List <Party> GetAllParties() { List <Party> parties = DTOConvertor.GetPartyList(partyRepository.GetAllParties()); foreach (Party party in parties) { party.History = DTOConvertor.GetPartyList(partyRepository.GetPartyHistory(DTOConvertor.GetPartyDTO(party))); } return(parties); }
public void CreateSameNameElection() { Election election = new Election { Name = "Tweede Kamerverkiezingen 2017", DistributableSeats = 150, Date = DateTime.Now, PartyProfiles = new List <PartyProfile>() }; electionRepository.CreateElection(DTOConvertor.GetElectionDTO(election)); }
public void CreateParty() { Party party = new Party { Abbreviation = "PP", Name = "Piraten partij", Leader = "Ancilla Tilia" }; partyRepository.CreateParty(DTOConvertor.GetPartyDTO(party)); Assert.IsTrue(partyRepository.GetAllParties().Any()); }
public List <Party> Search(string searchQuery) { return(DTOConvertor.GetPartyList(partyRepository.Search(searchQuery))); }
public void CreateParty(Party party) { partyRepository.CreateParty(DTOConvertor.GetPartyDTO(party)); }
public void CreatePartyProfile(int id, PartyProfile partyProfile) { electionRepository.CreatePartyProfile(id, DTOConvertor.GetPartyProfileDTO(partyProfile)); }
public List <Election> GetAllElections() { return(DTOConvertor.GetElectionList(electionRepository.GetAllElections())); }
public void CreateElection(Election election) { electionRepository.CreateElection(DTOConvertor.GetElectionDTO(election)); }