예제 #1
0
        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();
        }
예제 #2
0
 public AddNewBook(PostgreSQL existingDatabase, BooksDashboard form)
 {
     initialForm = form;
     database    = existingDatabase;
     InitializeComponent();
 }