Пример #1
0
        public List <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state, bool?IsOpenVshop)
        {
            var vshop = DbFactory.Default.Get <VShopInfo>().Where(item => item.State == state);

            if (IsOpenVshop.HasValue)
            {
                vshop = vshop.Where(d => d.IsOpen == IsOpenVshop);
            }
            var rets = vshop.OrderByDescending(item => item.Id).ToPagedList(page, pageSize);

            total = rets.TotalRecordCount;
            return(rets);
        }
Пример #2
0
        public IQueryable <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state)
        {
            var vshop = Context.VShopInfo.Where(item => item.State == state);

            total = vshop.Count();
            return(vshop.OrderByDescending(item => item.Id).Skip((page - 1) * pageSize).Take(pageSize));
        }
Пример #3
0
 public IQueryable <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state)
 {
     total = this.context.VShopInfo.Count();
     return((
                from item in this.context.VShopInfo
                where (int)item.State == (int)state
                orderby item.Id descending
                select item).Skip((page - 1) * pageSize).Take(pageSize));
 }
Пример #4
0
 /// <summary>
 /// 获取所有微店(分页)
 /// </summary>
 /// <param name="page">页号</param>
 /// <param name="pageSize">页面大小</param>
 /// <param name="total">微店总数</param>
 /// <param name="state">微店状态</param>
 /// <returns></returns>
 public static IQueryable <VShopInfo> GetVShops(int page, int pageSize, out int total, VShopInfo.VshopStates state)
 {
     return(_iVShopService.GetVShops(page, pageSize, out total, state));
 }