public static SqlConnection ShowConnectDialog() { var dlg = new ConnectDialog(); var result = dlg.ShowDialog(); return(result.HasValue & result.Value ? dlg.Connection : null); }
private void CreateConnection_Click(object sender, RoutedEventArgs e) { var connection = ConnectDialog.ShowConnectDialog(); if (connection != null) { warehouse = new Warehouse(connection); } }