Example #1
0
 public bool CastVote(Dem2Model.Voting onWhat, Vote vote)
 {
     bool voteRegistered = onWhat.RegisterVote(vote);
     if (voteRegistered)
     {
         VoteCast(this, onWhat, vote);
     }
     return voteRegistered;
 }
Example #2
0
 public bool CastVoteFromLeader(IVotingLeader leader, Voting onWhat, Vote vote)
 {
     bool voteRegistered = onWhat.RegisterVote(vote);
     if (voteRegistered)
     {
         VoteCast(this, onWhat, vote);
     }
     return voteRegistered;
 }
Example #3
0
        public override bool RegisterVote(Vote vote)
        {
            {

                if (this.State == VotingStates.Ongoing)
                {
                    return EntityRepository.Add(vote);
                }
                else
                {
                    return false;
                }
            }
        }
Example #4
0
        public bool Equals(Vote second)
        {
            // If parameter is null return false:
            if ((object)second == null)
            {
                return false;
            }

            // Return true if the fields match:
            return OwnerId.Equals(second.OwnerId) && subjectId == second.subjectId;
        }
Example #5
0
 public virtual bool RegisterVote(Vote vote) {
     return EntityRepository.Add(vote);
 }