private static ShippingStatusCollection DBMapping(DBShippingStatusCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            ShippingStatusCollection collection = new ShippingStatusCollection();
            foreach (DBShippingStatus dbItem in dbCollection)
            {
                ShippingStatus item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
Beispiel #2
0
        private static ShippingStatusCollection DBMapping(DBShippingStatusCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new ShippingStatusCollection();

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

            return(collection);
        }
Beispiel #3
0
        /// <summary>
        /// Gets all shipping statuses
        /// </summary>
        /// <returns>Shipping status collection</returns>
        public override DBShippingStatusCollection GetAllShippingStatuses()
        {
            DBShippingStatusCollection shippingStatusCollection = new DBShippingStatusCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingStatusLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingStatus shippingStatus = GetShippingStatusFromReader(dataReader);
                    shippingStatusCollection.Add(shippingStatus);
                }
            }

            return(shippingStatusCollection);
        }
        /// <summary>
        /// Gets all shipping statuses
        /// </summary>
        /// <returns>Shipping status collection</returns>
        public static ShippingStatusCollection GetAllShippingStatuses()
        {
            string key  = string.Format(SHIPPINGTATUSES_ALL_KEY);
            object obj2 = NopCache.Get(key);

            if (ShippingStatusManager.CacheEnabled && (obj2 != null))
            {
                return((ShippingStatusCollection)obj2);
            }

            DBShippingStatusCollection dbCollection = DBProviderManager <DBShippingStatusProvider> .Provider.GetAllShippingStatuses();

            ShippingStatusCollection shippingStatusCollection = DBMapping(dbCollection);

            if (ShippingStatusManager.CacheEnabled)
            {
                NopCache.Max(key, shippingStatusCollection);
            }
            return(shippingStatusCollection);
        }