Пример #1
0
 internal void SetProp(string name, decimal value)
 {
     StoreSetting result = new StoreSetting();
     result.StoreId = this._Store.Id;
     result.SettingName = name;
     result.ValueAsDecimal = value;
     AddOrUpdateLocalSetting(result);            
 }
Пример #2
0
        internal void SetProp(string name, decimal value)
        {
            StoreSetting result = new StoreSetting();

            result.StoreId        = this._Store.Id;
            result.SettingName    = name;
            result.ValueAsDecimal = value;
            AddOrUpdateLocalSetting(result);
        }
Пример #3
0
        internal StoreSetting GetSetting(string name)
        {
            // Search local settings storage for setting
            var s = this.AllSettings.Where(y => y.SettingName == name).FirstOrDefault();

            if (s == null)
            {
                s = new StoreSetting();
            }
            return((StoreSetting)s);
        }
Пример #4
0
        internal bool GetPropBoolWithDefault(string name, bool defaultValue)
        {
            StoreSetting s = GetSetting(name);

            if (s.SettingValue == string.Empty)
            {
                SetProp(name, defaultValue);
                return(defaultValue);
            }
            return(s.ValueAsBool);
        }
Пример #5
0
 // Keeps local settings synchronized with updates during a single request
 // Does not update database
 public void AddOrUpdateLocalSetting(StoreSetting s)
 {
     // Search local settings storage for setting
     var found = this.AllSettings.Where(y => y.SettingName == s.SettingName).FirstOrDefault();
     if (found == null)
     {
         this.AllSettings.Add(s);
     }
     else
     {
         s.Id = found.Id; // Set Id so we'll get a database update instead of insert
         this.AllSettings[this.AllSettings.IndexOf(found)] = s;
     }
 }
Пример #6
0
        internal string GetPropEncrypted(string name)
        {
            StoreSetting s      = GetSetting(name);
            string       result = string.Empty;

            result = s.SettingValue;
            MerchantTribe.Web.Cryptography.TripleDesEncryption crypto = new MerchantTribe.Web.Cryptography.TripleDesEncryption();
            if (result != string.Empty)
            {
                result = crypto.Decode(result);
            }
            crypto = null;
            return(result);
        }
Пример #7
0
        // Keeps local settings synchronized with updates during a single request
        // Does not update database
        public void AddOrUpdateLocalSetting(StoreSetting s)
        {
            // Search local settings storage for setting
            var found = this.AllSettings.Where(y => y.SettingName == s.SettingName).FirstOrDefault();

            if (found == null)
            {
                this.AllSettings.Add(s);
            }
            else
            {
                s.Id = found.Id; // Set Id so we'll get a database update instead of insert
                this.AllSettings[this.AllSettings.IndexOf(found)] = s;
            }
        }
Пример #8
0
 internal StoreSetting GetSetting(string name)
 {
     // Search local settings storage for setting
     var s = this.AllSettings.Where(y => y.SettingName == name).FirstOrDefault();
     if (s == null) s = new StoreSetting();
     return (StoreSetting)s;
 }
Пример #9
0
        internal long GetPropLong(string name)
        {
            StoreSetting s = GetSetting(name);

            return(s.ValueAsLong);
        }
Пример #10
0
        internal decimal GetPropDecimalWithDefault(string name)
        {
            StoreSetting s = GetSetting(name);

            return(s.ValueAsDecimal);
        }
Пример #11
0
        internal int GetPropInt(string name)
        {
            StoreSetting s = GetSetting(name);

            return(s.ValueAsInteger);
        }
Пример #12
0
        internal bool GetPropBool(string name)
        {
            StoreSetting s = GetSetting(name);

            return(s.ValueAsBool);
        }
Пример #13
0
        internal string GetProp(string name)
        {
            StoreSetting s = GetSetting(name);

            return(s.SettingValue);
        }