public void RemoveVote(int user)
        {
            var vote = Votes.SingleOrDefault(v => v.User.UserId == user);

            Votes.Remove(vote);
            setScore();
        }
Exemplo n.º 2
0
 public void AddVote(OptionVote optionVote)
 {
     //Dos votos son iguales si un usario ya ha votado
     if (!Votes.Contains(optionVote))
     {
         Votes.Add(optionVote);
     }
     else
     {
         Votes.Remove(optionVote);
         Votes.Add(optionVote);
     }
 }
Exemplo n.º 3
0
        public override TagVote RemoveVote(User user)
        {
            var vote = FindVote(user);

            if (vote == null)
            {
                return(null);
            }

            Votes.Remove(vote);
            Count--;

            return(vote);
        }
Exemplo n.º 4
0
        public bool AddVote(User user, VoteType type)
        {
            var foundVote = Votes.Find(v => v.UserId == user.Id);

            if (foundVote != null)
            {
                if (foundVote.Type != type)
                {
                    Votes.Remove(foundVote);
                }
                else
                {
                    return(false);
                }
            }
            Votes.Add(new Vote(user, type));
            return(true);
        }
Exemplo n.º 5
0
 public void RemoveVote(string participantId)
 {
     Votes.Remove(Votes.FirstOrDefault(x => x.GivenBy == participantId));
 }