Ejemplo n.º 1
0
        // OPT00020100219
        // Obtenir toutes les Reponse d'une Question
        public static PollAnswerCollection GetByPollQuestionID(Guid questionID)
        {
            DataSet      ds    = new DataSet();
            SqlParameter param = new SqlParameter();

            param       = new SqlParameter("@QuestionID", SqlDbType.UniqueIdentifier);
            param.Value = questionID;

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

            PollAnswerCollection oc = new PollAnswerCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                PollAnswer o = PollAnswer.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }
Ejemplo n.º 2
0
        public static PollAnswer GetByPollAnswerID(Guid pollAnswerID)
        {
            if (pollAnswerID == Guid.Empty)
            {
                return(null);
            }
            PollAnswerCollection pac = PollAnswerCollection.GetAll();

            foreach (PollAnswer pa in pac)
            {
                if (pa.PollAnswerId == pollAnswerID)
                {
                    return(pa);
                }
            }
            return(null);
        }
Ejemplo n.º 3
0
        // Optimisation
        public PollAnswerCollection FindByPollQuestionID(Guid pollQuestionId)
        {
            if (pollQuestionId == Guid.Empty)
            {
                return(null);
            }
            PollAnswerCollection newpac = new PollAnswerCollection();

            foreach (PollAnswer pa in this)
            {
                if (pa.PollQuestionId == pollQuestionId)
                {
                    newpac.Add(pa);
                }
            }

            return(newpac);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// SELECT * FROM PollAnswers ORDER BY Rank ASC
        /// </summary>
        public static PollAnswerCollection GetAll()
        {
            DataSet ds = new DataSet();

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

            PollAnswerCollection oc = new PollAnswerCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                PollAnswer o = PollAnswer.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }
Ejemplo n.º 5
0
        public static PollAnswerCollection GetByPollQuestionID(Guid pollQuestionId)
        {
            if (pollQuestionId == Guid.Empty)
            {
                return(null);
            }
            //PollAnswerCollection pac = PollAnswerCollection.GetAll();
            //PollAnswerCollection newpac = new PollAnswerCollection();
            //foreach ( PollAnswer pa in pac )
            //{
            //    if ( pa.PollQuestionId == pollQuestionId )
            //    {
            //        newpac.Add( pa );
            //    }
            //}

            // OPT00020100219
            PollAnswerCollection newpac = PollAnswerDAL.GetByPollQuestionID(pollQuestionId);

            return(newpac);
        }