コード例 #1
0
        private void deleteShelfButton_Click(object sender, EventArgs e)//删除书架
        {
            BookShelf shelf = shelfBindingSource.Current as BookShelf;

            BookShelfService.RemoveBookShelf(shelf.BookShelfId);
            shelfBindingSource.DataSource = BookShelfService.GetAllShelfs();
        }
コード例 #2
0
 public FormManage(FormMain form, Client client)
 {
     InitializeComponent();
     this.formMain      = form;
     this.currentClient = client;
     this.shelfBindingSource.DataSource = BookShelfService.GetAllShelfs();
 }
コード例 #3
0
 private void refreshButton_Click(object sender, EventArgs e)//刷新
 {
     isNormal = true;
     shelfBindingSource.DataSource = BookShelfService.GetAllShelfs();
     bookBindingSource.DataSource  = shelfBindingSource;
     bookBindingSource.DataMember  = "Books";
 }
コード例 #4
0
 private void sortButton_Click(object sender, EventArgs e)//按分类管理
 {
     isNormal = false;
     shelfBindingSource.DataSource = BookShelfService.GetAllShelfs();
     bookBindingSource.DataMember  = null;
     bookBindingSource.DataSource  = BookShelfService.Query(4);
 }
コード例 #5
0
        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();
        }
コード例 #6
0
        private void deleteBookButton_Click(object sender, EventArgs e)//删除书籍
        {
            Book book = bookBindingSource.Current as Book;

            if (book == null)
            {
                MessageBox.Show("请选择一本书进行操作!");
                return;
            }
            BookShelfService.RemoveBooks(book.BookId);
            shelfBindingSource.DataSource = BookShelfService.GetAllShelfs();
        }
コード例 #7
0
 public void resetLibrary()
 {
     this.shelfBindingSource.DataSource = BookShelfService.GetAllShelfs();
 }