Beispiel #1
0
 public IEnumerable <RawMaterialPurchase> GetRawMaterialPurchases(int PageNumber, int ResultsPerPage = Int32.MaxValue, string search = null)
 {
     return(RawMaterialPurchase
            .Where(e => search == null || e.RawMaterial.MaterialName == search)
            .Include(e => e.RawMaterial)
            .OrderBy(e => e.RawMaterial.MaterialName)
            .ThenByDescending(e => e.DateRecieved)
            .Skip(ResultsPerPage * (PageNumber - 1))
            .Take(ResultsPerPage));
 }
Beispiel #2
0
 public int CountRawMaterialPurchases(string search = null)
 {
     return(RawMaterialPurchase
            .Where(e => search == null || e.RawMaterial.MaterialName == search)
            .Count());
 }