| | |
| | | |
| | | Expression<Func<DtStockInfo, bool>> locationStatus = null; |
| | | Expression<Func<DtStockInfo, bool>> floor = null; |
| | | Expression<Func<DtStockInfo, bool>> areaId = null; |
| | | foreach (var item in searchParametersList) |
| | | { |
| | | if (item.Name.Contains("locationStatus")) |
| | |
| | | { |
| | | floor = x => x.LocationInfo.Floor.Contains(item.Value); |
| | | } |
| | | else if (item.Name.Contains("areaId")) |
| | | { |
| | | areaId = x => x.LocationInfo.AreaId== Convert.ToInt32(item.Value); |
| | | } |
| | | } |
| | | //.IncludesAllFirstLayer() |
| | | var data = BaseDal.Db.Queryable<DtStockInfo>() |
| | |
| | | .WhereIF(!wheres.IsNullOrEmpty(), wheres) |
| | | .WhereIF(locationStatus != null, locationStatus) |
| | | .WhereIF(floor != null, floor) |
| | | .WhereIF(areaId != null, areaId) |
| | | .OrderBy(orderByModels) |
| | | .ToPageList(options.Page, options.Rows, ref totalCount); |
| | | new PageGridData<DtStockInfo>(totalCount, data); |