Example #1
0
 private void loadAllBook()
 {
     dataGridView1.DataSource = libraryapp.ReadBook();
     //foreach (var book in libraryapp.ReadBook())
     //{
     //    dataGridView1.Rows.Add(book);
     //}
 }
        private void LoadBook(int id)
        {
            if (id == 0)
            {
                return;
            }
            var book = libraryApp.ReadBook(id);

            txtTitle.Text      = book.Title;
            txtAuthor.Text     = book.Author;
            txtPublisher.Text  = book.Publisher;
            dtpPublished.Value = book.PublishedDate;
        }
        private void loadAll()
        {
            dataGridView1.DataSource = libraryapp.ReadBook();
            switch (dataGridView1.Rows.Count)
            {
            case 0:
                EnableBtn(false);
                break;

            default:
                EnableBtn(true);
                break;
            }
        }
Example #4
0
        private object loadAll()
        {
            switch (selectedTable)
            {
            case TblEnums.Book:
                return(libraryapp.ReadBook());

            case TblEnums.Account:
                return(libraryapp.ReadAccount());

            case TblEnums.Borrow:
                return(libraryapp.BorrowHistory());

            default:
                throw new NotImplementedException();
            }
        }