Пример #1
0
        //GET: Cart
        public async Task <ActionResult> Order()
        {
            var Orderlist = new List <OrderViewModel>();

            Orderlist = await _orderProvider.GetAllOrder();

            int pageindex   = 1;
            var recordCount = Orderlist.Count();

            if (Request.QueryString["page"] != null)
            {
                pageindex = Convert.ToInt32(Request.QueryString["page"]);
            }
            const int PAGE_SZ = 15;

            ViewBag.OrderList = Orderlist.OrderByDescending(art => art.OrderGuid)
                                .Skip((pageindex - 1) * PAGE_SZ)
                                .Take(PAGE_SZ).ToList();
            ViewBag.Pager = new PagerHelper()
            {
                PageIndex   = pageindex,
                PageSize    = PAGE_SZ,
                RecordCount = recordCount,
            };
            return(View());
        }