Exemplo n.º 1
0
        public ActionResult Category(int ID)
        {
            if (ID <= 0)
            {
                ViewBag.Message = "Sorry, you must provide a valid Category Id.";
                return(View("Error"));
            }
            Category Category = db.Categories.Find(ID);

            if (Category == null)
            {
                ViewBag.Message = "Sorry, we can't find the category or you're not the owner.";
                return(View("Error"));
            }
            List <ProductDisplay> list = Product_Logic.GetListProdcutByCategoryID(ID, 1, Constant.PAGE_SIZE);

            ViewBag.Category = Category;
            ViewBag.TotalRow = Product_Logic.GetTotalRowsProdcutByCategoryID(ID);
            return(View(list));
        }
Exemplo n.º 2
0
        public ActionResult GetProductPage(int ID, int page)
        {
            List <ProductDisplay> list = Product_Logic.GetListProdcutByCategoryID(ID, page, Constant.PAGE_SIZE);

            return(Json(list, JsonRequestBehavior.AllowGet));
        }