Exemplo n.º 1
0
        // OPT00020100219
        // Voila une procedure qui prend 100 ms au bas mot lorsque l'on a 1300 votes
        public static int NumberOfVotesByAnswer(Guid answerID)
        {
            // OPT00020100219int count = 0;
            //PollVoteCollection pvc = PollVoteCollection.GetAll();
            //foreach ( PollVote pv in pvc )
            //{
            //    if ( pv.PollAnswerId == answerID )
            //    {
            //        count += 1;
            //    }
            //}

            PollVoteCollection pvc = PollVoteDAL.GetPollVoteByPollAnswerID(answerID);

            return(pvc.Count);
        }
Exemplo n.º 2
0
        // Trouver les Votes pour une Reponse donnee
        public static PollVoteCollection GetVotes(Guid answerID)
        {
            //PollVoteCollection pvc = PollVoteCollection.GetAll();
            //PollVoteCollection newpvc = new PollVoteCollection();
            //foreach ( PollVote pv in pvc )
            //{
            //    if ( pv.PollAnswerId == answerID )
            //    {
            //        newpvc.Add( pv );
            //    }
            //}

            // OPT00020100219
            PollVoteCollection newpvc = PollVoteDAL.GetPollVoteByPollAnswerID(answerID);

            return(newpvc);
        }