コード例 #1
0
        private void BindGrid()
        {
            TaxProviderCollection taxProviders = TaxProviderManager.GetAllTaxProviders();

            gvTaxProviders.DataSource = taxProviders;
            gvTaxProviders.DataBind();
        }
コード例 #2
0
        private static TaxProviderCollection DBMapping(DBTaxProviderCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new TaxProviderCollection();

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

            return(collection);
        }
コード例 #3
0
        /// <summary>
        /// Gets all tax providers
        /// </summary>
        /// <returns>Shipping rate computation method collection</returns>
        public static TaxProviderCollection GetAllTaxProviders()
        {
            string key  = string.Format(TAXPROVIDERS_ALL_KEY);
            object obj2 = NopCache.Get(key);

            if (TaxProviderManager.CacheEnabled && (obj2 != null))
            {
                return((TaxProviderCollection)obj2);
            }

            DBTaxProviderCollection dbCollection = DBProviderManager <DBTaxProviderProvider> .Provider.GetAllTaxProviders();

            TaxProviderCollection taxProviderCollection = DBMapping(dbCollection);

            if (TaxProviderManager.CacheEnabled)
            {
                NopCache.Max(key, taxProviderCollection);
            }
            return(taxProviderCollection);
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:TaxService"/> class.
 /// </summary>
 public TaxService()
 {
     _taxProviderCollection = new TaxProviderCollection();
       LoadProviders();
 }