public ActionResult Category(string id)
        {
            var theloai  = new TheLoaiDao().GetLoaiSachByTenLoaiSach(id);
            var listSach = new ProductDao().GetLoaiSachByIDLoaiSach(theloai.MaLoaiSach);

            return(View(listSach));
        }
        public ActionResult ShowLoaiSach()
        {
            var dao  = new TheLoaiDao();
            var list = new List <LoaiSach>();

            list = dao.GetAllLoaiSach();

            return(View(list));
        }
        public ActionResult ThemLoaiSach(string MaLoaiSach, string TenLoaiSach)
        {
            var theloaiDao = new TheLoaiDao();
            var l          = new LoaiSach();

            l.MaLoaiSach  = MaLoaiSach;
            l.TenLoaiSach = TenLoaiSach;
            var result = theloaiDao.insert(l);

            return(RedirectToAction("Index", "Home"));
        }
        public ActionResult DetailProduct(string id)
        {
            var p       = new ProductDao();
            var t       = new AuthorDao();
            var l       = new TheLoaiDao();
            var sanpham = p.GetSanPhamById(id);

            ViewBag.RelatedProduct = p.GetLoaiSachByIDTacGia(sanpham.MaTacGia);
            ViewBag.TacGia         = t.GetTacgiaByIDTacgia(sanpham.MaTacGia);
            ViewBag.LoaiSach       = l.GetLoaiSachByMaLoaiSach(sanpham.MaLoaiSach);
            return(View(sanpham));
        }
        public ActionResult TheLoai()
        {
            var model = new TheLoaiDao().GetAllLoaiSach();

            return(PartialView(model));
        }