private void button2_Click(object sender, EventArgs e) { if (Userhelp.Lend_num() > 0) { if (Bookhelp.Have_book(click_book)) { if (Bookhelp.LendBook(click_book) && Userhelp.User_lend()) { MessageBox.Show("借书成功!"); Userhelp.Record_Lend(click_book); } else { MessageBox.Show("借书失败!"); } } else { MessageBox.Show("此书余量不足!"); } } else { MessageBox.Show("可借次数不足!"); } }
public Back_Book() { InitializeComponent(); init_grid(); count = Userhelp.Lend_num(); name.Text = Userhelp.ruid; lend_num.Text = count.ToString(); }
private void button1_Click(object sender, EventArgs e) { if (!sernum.Equals("")) { if (Userhelp.Back_book(sernum)) { Userhelp.update_ustate(); bookcount = Bookhelp.BookNum(bookid); bookcount++; Bookhelp.UpdateBook_lend(bookid, bookcount.ToString()); MessageBox.Show("还书成功!"); init_grid(); lend_num.Text = Userhelp.Lend_num().ToString(); } else { MessageBox.Show("本书已归还!请勿重复操作!"); } } else { MessageBox.Show("没有选择的书目!"); } }