public ActionResult ParentCategory(int id)
        {
            //Response.AppendHeader("Cache-Control", "max-age=1200,stale-while-revalidate=3600"); // HTTP 1.1.
            //Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.0.
            string pageQuery = Request.QueryString["page"];
            int    page      = 1;

            if (!string.IsNullOrEmpty(pageQuery))
            {
                page = Convert.ToInt32(pageQuery);
            }

            WebService.SearchResult rs = sv.GetProductByParentCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.pageName        = "ParentCategory";
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");

            ViewBag.isParent = "1";
            if (rs != null && rs.Item.Length > 0)
            {
                ViewBag.Title = rs.Item[0].ParentCatName;
            }
            SetUpAds();
            SetUpSeo(1, id);
            return(View("List"));
        }
        public ActionResult ParentCategory(int id)
        {
            string pageQuery = Request.QueryString["page"];
            int    page      = 1;

            if (!string.IsNullOrEmpty(pageQuery))
            {
                page = Convert.ToInt32(pageQuery);
            }
            WebService.AnperoService sv = new WebService.AnperoService();
            WebService.SearchResult  rs = sv.GetProductByParentCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");
            ViewBag.isParent        = "1";
            if (rs != null && rs.Item.Length > 0)
            {
                ViewBag.Title = rs.Item[0].ParentCatName;
            }
            SetupCommonProduct();
            return(View("Category"));
        }
        private void GetNewestProduct()
        {
            WebService.AnperoService service      = new WebService.AnperoService();
            WebService.SearchResult  searchResult = new WebService.SearchResult();
            int shortCacheTime = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["shortCacheTime"]);

            if (HttpRuntime.Cache["newestProduct"] != null)
            {
                searchResult = (WebService.SearchResult)HttpRuntime.Cache["newestProduct"];
            }
            else
            {
                searchResult = service.SearchProduct(StoreID, TokenKey, "", "", "", 1, 999999999, 1, 4, "", SearchOrder.TimeDesc, 0);
                if (searchResult != null)
                {
                    HttpRuntime.Cache.Insert("newestProduct", searchResult, null, DateTime.Now.AddMinutes(shortCacheTime), TimeSpan.Zero);
                }
            }

            ViewData["newestProduct"] = searchResult;

            WebService.SearchResult searchResult2 = new WebService.SearchResult();

            if (HttpRuntime.Cache["customProduct"] != null)
            {
                searchResult = (WebService.SearchResult)HttpRuntime.Cache["customProduct"];
            }
            else
            {
                searchResult = service.GetProductByParentCategory(StoreID, TokenKey, 178, 1, 8, 0);
                if (searchResult != null)
                {
                    HttpRuntime.Cache.Insert("customProduct", searchResult, null, DateTime.Now.AddMinutes(shortCacheTime), TimeSpan.Zero);
                }
            }

            ViewData["customProduct"] = searchResult;
        }
        public ActionResult ParentCategory(int id)
        {
            string pageQuery = Request.QueryString["page"];
            int    page      = 1;

            if (!string.IsNullOrEmpty(pageQuery))
            {
                page = Convert.ToInt32(pageQuery);
            }
            WebService.AnperoService sv = new WebService.AnperoService();
            WebService.SearchResult  rs = sv.GetProductByParentCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");
            ViewBag.isParent        = "1";
            ProductCategory pc = CommontInfo.ProductCategoryList.Where(x => x.Id == id).FirstOrDefault();

            if (pc != null)
            {
                ViewBag.Title = pc.Name;
                ViewBag.Desc  = pc.Description;
            }
            SetupCommonProduct();
            return(View("Category"));
        }