Пример #1
0
        /// <summary>
        /// Gets a poll answers by poll identifier
        /// </summary>
        /// <param name="PollID">Poll identifier</param>
        /// <returns>Poll answer collection</returns>
        public override DBPollAnswerCollection GetPollAnswersByPollID(int PollID)
        {
            DBPollAnswerCollection pollAnswerCollection = new DBPollAnswerCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_PollAnswerLoadByPollID");

            db.AddInParameter(dbCommand, "PollID", DbType.Int32, PollID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBPollAnswer pollAnswer = GetPollAnswerFromReader(dataReader);
                    pollAnswerCollection.Add(pollAnswer);
                }
            }

            return(pollAnswerCollection);
        }
Пример #2
0
        /// <summary>
        /// Gets a poll answers by poll identifier
        /// </summary>
        /// <param name="pollId">Poll identifier</param>
        /// <returns>Poll answer collection</returns>
        public override DBPollAnswerCollection GetPollAnswersByPollId(int pollId)
        {
            var       result    = new DBPollAnswerCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_PollAnswerLoadByPollID");

            db.AddInParameter(dbCommand, "PollID", DbType.Int32, pollId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetPollAnswerFromReader(dataReader);
                    result.Add(item);
                }
            }

            return(result);
        }
Пример #3
0
        /// <summary>
        /// Gets a poll answers by poll identifier
        /// </summary>
        /// <param name="PollID">Poll identifier</param>
        /// <returns>Poll answer collection</returns>
        public override DBPollAnswerCollection GetPollAnswersByPollID(int PollID)
        {
            DBPollAnswerCollection pollAnswerCollection = new DBPollAnswerCollection();
            Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_PollAnswerLoadByPollID");
            db.AddInParameter(dbCommand, "PollID", DbType.Int32, PollID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBPollAnswer pollAnswer = GetPollAnswerFromReader(dataReader);
                    pollAnswerCollection.Add(pollAnswer);
                }
            }

            return pollAnswerCollection;
        }