private void newBook_Click_1(object sender, EventArgs e) { BookForm bookForm = new BookForm(categories); bookForm.Show(); bookForm.Text = "Add new book"; bookForm.bookPanelPurpose = "new"; bookForm.adminPanel = this; }
private void btnBookAdd_Click(object sender, EventArgs e) { BookForm bookForm = new BookForm(_db); bookForm.Owner = this; bookForm.Show(); bindingSourceBookSearch.DataSource = null; bindingSourceBookSearch.DataSource = SearchedBooks; }
private void dataGridView2_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 8) // handle edit button { BookForm bookForm = new BookForm(categories); bookForm.Show(); bookForm.Text = "Edit book"; bookForm.adminPanel = this; bookForm.editBook(booksGridView.CurrentRow.Cells[0].Value.ToString()); } else if (e.ColumnIndex == 9) // handle delete button { deleteBook(booksGridView.CurrentRow.Cells[0].Value.ToString()); } }