/// <summary> /// Get all shipping by weight records /// </summary> /// <param name="pageIndex">Page index</param> /// <param name="pageSize">Page size</param> /// <returns>List of the shipping by weight record</returns> public virtual IPagedList <ShippingByWeightByTotalRecord> GetAll(int pageIndex = 0, int pageSize = int.MaxValue) { var key = _shippingByWeightByTotalAllKey.FillCacheKey(pageIndex, pageSize); return(_cacheManager.Get(key, () => { var query = from sbw in _sbwtRepository.Table orderby sbw.StoreId, sbw.CountryId, sbw.StateProvinceId, sbw.Zip, sbw.ShippingMethodId, sbw.WeightFrom, sbw.OrderSubtotalFrom select sbw; var records = new PagedList <ShippingByWeightByTotalRecord>(query, pageIndex, pageSize); return records; })); }
/// <summary> /// Gets all pickup points /// </summary> /// <param name="storeId">The store identifier; pass 0 to load all records</param> /// <param name="pageIndex">Page index</param> /// <param name="pageSize">Page size</param> /// <returns>Pickup points</returns> public virtual IPagedList <StorePickupPoint> GetAllStorePickupPoints(int storeId = 0, int pageIndex = 0, int pageSize = int.MaxValue) { var key = PICKUP_POINT_ALL_KEY.FillCacheKey(pageIndex, pageSize, storeId); return(_cacheManager.Get(key, () => { var query = _storePickupPointRepository.Table; if (storeId > 0) { query = query.Where(point => point.StoreId == storeId || point.StoreId == 0); } query = query.OrderBy(point => point.DisplayOrder).ThenBy(point => point.Name); return new PagedList <StorePickupPoint>(query, pageIndex, pageSize); })); }