public ActionResult Index(int?pType, int?pPage) { ProductPage mProductPage = new ProductPage(); if (pType == null) { if (Session["OrderType"] != null) { pType = (int)Session["OrderType"]; } else { pType = 0; } } else { Session["OrderType"] = pType; } if (pPage == null) { if (Session["OrderPage"] != null) { pPage = (int)Session["OrderPage"]; } else { pPage = 1; } } else { Session["OrderPage"] = pPage; } #endregion /*Lay danh sach cac tin theo page*/ var mProductList = ProductsService.LayOrderTheoTrangAndType((int)pPage, 6, (int)pType); //lay danh sach cac kieu san pham if (mProductList.Count < 6) { mProductPage.IsEnd = true; } //Tao Html cho danh sach tin nay mProductPage.Html = V308HTMLHELPER.TaoDanhSachHoaDon(mProductList, (int)pPage); mProductPage.Page = (int)pPage; mProductPage.TypeId = (int)pType; return(View("Index", mProductPage)); }