private void dataGridViewBooks_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "AddToCart" && e.RowIndex >= 0)
     {
         string             ISBN_Value    = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var                book          = BookDataAccess.GetFullBookByISBN(ISBN_Value);
         CartItemAmountForm addToCartForm = new CartItemAmountForm();
         SendCartInfoEvent += addToCartForm.GetInfo;
         SendCartInfoEvent.Invoke(book, true);
         addToCartForm.ShowDialog();
     }
     else if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "Review" && e.RowIndex >= 0)
     {
         string            ISBN_Value        = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var               reviews           = ReviewOfBookDataAccess.GetReviews(ISBN_Value);
         ReviewsOfBookForm reviewsOfBookForm = new ReviewsOfBookForm();
         SendReviewsInfoEvent += reviewsOfBookForm.ShowReviews;
         SendReviewsInfoEvent.Invoke(reviews);
         reviewsOfBookForm.ShowDialog();
     }
     else if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "More" && e.RowIndex >= 0)
     {
         string         ISBN_Value     = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var            book           = BookDataAccess.GetFullBookByISBN(ISBN_Value);
         BookDetailForm bookDetailForm = new BookDetailForm();
         SendBookInfoEvent += bookDetailForm.ShowBookDetail;
         SendBookInfoEvent.Invoke(book);
         bookDetailForm.ShowDialog();
     }
 }
 private void dataGridViewBooks_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "Detail" && e.RowIndex >= 0)
     {
         string         ISBN_Value = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var            book       = BookDataAccess.GetFullBookByISBN(ISBN_Value);
         BookDetailForm detailForm = new BookDetailForm();
         SendBookInfoEvent += detailForm.ShowDetail;
         SendBookInfoEvent.Invoke(book);
         detailForm.ShowDialog();
     }
     else if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "Edit" && e.RowIndex >= 0)
     {
         string         ISBN_Value   = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var            book         = BookDataAccess.GetFullBookByISBN(ISBN_Value);
         BookEditorForm editBookForm = new BookEditorForm();
         SendBookInfoEvent += editBookForm.GetValues;
         SendBookInfoEvent.Invoke(book);
         editBookForm.ShowDialog();
         ShowAllBasicBookData();
     }
     else if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "Delete" && e.RowIndex >= 0)
     {
         if (MessageBox.Show("删除图书后可能会导致部分订单、购物车和评论数据失效\n确定删除图书?", "警告", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             string ISBN_Value = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
             try
             {
                 BookDataAccess.DeleteBook(ISBN_Value);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
             ShowAllBasicBookData();
         }
     }
     else if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "Review" && e.RowIndex >= 0)
     {
         string            ISBN_Value        = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var               reviews           = ReviewOfBookDataAccess.GetReviews(ISBN_Value);
         ReviewsOfBookForm reviewsOfBookForm = new ReviewsOfBookForm();
         SendReviewsInfoEvent += reviewsOfBookForm.ShowReviews;
         SendReviewsInfoEvent.Invoke(reviews);
         reviewsOfBookForm.ShowDialog();
     }
     else if (dataGridViewBooks.Columns[e.ColumnIndex].Name == "Order" && e.RowIndex >= 0)
     {
         string           ISBN_Value        = dataGridViewBooks.Rows[e.RowIndex].Cells["ISBN"].Value.ToString();
         var              orders            = OrderOfBookDataAccess.GetOrders(ISBN_Value);
         OrdersOfBookForm reviewsOfBookForm = new OrdersOfBookForm();
         SendOrdersInfoEvent += reviewsOfBookForm.ShowOrders;
         SendOrdersInfoEvent.Invoke(orders);
         reviewsOfBookForm.ShowDialog();
     }
 }