public ActionResult convert(BaiDang bd)
        {
            var     dao   = new DAO.BaiDangDAO();
            BaiDang bdsua = dao.SuaBaiDang(bd);

            return(View("TrangSua", bd));
        }
        // GET: BanSach
        public ActionResult Index(int page = 1, int PageSize = 3)
        {
            UserLogin a = (UserLogin)Session[CommonConstrants.USER_SESSION];

            if (a != null)
            {
                var dao         = new DAO.BaiDangDAO();
                int totalRecord = 0;
                var model       = dao.getListBaiDang(a.ID, 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));
            }

            return(View());
        }
        public ActionResult Xoa(BaiDang bd)
        {
            var dao = new DAO.BaiDangDAO();
            int ID  = dao.XoaDonHang(bd.ma);

            return(View("Index", dao.getListBaiDang2(ID)));
        }
        public PartialViewResult TimKiem()
        {
            var         dao = new DAO.BaiDangDAO();
            TheLoai_Gia tlg = new TheLoai_Gia();

            //tlg.lsttacgia = dao.getListTacGia();
            //tlg.lsttheloai = dao.getListTheLoai();
            return(PartialView(tlg));
        }
Esempio n. 5
0
        // GET: ShowBD
        public ActionResult Index(int page = 1, int PageSize = 3)
        {
            var dao         = new DAO.BaiDangDAO();
            int totalRecord = 0;
            var model       = dao.getListBd(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));
        }