예제 #1
0
        /// <summary>
        /// Gets all customer actions
        /// </summary>
        /// <returns>Customer action collection</returns>
        public override DBCustomerActionCollection GetAllCustomerActions()
        {
            var       result    = new DBCustomerActionCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_CustomerActionLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetCustomerActionFromReader(dataReader);
                    result.Add(item);
                }
            }

            return(result);
        }
예제 #2
0
        private static CustomerActionCollection DBMapping(DBCustomerActionCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new CustomerActionCollection();

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

            return(collection);
        }