Ejemplo n.º 1
0
        /// <summary>
        /// Gets all countries that allow shipping
        /// </summary>
        /// <returns>Country collection</returns>
        public override DBCountryCollection GetAllCountriesForShipping(bool showHidden)
        {
            var       result    = new DBCountryCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_CountryLoadAllForShipping");

            db.AddInParameter(dbCommand, "ShowHidden", DbType.Boolean, showHidden);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetCountryFromReader(dataReader);
                    result.Add(item);
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets all countries that allow registration
        /// </summary>
        /// <returns>Country collection</returns>
        public override DBCountryCollection GetAllCountriesForRegistration(bool showHidden)
        {
            DBCountryCollection countryCollection = new DBCountryCollection();
            Database            db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand           dbCommand = db.GetStoredProcCommand("Nop_CountryLoadAllForRegistration");

            db.AddInParameter(dbCommand, "ShowHidden", DbType.Boolean, showHidden);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBCountry country = GetCountryFromReader(dataReader);
                    countryCollection.Add(country);
                }
            }
            return(countryCollection);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets all countries that allow shipping
 /// </summary>
 /// <returns>Country collection</returns>
 public override DBCountryCollection GetAllCountriesForShipping(bool showHidden)
 {
     DBCountryCollection countryCollection = new DBCountryCollection();
     Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
     DbCommand dbCommand = db.GetStoredProcCommand("Nop_CountryLoadAllForShipping");
     db.AddInParameter(dbCommand, "ShowHidden", DbType.Boolean, showHidden);
     using (IDataReader dataReader = db.ExecuteReader(dbCommand))
     {
         while (dataReader.Read())
         {
             DBCountry country = GetCountryFromReader(dataReader);
             countryCollection.Add(country);
         }
     }
     return countryCollection;
 }