Ejemplo n.º 1
0
        // GET: Home
        public ActionResult Index()
        {
            ViewBag.NumberBookShow = 3;
            var dao = new DAO.SachDAO();

            return(View(dao.getListSaleBook()));
        }
Ejemplo n.º 2
0
        //danh muc sản phảm
        public ActionResult Vanhoc()
        {
            var dao = new DAO.SachDAO();
            int n   = dao.getLiteratureBooks().Count();

            ViewBag.NumberBookShow = n;
            return(View(dao.getLiteratureBooks()));
        }
Ejemplo n.º 3
0
        public ActionResult KQTimKiem(string searchTerm)
        {
            var dao = new DAO.SachDAO();
            int n   = dao.Tim(searchTerm).Count();

            ViewBag.NumberBookShow = n;
            ViewBag.SearchTerm     = searchTerm;
            return(View(dao.Tim(searchTerm)));
        }
Ejemplo n.º 4
0
        public ActionResult TieuThuyet(int page = 1, int PageSize = 3)
        {
            var dao         = new DAO.SachDAO();
            int totalRecord = 0;
            var model       = dao.getRomanceNovelBooks(ref totalRecord, page, PageSize);

            ViewBag.total = totalRecord;
            ViewBag.Page  = page;
            int maxPage   = 3;
            int totalPage = 0;

            totalPage         = (int)Math.Ceiling((double)(totalRecord / PageSize)) + 1;
            ViewBag.totalPage = totalPage;
            ViewBag.Maxpage   = maxPage;
            ViewBag.First     = 1;
            ViewBag.Last      = totalPage;
            ViewBag.Next      = page + 1;
            ViewBag.Prev      = page - 1;
            return(View(model));
        }
Ejemplo n.º 5
0
        public ActionResult VanHocNuocNgoai(int page = 1, int PageSize = 3)
        {
            var dao         = new DAO.SachDAO();
            int totalRecord = 0;
            var model       = dao.getForeignLiteratureBooks(ref totalRecord, page, PageSize);

            ViewBag.total = totalRecord;
            ViewBag.Page  = page;
            int maxPage   = 3;
            int totalPage = 0;

            totalPage         = (int)Math.Ceiling((double)(totalRecord / PageSize)) + 1;
            ViewBag.totalPage = totalPage;
            ViewBag.Maxpage   = maxPage;
            ViewBag.First     = 1;
            ViewBag.Last      = totalPage;
            ViewBag.Next      = page + 1;
            ViewBag.Prev      = page - 1;
            return(View(model));
        }