示例#1
0
        public void LoadBookCatalog()
        {
            HumanDBHelper humanDBHelper = new HumanDBHelper();
            BookDBHelper  bookDBHelper  = new BookDBHelper();

            BindingList <BookWithPerson> allBooks = new BindingList <BookWithPerson>(bookDBHelper.JoinBP(humanDBHelper.GetAllPersons(), bookDBHelper.GetAllBooks()));
            BindingSource allBookSource           = new BindingSource(allBooks, null);
            var           e = bookDBHelper.GroupBP(bookDBHelper.JoinBP(humanDBHelper.GetAllPersons(), bookDBHelper.GetAllBooks()));

            grdAllBooks.DataSource                       = allBookSource;
            grdAllBooks.Columns["id"].Visible            = false; //Paslepiu, kad vartotojas nematytu knygos id
            grdAllBooks.Columns["TakenAt"].Visible       = false;
            grdAllBooks.Columns["ReturnAt"].Visible      = false;
            grdAllBooks.Columns["TimeRemaining"].Visible = false;
            grdAllBooks.Columns["ReaderId"].Visible      = false;
        }
 public List <Book> GetAllBooks()
 {
     return(bookDBHelper.GetAllBooks());
 }
 // GET: api/Book
 public IEnumerable <Book> Get()
 {
     return(bookDBHelper.GetAllBooks());
 }