示例#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);
        }