Beispiel #1
0
        public AddressSettings GetAddressSettings(int portalID)
        {
            AddressSettings addressSettings = (AddressSettings)DataCache.GetCache("StoreDefaultAddressSettings" + portalID);

            if (addressSettings == null)
            {
                using (IDataReader reader = DataProvider.Instance().ExecuteReader("Store_Administration_GetAddressSettings", portalID))
                {
                    if (reader != null)
                    {
                        if (reader.Read())
                        {
                            string settings = "";
                            settings = (string)Null.SetNull(reader["DefaultAddressSettings"], settings);
                            if (!string.IsNullOrEmpty(settings))
                            {
                                addressSettings = (AddressSettings)ProviderSettingsHelper.DeserializeSettings(settings, typeof(AddressSettings));
                                DataCache.SetCache("StoreDefaultAddressSettings", addressSettings);
                            }
                        }
                        reader.Close();
                    }
                }
                if (addressSettings == null)
                {
                    addressSettings = new AddressSettings();
                }
            }
            return(addressSettings);
        }
Beispiel #2
0
        public void Fill(System.Data.IDataReader dr)
        {
            KeyID            = Convert.ToInt32(dr["PortalID"]);
            DefaultTaxRate   = Convert.ToDecimal(Null.SetNull(dr["DefaultTaxRate"], DefaultTaxRate));
            ShowTax          = Convert.ToBoolean(dr["ShowTax"]);
            _defaultTaxRates = Convert.ToString(Null.SetNull(dr["DefaultTaxRates"], _defaultTaxRates));
            if (!string.IsNullOrEmpty(_defaultTaxRates))
            {
                CountryTaxes = (CountryTaxRates)ProviderSettingsHelper.DeserializeSettings(_defaultTaxRates, typeof(CountryTaxRates));
            }

            if (CountryTaxes == null)
            {
                CountryTaxes = new CountryTaxRates();
            }
        }