/// <summary>
        /// Gets all topics shows on the home page
        /// </summary>
        /// <returns>Localized topic collection</returns>
        public override DBLocalizedTopicCollection TopicLocalizedLoadAllOnHomePage()
        {
            DBLocalizedTopicCollection localizedTopics = new DBLocalizedTopicCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_TopicLocalizedLoadAllOnHomePage");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBLocalizedTopic localizedTopic = GetLocalizedTopicFromReader(dataReader);
                    localizedTopics.Add(localizedTopic);
                }
            }
            return(localizedTopics);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets all localized topics
        /// </summary>
        /// <param name="topicName">Topic name</param>
        /// <returns>Localized topic collection</returns>
        public override DBLocalizedTopicCollection GetAllLocalizedTopics(string topicName)
        {
            var       result    = new DBLocalizedTopicCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_TopicLocalizedLoadAllByName");

            db.AddInParameter(dbCommand, "Name", DbType.String, topicName);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetLocalizedTopicFromReader(dataReader);
                    result.Add(item);
                }
            }
            return(result);
        }