Example #1
0
        // OPT00020100219
        public static PollVoteCollection GetPollVoteByPollAnswerID(Guid pollAnswerID)
        {
            DataSet      ds    = new DataSet();
            SqlParameter param = new SqlParameter();

            param       = new SqlParameter("@PollAnswerID", SqlDbType.UniqueIdentifier);
            param.Value = pollAnswerID;

            ds = SqlDataProvider.ExecuteDataset
                 (
                Tools.DatabaseConnectionString,
                CommandType.StoredProcedure,
                "GetPollVoteByPollAnswerID",
                param
                 );

            PollVoteCollection oc = new PollVoteCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                PollVote o = PollVote.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }
Example #2
0
        public static PollVoteCollection GetPollVotes(int questionnaireID, Guid personneGUID)
        {
            SqlParameter[] parameters = new SqlParameter[2];
            parameters[0]       = new SqlParameter("@QuestionnaireID", SqlDbType.Int);
            parameters[0].Value = questionnaireID;
            parameters[1]       = new SqlParameter("@UserGUID", SqlDbType.UniqueIdentifier);
            parameters[1].Value = personneGUID;

            DataSet ds = SqlDataProvider.ExecuteDataset
                         (
                Tools.DatabaseConnectionString,
                CommandType.StoredProcedure,
                "GetPollVotes",
                parameters
                         );

            PollVoteCollection oc = new PollVoteCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                PollVote o = PollVote.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }
Example #3
0
        // Lorsque l'on boucle sur toutes les Personne d'un Questionnaire > 500
        // l'utilisation de GetPollVotes lance un procedure stockee 500 fois
        // ce n'est pas optimum on va preferer lancer une fois GetPollVotesByQuestionnaireID
        // et utiliser cette fonction
        public PollVoteCollection FindByPersonneGUID(Guid userGUID)
        {
            PollVoteCollection newpvc = new PollVoteCollection();

            foreach (PollVote pv in this)
            {
                if (pv.UserGUID == userGUID)
                {
                    newpvc.Add(pv);
                }
            }
            return(newpvc);
        }
Example #4
0
        // Trouver les Votes pour une Reponse donnee dans la Collection
        public PollVoteCollection FindByAnswerID(Guid answerID)
        {
            PollVoteCollection newpvc = new PollVoteCollection();

            foreach (PollVote pv in this)
            {
                if (pv.PollAnswerId == answerID)
                {
                    newpvc.Add(pv);
                }
            }
            return(newpvc);
        }
Example #5
0
        public static PollVoteCollection GetAll()
        {
            DataSet ds = new DataSet();

            ds = SqlDataProvider.ExecuteDataset
                 (
                Tools.DatabaseConnectionString,
                CommandType.StoredProcedure,
                "GetPollVoteAll"
                 );

            PollVoteCollection oc = new PollVoteCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                PollVote o = PollVote.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }