private void renewButton_Click(object sender, EventArgs e)//续借,完成 { Book book = lendBindingSource.Current as Book; if (book == null) { MessageBox.Show("请选择一本书进行操作!"); return; } else { if (yearComboBox.Text != "" && monthComboBox.Text != "" && dayComboBox.Text != "")//monthComboBox之前打快了打成了monthhComboBox { string year = yearComboBox.Text; string month = monthComboBox.Text; string day = dayComboBox.Text; if (book.reNewNum < 3) { BookShelfService.ReNewLending(book, currentClient, year, month, day); } else { MessageBox.Show("该书续借次数太多,不允许继续续借!"); } } else { MessageBox.Show("没有输入正确的日期!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } lendBooks = new List <Book>(); lendBindingSource.DataSource = lendBooks; lendBooks = BookShelfService.GetAllLentBooks(currentClient); lendBindingSource.ResetBindings(false); lendBindingSource.DataSource = lendBooks; Books = new List <Book>(); booksBindingSource.DataSource = Books; Books = BookShelfService.AllBooks(); booksBindingSource.ResetBindings(false); booksBindingSource.DataSource = Books; Query(1); }