private void CreateServerOrSqlConnection(frmServerConnector serverConnection) { if (m_View.ServerType == ServerType.SqlServer) { m_View.Server = serverConnection.Server; } else if (m_View.ServerType == ServerType.MySql) { m_View.MySqlConn = serverConnection.MySqlConn; } }
private void OpenServerConnector() { frmServerConnector serverConnection = new frmServerConnector(); serverConnection.ShowDialog(); if (serverConnection.ConnectionSuccessful) { m_View.ServerType = serverConnection.ServerType; CreateServerOrSqlConnection(serverConnection); m_View.DatabaseName = serverConnection.DatabaseName; m_View.ServerName = serverConnection.ServerName; m_View.Output = "Connected to " + m_View.DatabaseName + " on " + m_View.ServerName + "\n"; m_View.ConnectButtonEnabled = false; m_View.DisconnectButtonEnabled = true; } else if (serverConnection.Form == DialogResult.Cancel) { m_View.Output += "Server connection cancelled\n"; } else { m_View.Output += "CONNECTION FAILED!\n"; } }