protected void btnSure_Click(object sender, EventArgs e)
 {
     SystemWholeXmlConfig entity = new SystemWholeXmlConfig();
     WebFormHelper.GetDataFromForm(this, entity);
     entity.Valid = this.rblState.SelectedIndex;
     SystemWholeXmlConfigManager.SaveConfig(entity);
     WebTools.Alert(this, "配置系统参数成功!");
 }
Esempio n. 2
0
 /// <summary>
 /// 获取有效的配置项
 /// </summary>
 /// <param name="key">配置项的key</param>
 /// <returns>配置项的value</returns>
 public static string GetConfig(string key)
 {
     EnsureLoaded();
     if (!caches.Contains(key))
     {
         return(string.Empty);
     }
     else
     {
         SystemWholeXmlConfig config = ((SystemWholeXmlConfig)caches[key]);
         if (config.Valid == 1)
         {
             return(config.Value);
         }
         return(string.Empty);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 对新增或者修改的配置项进行保存配置
 /// </summary>
 /// <param name="config">新增或者修改的配置项</param>
 public static void SaveConfig(SystemWholeXmlConfig config)
 {
     EnsureLoaded();
     caches[config.Key] = config;
     SaveConfig();
 }
 /// <summary>
 /// 对新增或者修改的配置项进行保存配置
 /// </summary>
 /// <param name="config">新增或者修改的配置项</param>
 public static void SaveConfig(SystemWholeXmlConfig config)
 {
     EnsureLoaded();
     caches[config.Key]=config;
     SaveConfig();
 }