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; }
private void MainForm_Load(object sender, EventArgs e) { ucChooseLogin = new UCChooseLogin(this); ucChooseLogin.Dock = DockStyle.Bottom; this.Controls.Add(ucChooseLogin); BookDBHelper b = new BookDBHelper(); HumanDBHelper h = new HumanDBHelper(); List <Book> books = new List <Book>(); List <Person> people = new List <Person>(); List <BookWithPerson> bp = new List <BookWithPerson>(); books = b.SQLBooksRead(); people = h.SQLPersonsRead(); bp = b.JoinBP(people, books); }