Esempio n. 1
0
        //[BunderHtml]
        public ActionResult Category(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.GetProductByCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");
            SetupCommonProduct();
            ProductCategory[] pc = CommontInfo.ProductCategoryList;
            if (pc != null)
            {
                foreach (var item in pc)
                {
                    if (item.ChildCategory.Length > 0)
                    {
                        foreach (var chidItem in item.ChildCategory)
                        {
                            if (chidItem.Id == id)
                            {
                                ViewBag.Title = chidItem.Name;
                                ViewBag.Desc  = chidItem.Description;
                            }
                        }
                    }
                }
            }
            return(View());
        }
Esempio n. 2
0
 public ActionResult Faq()
 {
     WebService.AnperoService sv = new WebService.AnperoService();
     WebService.SearchResult  rs = sv.GetProductByCategory(StoreID, TokenKey, 2332, 1, 100, 0);
     SetUpSeo(2, 2332);
     return(View(rs));
 }
Esempio n. 3
0
        public ActionResult Category(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.AnperoService sv = new WebService.AnperoService();
            WebService.SearchResult  rs = sv.GetProductByCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");

            if (rs != null && rs.Item.Length > 0)
            {
                ViewBag.Title = rs.Item[0].CatName;
            }

            SetupCommonProduct();
            SetUpSeo(2, id);
            return(View("List"));
        }
Esempio n. 4
0
        public ActionResult Category(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.GetProductByCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");
            //GetTopArticle();
            SetupCommonProduct();
            SetUpSeo(2, id);
            return(View("List"));
        }
Esempio n. 5
0
        public ActionResult Category(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.GetProductByCategory(StoreID, TokenKey, id, page, 14, 0);
            ViewData["productList"] = rs;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, rs.ResultCount, 10, "?page=");
            if (rs != null && rs.Item.Length > 0)
            {
                ViewBag.Title = rs.Item[0].CatName;
            }
            SetupCommonProduct();
            return(View());
        }
Esempio n. 6
0
        private SearchResult GetCustomproduct(int id)
        {
            WebService.AnperoService service      = new WebService.AnperoService();
            WebService.SearchResult  searchResult = new WebService.SearchResult();
            int shortCacheTime = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["shortCacheTime"]);

            if (HttpRuntime.Cache["Customproduct" + id] != null)
            {
                searchResult = (WebService.SearchResult)HttpRuntime.Cache["Customproduct" + id];
            }
            else
            {
                searchResult = service.GetProductByCategory(StoreID, TokenKey, id, 1, 10, 0);
                if (searchResult != null)
                {
                    HttpRuntime.Cache.Insert("Customproduct" + id, searchResult, null, DateTime.Now.AddMinutes(shortCacheTime), TimeSpan.Zero);
                }
            }
            return(searchResult);
        }