private void deleteButton_Click(object sender, EventArgs e)//删除图书,同上 { Book book = bookBindingSource.Current as Book; if (book == null) { MessageBox.Show("请选择一本书进行操作!"); return; } BookShelfService.RemoveBooks(book.BookId); shelfBindingSource.DataSource = BookShelfService.GetAllShelfs(); }