Esempio n. 1
0
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys
        /// </summary>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public static ShippingByWeightAndCountryCollection GetAll()
        {
            DBShippingByWeightAndCountryCollection dbCollection = DBProviderManager <DBShippingByWeightAndCountryProvider> .Provider.GetAll();

            ShippingByWeightAndCountryCollection collection = DBMapping(dbCollection);

            return(collection);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys by shipping method identifier
        /// </summary>
        /// <param name="ShippingMethodID">The shipping method identifier</param>
        /// <param name="CountryID">The country identifier</param>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public static ShippingByWeightAndCountryCollection GetAllByShippingMethodIDAndCountryID(int ShippingMethodID, int CountryID)
        {
            DBShippingByWeightAndCountryCollection dbCollection = DBProviderManager <DBShippingByWeightAndCountryProvider> .Provider.GetAllByShippingMethodIDAndCountryID(ShippingMethodID, CountryID);

            ShippingByWeightAndCountryCollection collection = DBMapping(dbCollection);

            return(collection);
        }
        private static ShippingByWeightAndCountryCollection DBMapping(DBShippingByWeightAndCountryCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            ShippingByWeightAndCountryCollection collection = new ShippingByWeightAndCountryCollection();
            foreach (DBShippingByWeightAndCountry dbItem in dbCollection)
            {
                ShippingByWeightAndCountry item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys
        /// </summary>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public override DBShippingByWeightAndCountryCollection GetAll()
        {
            DBShippingByWeightAndCountryCollection shippingByWeightAndCountryCollection = new DBShippingByWeightAndCountryCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingByWeightAndCountry shippingByWeightAndCountry = GetShippingByWeightAndCountryFromReader(dataReader);
                    shippingByWeightAndCountryCollection.Add(shippingByWeightAndCountry);
                }
            }

            return(shippingByWeightAndCountryCollection);
        }
Esempio n. 5
0
        private static ShippingByWeightAndCountryCollection DBMapping(DBShippingByWeightAndCountryCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new ShippingByWeightAndCountryCollection();

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

            return(collection);
        }
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys by shipping method identifier
        /// </summary>
        /// <param name="ShippingMethodID">The shipping method identifier</param>
        /// <param name="CountryID">The country identifier</param>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public override DBShippingByWeightAndCountryCollection GetAllByShippingMethodIDAndCountryID(int ShippingMethodID, int CountryID)
        {
            DBShippingByWeightAndCountryCollection shippingByWeightAndCountryCollection = new DBShippingByWeightAndCountryCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadByShippingMethodIDAndCountryID");

            db.AddInParameter(dbCommand, "ShippingMethodID", DbType.Int32, ShippingMethodID);
            db.AddInParameter(dbCommand, "CountryID", DbType.Int32, CountryID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingByWeightAndCountry shippingByWeightAndCountry = GetShippingByWeightAndCountryFromReader(dataReader);
                    shippingByWeightAndCountryCollection.Add(shippingByWeightAndCountry);
                }
            }

            return(shippingByWeightAndCountryCollection);
        }
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys by shipping method identifier
        /// </summary>
        /// <param name="shippingMethodId">The shipping method identifier</param>
        /// <param name="countryId">The country identifier</param>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public override DBShippingByWeightAndCountryCollection GetAllByShippingMethodIdAndCountryId(int shippingMethodId, int countryId)
        {
            var       result    = new DBShippingByWeightAndCountryCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadByShippingMethodIDAndCountryID");

            db.AddInParameter(dbCommand, "ShippingMethodID", DbType.Int32, shippingMethodId);
            db.AddInParameter(dbCommand, "CountryID", DbType.Int32, countryId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetShippingByWeightAndCountryFromReader(dataReader);
                    result.Add(item);
                }
            }

            return(result);
        }
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys by shipping method identifier
        /// </summary>
        /// <param name="ShippingMethodID">The shipping method identifier</param>
        /// <param name="CountryID">The country identifier</param>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public override DBShippingByWeightAndCountryCollection GetAllByShippingMethodIDAndCountryID(int ShippingMethodID, int CountryID)
        {
            DBShippingByWeightAndCountryCollection shippingByWeightAndCountryCollection = new DBShippingByWeightAndCountryCollection();
            Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadByShippingMethodIDAndCountryID");
            db.AddInParameter(dbCommand, "ShippingMethodID", DbType.Int32, ShippingMethodID);
            db.AddInParameter(dbCommand, "CountryID", DbType.Int32, CountryID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingByWeightAndCountry shippingByWeightAndCountry = GetShippingByWeightAndCountryFromReader(dataReader);
                    shippingByWeightAndCountryCollection.Add(shippingByWeightAndCountry);
                }
            }

            return shippingByWeightAndCountryCollection;
        }
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys
        /// </summary>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public override DBShippingByWeightAndCountryCollection GetAll()
        {
            DBShippingByWeightAndCountryCollection shippingByWeightAndCountryCollection = new DBShippingByWeightAndCountryCollection();
            Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadAll");
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingByWeightAndCountry shippingByWeightAndCountry = GetShippingByWeightAndCountryFromReader(dataReader);
                    shippingByWeightAndCountryCollection.Add(shippingByWeightAndCountry);
                }
            }

            return shippingByWeightAndCountryCollection;
        }