public SearchBooks(PostgreSQL existingDatabase, BooksDashboard form) { initialForm = form; database = existingDatabase; InitializeComponent(); database.connect(); List <Genre> genres = database.findAllGenres(); List <Author> authors = database.findAllAuthors(); database.disconnect(); foreach (Genre g in genres) { listBoxGenre.Items.Add(g.Name); } foreach (Author a in authors) { listBoxAuthor.Items.Add(a.Name); } RefreshAllData(); }
public AddNewBook(PostgreSQL existingDatabase, BooksDashboard form) { initialForm = form; database = existingDatabase; InitializeComponent(); }