Ejemplo n.º 1
0
        public void AddVotingCard(VotingCard votingCard)
        {
            if (votingCard == null)
            {
                throw new ArgumentNullException();
            }

            VotingCards.Add(votingCard);
        }
Ejemplo n.º 2
0
        public void RemoveVotingCardsAndVotingByHands(int shareHolderId)
        {
            var votingCards = VotingCards.Where(v => v.ShareHolderId == shareHolderId);

            foreach (var item in votingCards)
            {
                Entry(item).State = EntityState.Deleted;
            }

            var votingByHands = VotingByHands.Where(v => v.ShareHolderId == shareHolderId);

            foreach (var item in votingByHands)
            {
                Entry(item).State = EntityState.Deleted;
            }
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 4
0
 public void RemoveAllVotingCardsAndVotingByHands()
 {
     VotingCards.Clear();
     VotingByHands.Clear();
 }