Example #1
0
        public void AddVotingCard(VotingCard votingCard)
        {
            if (votingCard == null)
            {
                throw new ArgumentNullException();
            }

            VotingCards.Add(votingCard);
        }
Example #2
0
        public void CreateVotingCards(List <Candidate> candidates)
        {
            if (candidates == null)
            {
                throw new ArgumentNullException("Candidates is null");
            }

            VotingCards.Clear();

            var bodCandidates = candidates.Where(c => c.CandidateType == CandidateType.BODCandidate).ToList();

            VotingCards.Add(new VotingCard(this, bodCandidates, VotingCardType.BODVotingCard));

            var bosCandidates = candidates.Where(c => c.CandidateType == CandidateType.BOSCandidate).ToList();

            VotingCards.Add(new VotingCard(this, bosCandidates, VotingCardType.BOSVotingCard));
        }