internal void SetProp(string name, decimal value) { StoreSetting result = new StoreSetting(); result.StoreId = this._Store.Id; result.SettingName = name; result.ValueAsDecimal = value; AddOrUpdateLocalSetting(result); }
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); }
internal bool GetPropBoolWithDefault(string name, bool defaultValue) { StoreSetting s = GetSetting(name); if (s.SettingValue == string.Empty) { SetProp(name, defaultValue); return(defaultValue); } return(s.ValueAsBool); }
// 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; } }
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); }
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; }
internal long GetPropLong(string name) { StoreSetting s = GetSetting(name); return(s.ValueAsLong); }
internal decimal GetPropDecimalWithDefault(string name) { StoreSetting s = GetSetting(name); return(s.ValueAsDecimal); }
internal int GetPropInt(string name) { StoreSetting s = GetSetting(name); return(s.ValueAsInteger); }
internal bool GetPropBool(string name) { StoreSetting s = GetSetting(name); return(s.ValueAsBool); }
internal string GetProp(string name) { StoreSetting s = GetSetting(name); return(s.SettingValue); }