コード例 #1
0
ファイル: Store.cs プロジェクト: thenotandy/DNNspot.Store
        public string GetSetting(StoreSettingNames settingName)
        {
            if (this.settings == null)
            {
                LoadSettings();
            }

            return(settings.TryGetValueOrEmpty(settingName.ToString()));
        }
コード例 #2
0
ファイル: Store.cs プロジェクト: thenotandy/DNNspot.Store
        public void UpdateSetting(StoreSettingNames settingName, string value)
        {
            StoreSetting setting = new StoreSetting();

            if (setting.LoadByPrimaryKey(this.Id.Value, settingName.ToString()))
            {
                setting.Value = value;
            }
            else
            {
                setting.StoreId = this.Id.Value;
                setting.Name    = settingName.ToString();
                setting.Value   = value;
            }
            setting.Save();
        }
コード例 #3
0
ファイル: Store.cs プロジェクト: thenotandy/DNNspot.Store
 public int?GetSettingInt(StoreSettingNames settingName)
 {
     return(WA.Parser.ToInt(GetSetting(settingName)));
 }
コード例 #4
0
ファイル: Store.cs プロジェクト: thenotandy/DNNspot.Store
 public bool?GetSettingBool(StoreSettingNames settingName)
 {
     return(WA.Parser.ToBool(GetSetting(settingName)));
 }