Exemplo n.º 1
0
 public ActionResult Index(ListRequest request, PagerRequest pagerRequest)
 {
     return List(request, pagerRequest)
      ;
 }
Exemplo n.º 2
0
        public ActionResult List(ListRequest request, PagerRequest pagerRequest)
        {
            var linq = _productRepository.Get(Filter(new ProductFilter
                {
                    DataStatus = DataStatus.Normal,
                    UserId = request.CustomerId,
                    IsShare = true
                })).OrderByDescending(v=>v.UpdatedDate);

            var totalCount = linq.Count();

            var result = pagerRequest.PageIndex == 1 ? linq.Take(pagerRequest.PageSize) : linq.Skip((pagerRequest.PageIndex - 1) * pagerRequest.PageSize).Take(pagerRequest.PageSize);

            var dto = new ListDto(pagerRequest, totalCount)
                {
                    Datas = result.ToList()
                };

            return View("List", dto);
        }
Exemplo n.º 3
0
        public ActionResult MyIndex(ListRequest request, PagerRequest pagerRequest)
        {
            var linq = _productRepository.Get(Filter(new ProductFilter
            {
                DataStatus = DataStatus.Normal,
                UserId = request.CustomerId
            }));

            var totalCount = linq.Count();

            var result = pagerRequest.PageIndex == 1 ? linq.Take(pagerRequest.PageSize) : linq.Skip((pagerRequest.PageSize - 1) * pagerRequest.PageSize).Take(pagerRequest.PageSize);

            var dto = new ListDto(pagerRequest, totalCount)
            {
                Datas = result.ToList()
            };

            return View(dto);
        }