private void butCheckbook_Click(object sender, EventArgs e) { //弹出选择图书对话框 if (this.Text == "归还图书" || this.Text == "续借图书") { label17.Text = "借阅数量"; labQty.Text = "借阅数量"; if (this.labCardId.Text != "读者卡号") { try { frmReaderBorrow frb = new frmReaderBorrow(); //弹出当前读者借阅图书对话框 frb.ShowDialog(); txtBookName.Text = frmReaderBorrow.BookName; this.labBookID.Text = frmReaderBorrow.BookID; this.labBookName.Text = frmReaderBorrow.BookName; this.labAuthor.Text = frmReaderBorrow.BookAuhor; this.labPublisher.Text = frmReaderBorrow.BookPblisher; this.labPrice.Text = frmReaderBorrow.BookPrice; this.labQty.Text = frmReaderBorrow.BorrowNumber; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("请先输入要归还图书的读者信息!"); } } else { try { frmBookCheck fbc = new frmBookCheck(); //弹出选择图书对话框 fbc.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message); } txtBookName.Text = frmBookCheck.BookName; this.labBookID.Text = frmBookCheck.BookID; this.labBookName.Text = frmBookCheck.BookName; this.labAuthor.Text = frmBookCheck.BookAuhor; this.labPublisher.Text = frmBookCheck.BookPblisher; this.labPrice.Text = frmBookCheck.BookPrice; this.labQty.Text = frmBookCheck.Qty; } }