Example #1
0
        public ActionResult UpdateMembershipSetting(string fieldName, string newValue)
        {
            SettingDefinition settingDef = _settingService.GetSettingDefinitionByName("MembershipSetting");
            SettingValue      settingVal = _settingService.SelectSettingValues(string.Empty, settingDef.Id).First();

            settingVal.Set(settingDef, fieldName, newValue);
            _settingService.UpdateSettingValue(settingVal);
            _cacheService.Clear();

            return(new EmptyResult());
        }
Example #2
0
        public ActionResult UpdateApplicationSetting(string name, string newValue)
        {
            SettingDefinition settingDef   = _settingService.GetSettingDefinitionByName("AppSetting");
            SettingValue      settingValue = _settingService.SelectSettingValues(null, settingDef.Id)
                                             .Where(s => s.Get(settingDef, "Name") == name)
                                             .First();

            settingValue.Set(settingDef, "Value", newValue);
            _settingService.UpdateSettingValue(settingValue);
            _cacheService.Clear();

            return(new EmptyResult());
        }