本文整理汇总了C#中PagerRequest类的典型用法代码示例。如果您正苦于以下问题:C# PagerRequest类的具体用法?C# PagerRequest怎么用?C# PagerRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PagerRequest类属于命名空间,在下文中一共展示了PagerRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: List
public ActionResult List(PagerRequest request,SpecialTopicListSearchOption search)
{
int totalCount;
var data = _specialTopicRepository.Get(e =>(!search.PId.HasValue || e.Id== search.PId.Value)
&& (string.IsNullOrEmpty(search.Name) || e.Name.ToLower().StartsWith(search.Name.ToLower()))
&& (!search.Status.HasValue || e.Status == (int)search.Status.Value)
&& e.Status!=(int)DataStatus.Deleted
, out totalCount
, request.PageIndex
, request.PageSize
, e => {
if (!search.OrderBy.HasValue)
return e.OrderByDescending(o=>o.CreatedDate);
else
{
switch (search.OrderBy.Value)
{
case GenericOrder.OrderByCreateUser:
return e.OrderByDescending(o=>o.CreatedUser);
case GenericOrder.OrderByName:
return e.OrderByDescending(o=>o.Name);
case GenericOrder.OrderByCreateDate:
default:
return e.OrderByDescending(o=>o.CreatedDate);
}
}
});
var vo = MappingManager.SpecialTopicViewMapping(data.ToList());
var v = new SpecialTopicCollectionViewModel(request, totalCount) { SpecialTopics = vo.ToList() };
ViewBag.SearchOptions = search;
return View("List", v);
}
示例2: List
public ActionResult List(PagerRequest request,HotwordSearchOption search)
{
int totalCount;
var data = _hotwordRepo.Get(e => (!search.Type.HasValue || e.Type == search.Type.Value)
&& (string.IsNullOrEmpty(search.Word) || e.Word.Contains(search.Word))
&& e.Status != (int)DataStatus.Deleted
, out totalCount
, request.PageIndex
, request.PageSize
, e =>
{
if (!search.OrderBy.HasValue)
return e.OrderByDescending(o => o.CreatedDate);
else
{
switch (search.OrderBy.Value)
{
case GenericOrder.OrderByCreateUser:
return e.OrderByDescending(o => o.CreatedUser);
case GenericOrder.OrderByName:
return e.OrderByDescending(o => o.Word);
case GenericOrder.OrderByCreateDate:
default:
return e.OrderByDescending(o => o.CreatedDate);
}
}
});
var models = from d in data.ToList()
select new HotwordViewModel().FromEntity<HotwordViewModel>(d);
return View("List", new Pager<HotwordViewModel>(request, totalCount) { Data=models});
}
示例3: List
public ActionResult List(PagerRequest request,SectionSearchOption search)
{
int totalCount;
var linq = _sectionRepo.Get(s => (!search.SId.HasValue || search.SId.Value == s.Id) &&
(string.IsNullOrEmpty(search.Name) || s.Name.StartsWith(search.Name)) &&
(!search.BrandId.HasValue || search.BrandId.Value == s.BrandId) &&
(!search.StoreId.HasValue || search.StoreId.Value == s.StoreId) &&
s.Status!=(int)DataStatus.Deleted
, out totalCount
, request.PageIndex
, request.PageSize
, e => e.OrderByDescending(o => o.CreateDate));
var data = linq.Join(_storeRepo.GetAll(), o => o.StoreId, i => i.Id, (o, i) => new { S = o, Store = i })
.Join(_brandRepo.GetAll(), o => o.S.BrandId, i => i.Id, (o, i) => new { S = o.S, Store = o.Store, B = i })
.ToList()
.Select(l => new SectionViewModel().FromEntity<SectionViewModel>(l.S, p=>{
p.Store = new StoreViewModel().FromEntity<StoreViewModel>(l.Store);
p.Brand = new BrandViewModel().FromEntity<BrandViewModel>(l.B);
}));
var v = new Pager<SectionViewModel>(request, totalCount) { Data = data.ToList() };
return View("List", v);
}
示例4: ListP
public JsonResult ListP(CategorySearchOption search, PagerRequest request)
{
int totalCount;
var linq = Context.Set<CategoryEntity>().Where(p => (string.IsNullOrEmpty(search.Name) || p.Name.Contains(search.Name)) &&
(!search.PId.HasValue || p.ExCatId == search.PId.Value) &&
p.Status != (int)DataStatus.Deleted);
var linq2 = linq.GroupJoin(Context.Set<CategoryMapEntity>().Where(u => u.Status != (int)DataStatus.Deleted),
o => o.ExCatId,
i => i.CatId,
(o, i) => new { O = o, C = i })
;
totalCount = linq2.Count();
var skipCount = (request.PageIndex - 1) * request.PageSize;
var linq3 = skipCount == 0 ? linq2.Take(request.PageSize) : linq2.Skip(skipCount).Take(request.PageSize);
var vo = from l in linq3.ToList()
select new CategoryViewModel().FromEntity<CategoryViewModel>(l.O, p =>
{
p.ShowCategories = l.C.Select(c => new ShowCategoryViewModel() {
ShowChannel = c.ShowChannel
}).ToList() ;
});
var v = new Pager<CategoryViewModel>(request, totalCount) { Data = vo.ToList() };
return Json(v);
}
示例5: ProductListP
public ActionResult ProductListP(ProductSearchViewModel search, PagerRequest request)
{
int totalCount;
var linq = Context.Set<ProductEntity>().Where(p => p.SkuCode == search.SkuCode && p.Status != (int)DataStatus.Deleted)
.Join(Context.Set<InventoryEntity>(), o => o.Id, i => i.ProductId, (o, i) => new { P = o, I = i })
.Join(Context.Set<ProductPropertyValueEntity>(), o => o.I.PColorId, i => i.Id, (o, i) => new { P = o.P, I = o.I, Color = i })
.Join(Context.Set<ProductPropertyValueEntity>(), o => o.I.PSizeId, i => i.Id, (o, i) => new { P = o.P, I = o.I, Color = o.Color, Size = i });
totalCount = linq.Count();
var skipCount = (request.PageIndex - 1) * request.PageSize;
linq = skipCount == 0 ? linq.OrderBy(l => l.P.Id).Take(request.PageSize) : linq.OrderBy(l => l.P.Id).Skip(skipCount).Take(request.PageSize);
var vo = new List<dynamic>();
foreach (var l in linq)
{
vo.Add(new {
Id = l.P.Id,
Name = l.P.Name,
ColorValueName = l.Color.ValueDesc,
SizeValueName = l.Size.ValueDesc,
Amount = l.I.Amount,
GenerateId = search.PackageType==(int)WxPackageType.Product?l.P.Id:l.I.Id,
PackageType = search.PackageType
});
}
var v = new Pager<dynamic>(request, totalCount) { Data = vo.ToList() };
return Json(v);
}
示例6: List
public ActionResult List(PagerRequest request, int? sort, SourceType? sourceType, int? sourceId)
{
int totalCount;
var sortOrder = sort ==null?ResourceSortOrder.CreateDate:(ResourceSortOrder)sort.Value;
List<ResourceEntity> data;
if (sourceType == null)
{
data = _resourceRepository.GetPagedList(request, out totalCount, sortOrder);
}
else
{
data = _resourceRepository.GetPagedList(request, out totalCount, sortOrder, sourceType, sourceId);
}
var vo = MappingManager.ResourceViewMapping(data);
var v = new ResourceCollectionViewModel(request, totalCount) { Resources = vo.ToList() };
var dto = new ListDto
{
ResourceCollectionViewModel = v,
Sort = sort,
SourceId = sourceId,
SourceType = sourceType
};
return View("List", dto);
}
示例7: Get
private FavoriteCollectionResponse Get(float version, int userId, PagerRequest pagerRequest, CoordinateInfo coordinate, FavoriteSortOrder sortOrder, SourceType sourceType)
{
FavoriteCollectionResponse response;
int totalCount;
if (version >= 2.1)
{
var entitys = _favoriteRepository.Get(userId, pagerRequest, out totalCount, sortOrder, sourceType);
var list = MappingManager.FavoriteCollectionResponseMapping(entitys, coordinate);
response = new FavoriteCollectionResponse(pagerRequest, totalCount) { Favorites = list };
}
else
{
var entitys = _favoriteRepository.GetPagedList(userId, pagerRequest, out totalCount, sortOrder, sourceType);
response = MappingManager.FavoriteCollectionResponseMapping(entitys, coordinate);
response.Index = pagerRequest.PageIndex;
response.Size = pagerRequest.PageSize;
response.TotalCount = totalCount;
}
return response;
}
示例8: List
public ActionResult List(PagerRequest request)
{
int totalCount;
var jobs = new ProUploadService(this).JobList(request.PageIndex,request.PageSize,out totalCount);
return View(new Pager<ProductUploadJob>(request,totalCount){
Data = jobs
});
}
示例9: List
public ActionResult List(ProductSearchOption search, PagerRequest request)
{
int totalCount;
var vo = internalSearch(search, request,out totalCount);
var v = new ProductCollectionViewModel(request, totalCount) { Products = vo.ToList() };
ViewBag.SearchOptions = search;
return View(v);
}
示例10: List
public ActionResult List(PagerRequest request, int? sort)
{
int totalCount;
var sortOrder = (FeedbackSortOrder)(sort ?? 0);
var data = _feedbackRepository.GetPagedList(request, out totalCount, sortOrder);
var vo = MappingManager.FeedbackViewMapping(data);
var v = new FeedbackCollectionViewModel(request, totalCount) { Feedbacks = vo.ToList() };
return View("List", v);
}
示例11: GetList
private IEnumerable<BillEntity> GetList(PagerRequest pagerRequest, out int totalCount, BillFilterOptions filterOptions, BillSortOptions sortOptions)
{
var count = 0;
var t = ServiceInvoke(v => v.BillRepository.Get(Filler(filterOptions), out count, pagerRequest.PageIndex,
pagerRequest.PageSize, OrderBy(sortOptions)));
totalCount = count;
return t;
}
示例12: ProductByBrand
public ActionResult ProductByBrand(PagerRequest request, ReportByProductBrandOption search)
{
if (!ModelState.IsValid)
{
ViewBag.SearchOptions = search;
return View();
}
var prods = searchProduct(search);
var v = new Pager<ProductByBrandReportViewModel>(request, prods.Count()) { Data = prods.ToList() };
ViewBag.SearchOptions = search;
return View(v);
}
示例13: List
public ActionResult List(PagerRequest request, int? sort)
{
int totalCount;
var sortOrder = (TagSortOrder)(sort ?? 0);
var data = _tagRepository.GetPagedList(request, out totalCount, sortOrder);
var vo = MappingManager.TagViewMapping(data);
var v = new TagCollectionViewModel(request, totalCount) { Tags = vo.ToList() };
return View("List", v);
}
示例14: StoreCouponUsage
public ActionResult StoreCouponUsage(PagerRequest request, StoreCouponUsageOption search)
{
if (!ModelState.IsValid)
{
ViewBag.SearchOptions = search;
return View();
}
var prods = searchCouponLog(search);
var v = new Pager<StoreCouponUsageViewModel>(request, prods.Count()) { Data = prods.ToList() };
ViewBag.SearchOptions = search;
return View(v);
}
示例15: ListP
public JsonResult ListP(OrderSearchOption search, PagerRequest request)
{
int totalCount;
search.CurrentUser = CurrentUser.CustomerId;
search.CurrentUserRole = CurrentUser.Role;
var dbContext = _orderRepo.Context;
var linq = dbContext.Set<OrderEntity>().Where(p => (string.IsNullOrEmpty(search.OrderNo) || p.OrderNo == search.OrderNo) &&
(!search.CustomerId.HasValue || p.CustomerId == search.CustomerId.Value) &&
(!search.Status.HasValue || p.Status == (int)search.Status.Value) &&
(!search.Store.HasValue || p.StoreId == search.Store.Value) &&
(!search.Brand.HasValue || p.BrandId == search.Brand.Value) &&
(!search.FromDate.HasValue || p.CreateDate >= search.FromDate.Value) &&
(!search.ToDate.HasValue || p.CreateDate <= search.ToDate.Value) &&
p.Status != (int)DataStatus.Deleted);
linq = _userAuthRepo.AuthFilter(linq, search.CurrentUser, search.CurrentUserRole) as IQueryable<OrderEntity>;
var linq2 = linq.Join(dbContext.Set<UserEntity>().Where(u => u.Status != (int)DataStatus.Deleted),
o => o.CustomerId,
i => i.Id,
(o, i) => new { O = o, C = i })
.GroupJoin(dbContext.Set<RMAEntity>(),
o => o.O.OrderNo,
i => i.OrderNo,
(o, i) => new { O = o.O, C = o.C, RMA = i })
.GroupJoin(dbContext.Set<ShipViaEntity>().Where(s => s.Status != (int)DataStatus.Deleted),
o => o.O.ShippingVia,
i => i.Id,
(o, i) => new { O = o.O, C = o.C, RMA = o.RMA, S = i.FirstOrDefault() });
totalCount = linq2.Count();
var skipCount = (request.PageIndex - 1) * request.PageSize;
var linq3 = skipCount == 0 ? linq2.OrderByDescending(l => l.O.CreateDate).Take(request.PageSize) : linq2.OrderByDescending(l => l.O.CreateDate).Skip(skipCount).Take(request.PageSize);
var vo = from l in linq3.ToList()
select new OrderViewModel().FromEntity<OrderViewModel>(l.O, p =>
{
p.ShippingViaMethod = l.S;
p.Customer = new CustomerViewModel().FromEntity<CustomerViewModel>(l.C);
p.ShippingViaMethod_Name = l.S==null?string.Empty:l.S.Name;
p.RMAs = l.RMA.ToList().OrderByDescending(r=>r.CreateDate).Select(r => new RMAViewModel().FromEntity<RMAViewModel>(r));
});
var v = new Pager<OrderViewModel>(request, totalCount) { Data = vo.ToList() };
return Json(v);
}