private void BtnReturn_Click(object sender, EventArgs e) { Book myBook = (Book)BookList.SelectedItem; myBook.copies++; BookFile.SaveBook(myBook, cwid, "Edit"); LoadList(); }
private void BtnDelete_Click(object sender, EventArgs e) { Book myBook = (Book)BookList.SelectedItem; DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete this?", "Delete", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { BookFile.DeleteBook(myBook, cwid); LoadList(); } }
private void LoadList() { myBooks = BookFile.GetAllBooks(cwid); BookList.DataSource = myBooks; }