using CRM.Core.BLL.Util; using CRM.Core.Common.Layui; using CRM.Core.Model.EntityStock; using System.Collections.Generic; using System.Linq; namespace CRM.Core.BLL.Application.StockPool { public class StockPoolService { public List GetStockPoolList(ref Laypage pager, string gpcode) { using (var db = new StockContext()) { var query = db.StockPoolDataFlash.AsQueryable(); if (string.IsNullOrEmpty(gpcode)) { query = query.Where(p => p.Formula_Id == 289); } else { query = query.Where(p => p.Formula_Id == 289 && p.GpCode == gpcode); } query = query.OrderByDescending(p => p.YMD); PagerUtil.SetPager(ref query, ref pager); return query.ToList(); } } } }