public void resetAppointAndLend() { appointBooks = BookShelfService.GetAllAppointedBooks(currentClient); this.appointBindingSource.DataSource = appointBooks; lendBooks = BookShelfService.GetAllLentBooks(currentClient); this.lendBindingSource.DataSource = lendBooks; this.nameTextBox.Text = currentClient.Name; }
private void returnButton_Click(object sender, EventArgs e)//还书 { Book book = lendBindingSource.Current as Book; if (book == null) { MessageBox.Show("请选择一本书进行操作!"); return; } BookShelfService.ReturnBooks(book, currentClient); lendBooks = new List <Book>(); lendBindingSource.DataSource = lendBooks; lendBooks = BookShelfService.GetAllLentBooks(currentClient); lendBindingSource.ResetBindings(false); lendBindingSource.DataSource = lendBooks; }
private void newButton_Click(object sender, EventArgs e)//续借 { Book book = lendBindingSource.Current as Book; if (book == null) { MessageBox.Show("请选择一本书进行操作!"); return; } if (book.reNewNum < 3) { BookShelfService.ReNewLending(book, currentClient); } else { MessageBox.Show("该书续借次数太多,不允许继续续借!"); } lendBooks = new List <Book>(); lendBindingSource.DataSource = lendBooks; lendBooks = BookShelfService.GetAllLentBooks(currentClient); lendBindingSource.ResetBindings(false); lendBindingSource.DataSource = lendBooks; }