public static ServerConnection GetGPConnection() { AppConfigFile config = new AppConfigFile(); ServerConnection connection = new ServerConnection(); connection.Server = config.Item("GPSERVER"); connection.Database = config.Item("GPDATABASE"); connection.UserId = config.Item("GPUSERNAME"); connection.Password = config.Item("GPPASSWORD"); int connectionTest = connection.Test(); if (connectionTest == 0) { return(connection); } else { return(null); } }
public static ServerConnection GetLogConnection() { AppConfigFile config = new AppConfigFile(); ServerConnection connection = new ServerConnection(); connection.Server = config.Item("MODSERVER"); connection.Database = config.Item("MODDATABASE"); connection.UserId = config.Item("MODUSERNAME"); connection.Password = config.Item("MODPASSWORD"); int connectionTest = connection.Test(); if (connectionTest == 0) { return(connection); } else { logit($"ERROR: Connection Test Failed. Server={connection.Server}"); return(null); } }