Exemplo n.º 1
0
        /// <summary>
        /// 电脑页面
        /// </summary>
        /// <param name="id">第几页</param>
        /// <returns>View</returns>
        public ActionResult Computer(int id)
        {
            var model = new GoodsBuySearchModel(id);

            if (id <= 0)
            {
                return(RedirectToAction("PageNotFound", "PageLink"));
            }
            if (id <= 10)
            {
                model.MainGoods = goodsCache.GetMainGoodsBuyComputer().Skip((id - 1) * 10).Take(10).ToList();
            }
            else
            {
                //缓存中数量超过100个的时候 才可能有后续数据 这个时候才去读取 否则不读取  默认100个
                if (model.MainGoods.Count == 100)
                {
                    int page = id - 1;
                    model.MainGoods = goodsSearch.SearchByCatagroy(ChannelListDetailCatagroy.Computer, page, 10);
                }
            }

            model.CheckModel();
            return(View(model));
        }