Exemple #1
0
        public ActionResult List(string cid,string page)
        {
            int categoryId = 0;
            int pageIndex = 1;
            int pageSize = 15;
            int.TryParse(cid, out categoryId);
            if (!string.IsNullOrEmpty(page))
            {
                int.TryParse(page,out pageIndex);
            }

            ShopManager manager=new ShopManager(null);
            int total = 0;
            List<Product> pdts = manager.GetProducts(categoryId, pageIndex, pageSize, out total);
            ViewBag.cid = categoryId;
            ViewBag.total = total;
            ViewBag.pageSize = pageSize;
            ViewBag.page = pageIndex;
            return View(pdts);
        }