private void button12_Click(object sender, EventArgs e) { if (textBox21.Text != "") { try { T_Books book = BLL.BLL_T_Books.GetOneInfo(textBox21.Text, -1); textBox19.Text = book.BookName; textBox24.Text = book.Nid.ToString(); textBox9.Text = book.GetBookClasses(); textBox22.Text = book.Author; textBox17.Text = book.Press; textBox12.Text = book.Price.ToString("F"); textBox23.Text = book.IsLeased ? "已被租借" : "可以租借"; button11.Visible = !book.IsLeased; } catch (Exception ex) { MessageBox.Show("加载图书信息时出错:\n" + ex.Message); } } else { MessageBox.Show("请输入或选择要查询图书的名称!"); } }