/// <summary> /// Return NULL if the [key] not found /// </summary> /// <param name="key"></param> /// <returns></returns> public static string GetConfig(string key) { baseDS.sysConfigDataTable tbl = sysConfigTA.GetByKey(key); if (tbl.Count <= 0) { return(""); } return(tbl[0].value); }
public static void SaveConfig(string key, string value) { baseDS.sysConfigDataTable sysConfigTbl = sysConfigTA.GetByKey(key); baseDS.sysConfigRow row; if (sysConfigTbl.Count == 0) { row = sysConfigTbl.NewsysConfigRow(); row.key = key; row.value = value; sysConfigTbl.AddsysConfigRow(row); } else { row = sysConfigTbl[0]; row.value = value; } sysConfigTA.Update(row); row.AcceptChanges(); }