Example #1
0
        // GET: Category
        public ActionResult CategoryProduct(long id)
        {
            var categoryProduct = new CategoryProductDAO().ViewDetail(id);

            ViewBag.CategoryProduct = categoryProduct;
            var model = new ProductDAO().ListProductByCategory(id).Take(10);

            return(View(model));
        }
        public ActionResult Index()
        {
            ViewBag.Slides = new SlideDAO().ListAll();
            var productDAO        = new ProductDAO();
            var DanhMucDAO        = new DanhMucDAO();
            var DanhMucSanPhamDAO = new CategoryProductDAO();

            ViewBag.NewProducts         = productDAO.ListNewProduct(4);
            ViewBag.NewProducts1        = productDAO.ListNewProduct1(4);
            ViewBag.ListFeatureProducts = productDAO.ListFeatureProduct(4);
            ViewBag.SanPhamBanChay      = productDAO.SanPhamBanChay(4);
            ViewBag.DanhMuc             = DanhMucDAO.ListAll();
            ViewBag.DanhMucSanPham      = DanhMucSanPhamDAO.ListCategoryProduct();
            ViewBag.SanPham             = productDAO.ListAll();
            return(View());
        }