private void LoadBooks() { BookRepo repo = new BookRepo(); this.grdBooks.DataSource = null; this.grdBooks.DataSource = repo.GetAllBooks(); }
private void searchBookTBTextChanged(object sender, EventArgs e) { List <Book> listOfBook = bk.GetAllBooks(); String keyword = this.searchBookTB.Text; List <Book> searchedBook = listOfBook.FindAll(x => (x.BookId.ToLower()).Contains(keyword.ToLower()) || (x.Title.ToLower()).Contains(keyword.ToLower()) || (x.PublishDate.ToLower()).Contains(keyword.ToLower()) || (x.Place.ToLower()).Contains(keyword.ToLower()) || (x.Author.ToLower()).Contains(keyword.ToLower())); BookTable.DataSource = searchedBook; }
private void BookSearchTextChanged(object sender, EventArgs e) { //bookSearchTB List <Book> listOfBook = bookRepo.GetAllBooks(); String keyword = this.bookSearchTB.Text; List <Book> searchedBook = listOfBook.FindAll(x => (x.BookId.ToLower()).Contains(keyword.ToLower()) || (x.Title.ToLower()).Contains(keyword.ToLower()) || (x.PublishDate.ToLower()).Contains(keyword.ToLower()) || (x.Place.ToLower()).Contains(keyword.ToLower())); booksDG.DataSource = searchedBook; }
public Book_Control() { InitializeComponent(); cancelBTN.Visible = false; removeBTN.Visible = false; updateBTN.Visible = false; this.bk = new BookRepo(); List <Book> listofBook = bk.GetAllBooks(); BookTable.DataSource = listofBook; }
public List <BookListViewModel> GetAllBooks() { var books = _bookRepo.GetAllBooks(); int n = books.Count; Random rnd = new Random(); while (n > 1) { int k = (rnd.Next(0, n) % n); n--; BookListViewModel value = books[k]; books[k] = books[n]; books[n] = value; } return(books); }
public borrowcontrol() { InitializeComponent(); AutoComplete(); // borrowDateLB.Text = borrowedDate.Value.ToString(); // string a = Convert.ToString(borrowedDate.Value.Date); // string[] s = a.Split(' '); // MessageBox.Show(s[0]); // MessageBox.Show(startDate); this.bookRepo = new BookRepo(); List <Book> listofBook = bookRepo.GetAllBooks(); booksDG.DataSource = listofBook; dt.Columns.Add("BookID", typeof(string)); dt.Columns.Add("Title", typeof(string)); dt.Columns.Add("Classification", typeof(string)); }
public IActionResult AddToCart(int id) { //var cartItem = _cartRepo.GetCart().SingleOrDefault(); //var cartItem = _db.Cart; var cartdb = new DataContext(); var cartItem = new List <Cart> { new Cart() { BookId = id, } }; var selectedBook = (from b in _bookRepo.GetAllBooks() orderby b.Id select b).ToList(); cartdb.AddRange(cartItem); cartdb.SaveChanges(); return(View(selectedBook)); }
//BorrowRecords brecords; public Records_Details(string studentid) { InitializeComponent(); this.studentid = studentid; MessageBox.Show(studentid); Student s = srepo.GetStudent(studentid); id.Text = s.Id; student.Text = s.Firstname; name.Text = s.Lastname; dept.Text = s.Dept; year.Text = s.Year; contact.Text = s.Contact; borrowed.Text = Convert.ToString(s.Borrowed); due.Text = Convert.ToString(s.Due); this.bk = new BookRepo(); List <Book> listofRecords = bk.GetAllBooks(studentid); recordsDetailsDG.DataSource = listofRecords; }
public List <BookListViewModel> GetAllBooks() { var books = _bookRepo.GetAllBooks(); return(books); }
//method-get---- public IEnumerable <Book> GetBooks() { return(_repo.GetAllBooks()); }
public List <BookListViewModel> GetAllBooks() { return(_bookRepo.GetAllBooks()); }
public IActionResult GetAllBooks() { var books = _bookrepository.GetAllBooks(); return(View(books)); }
public IActionResult Index() { var Books = _bookRepo.GetAllBooks(); return(View(Books)); }
public List <BookClass> GetAllBooks() { return(_bookRepo.GetAllBooks()); }
public IActionResult AllBooks() { return(View(_bookRepo.GetAllBooks())); }
public async Task <ViewResult> Index() { var books = await _bookRepo.GetAllBooks(); return(View(books)); }