예제 #1
0
        public Election GetElectionByID(int id)
        {
            Election election = DTOConvertor.GetElectionFromDTO(electionRepository.GetElectionByID(id));

            election.PartyProfiles = DTOConvertor.GetPartyProfilesFromDTO(electionRepository.GetAllPartyProfiles(DTOConvertor.GetElectionDTO(election)));
            return(election);
        }
예제 #2
0
        public Party GetPartyByID(int id)
        {
            Party party = DTOConvertor.GetPartyFromDTO(partyRepository.GetPartyByID(id));

            party.History = DTOConvertor.GetPartyList(partyRepository.GetPartyHistory(DTOConvertor.GetPartyDTO(party)));
            return(party);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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));
        }
예제 #5
0
        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());
        }
예제 #6
0
 public List <Party> Search(string searchQuery)
 {
     return(DTOConvertor.GetPartyList(partyRepository.Search(searchQuery)));
 }
예제 #7
0
 public void CreateParty(Party party)
 {
     partyRepository.CreateParty(DTOConvertor.GetPartyDTO(party));
 }
예제 #8
0
 public void CreatePartyProfile(int id, PartyProfile partyProfile)
 {
     electionRepository.CreatePartyProfile(id, DTOConvertor.GetPartyProfileDTO(partyProfile));
 }
예제 #9
0
 public List <Election> GetAllElections()
 {
     return(DTOConvertor.GetElectionList(electionRepository.GetAllElections()));
 }
예제 #10
0
 public void CreateElection(Election election)
 {
     electionRepository.CreateElection(DTOConvertor.GetElectionDTO(election));
 }