public static SettingsDBData GetSetting(string guid) { var connected = Extensions.CheckForInternetConnection(); if (!connected) { return(null); } //barcode was scanned or manually inputted SQL_Request req = new SQL_Request().OpenConnection(); req.SettingsGet(guid); if (req.Tag is SettingsDBData) { try { var dbdata = req.Tag as SettingsDBData; return(dbdata); } catch { return(null); } } else { return(null); } }
public static Settings GetSettings(string AppName = "AWP_STARRAG_US") { var connected = Extensions.CheckForInternetConnection(); if (!connected) { return(Global.Library.Settings); } //barcode was scanned or manually inputted SQL_Request req = new SQL_Request().OpenConnection(); req.SettingsGet(AppName); if (req.Tag is SettingsDBData) { try { var dbdata = req.Tag as SettingsDBData; var settings = new Settings().DeserializeFromXmlString <Settings>(dbdata.XmlData); return(settings); } catch { return(new Settings()); } } else { return(null); } }