public IEnumerable <CustomerInvoice> GetAllCustomerInvoice(out int totalRecords, int currentPage = 1, int pageSize = 25, string sortBy = "Id", bool descending = true, string customerInvoiceName = null, string companyCode = null) { var spec = CustomerInvoiceQuery.WithAll(); totalRecords = _customerInvoice.Count(spec); var sort = Context.Filters.Sort <CustomerInvoice, int>(ti => ti.Id, true); switch (sortBy) { case "Id": sort = Context.Filters.Sort <CustomerInvoice, int>(ti => ti.Id, descending); break; default: break; } var pager = Context.Filters.Page <CustomerInvoice>(currentPage, pageSize); return(_customerInvoice.Find(spec, sort, pager)); }
public CustomerInvoice GetByCompanyCode(string companyCode) { return(_customerInvoice.One(CustomerInvoiceQuery.WithByCompanyCode(companyCode))); }
public CustomerInvoice GetById(int id) { return(_customerInvoice.One(CustomerInvoiceQuery.WithById(id))); }