public ActionResult Index() { F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); ViewBag.ListBook = new F_Book().getAll(); return(View()); }
public ActionResult Product(long id) { F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); var model = new F_Book().FindEntity(id); ViewBag.Book = model; return(View()); }
public ActionResult timkiemtheotacgia(long id) { var dsBook = new F_Book().getAll().Where(x => x.Author == id); ViewBag.Book = dsBook; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View("Search")); }
public ActionResult Payment() { ViewBag.Title = "Giỏ hàng"; GioHangViewModel model = new GioHangViewModel(); model.Cart = (Cart)Session["Cart"]; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View(model)); }
public ActionResult timkiemtheogia(string begin, string end) { int u = Convert.ToInt32(begin); int v = Convert.ToInt32(end); var dsBook = new F_Book().getAll().Where(x => x.Price >= u && x.Price <= v); ViewBag.Book = dsBook; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View("Search")); }
public ActionResult timkiemtheocategory(string query, int?page) { long?id = Convert.ToInt64(query); if (id == null) { id = Convert.ToInt64(Request.QueryString["query"]); } ViewBag.Title = "category=" + id + "&page=" + page; var listBook = new F_CategoryBook().getAll().Where(x => x.IDCategory == id).ToList(); var dsBook = new F_Book().getAll(); var list = (from book in listBook join book1 in dsBook on book.IDBook equals book1.ID select new Book { ID = book1.ID, Name = book1.Name, Image = book1.Image, Price = book1.Price }); List <Book> u = new List <Book>(); foreach (var v in list) { Book temp = new Book(); temp.ID = v.ID; temp.Name = v.Name; temp.Price = v.NumberPage; temp.Image = v.Image; u.Add(temp); } ViewBag.Book = list; F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); int pageSize = 5; int pageNumber = (page ?? 1); return(View("Search", u.ToPagedList(pageNumber, pageSize))); }
public ActionResult Search(string query, int?page) { if (query == null) { query = ""; } if (page == null) { page = 1; } var model = new F_Book().getAll().Where(x => x.Name.Contains(query)).OrderBy(x => x.ID).ToList(); ViewBag.Title = "q=" + query + "&page=" + page; int pageSize = 6; int pageNumber = (page ?? 1); F_Category fctg = new F_Category(); ViewBag.ListCategory = fctg.getAll(); return(View("Search", model.ToPagedList(pageNumber, pageSize))); }