private void addShelfButton_Click(object sender, EventArgs e)//添加书架 { int k = Convert.ToInt32(BookShelfService.GetAllShelfs().Max(i => i.BookShelfId)) + 1; BookShelfService.AddBookShelf(new BookShelf() { BookShelfId = k + "" }); shelfBindingSource.DataSource = BookShelfService.GetAllShelfs(); }