示例#1
0
        /// <summary>
        /// Gets all localized topics
        /// </summary>
        /// <param name="TopicName">topic name</param>
        /// <returns>Localized topic collection</returns>
        public static LocalizedTopicCollection GetAllLocalizedTopics(string TopicName)
        {
            DBLocalizedTopicCollection dbCollection = DBProviderManager <DBTopicProvider> .Provider.GetAllLocalizedTopics(TopicName);

            LocalizedTopicCollection localizedTopics = DBMapping(dbCollection);

            return(localizedTopics);
        }
示例#2
0
        public static LocalizedTopicCollection TopicLocalizedLoadAllOnHomePage()
        {
            DBLocalizedTopicCollection dbItemCollection =
                DBProviderManager <DBTopicProvider> .Provider.TopicLocalizedLoadAllOnHomePage();

            LocalizedTopicCollection localizedTopicCollection = DBMapping(dbItemCollection);

            return(localizedTopicCollection);
        }
示例#3
0
        private static LocalizedTopicCollection DBMapping(DBLocalizedTopicCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            LocalizedTopicCollection collection = new LocalizedTopicCollection();
            foreach (DBLocalizedTopic dbItem in dbCollection)
            {
                LocalizedTopic item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
        /// <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);
        }
示例#5
0
        private static LocalizedTopicCollection DBMapping(DBLocalizedTopicCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new LocalizedTopicCollection();

            foreach (var dbItem in dbCollection)
            {
                var item = DBMapping(dbItem);
                collection.Add(item);
            }

            return(collection);
        }
示例#6
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);
        }