예제 #1
0
 /// <summary>
 /// Saves a global C-Access setting.
 /// </summary>
 /// <param name="settingName">The name of the setting to save.</param>
 /// <param name="value">The desired value of the setting.</param>
 public void SetGlobalSetting(string settingName, string value)
 {
     using (GlobalSettingsTableAdapter ta = new GlobalSettingsTableAdapter())
     {
         ta.SaveSetting(settingName, value);
     }
 }
예제 #2
0
 /// <summary>
 /// Retrieves a global C-Access setting.
 /// </summary>
 /// <param name="settingName">The name of the setting to retrieve.</param>
 /// <returns>The value of the setting if found; otherwise, null.</returns>
 public string GetGlobalSetting(string settingName)
 {
     using (GlobalSettingsTds ds = new GlobalSettingsTds())
     {
         using (GlobalSettingsTableAdapter ta = new GlobalSettingsTableAdapter())
         {
             ta.FillBy(ds.GlobalSettings, settingName);
         }
         foreach (GlobalSettingsTds.GlobalSettingsRow row in ds.GlobalSettings.Rows)
         {
             return(row.Value);
         }
     }
     return(null);
 }