TaxCodeLookups.cs 845 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections.Generic;
  2. using InABox.Core;
  3. namespace Comal.Classes
  4. {
  5. public class TaxCodeLookups : EntityLookup<TaxCode>
  6. {
  7. public override Columns<TaxCode> DefineColumns()
  8. {
  9. return Columns.None<TaxCode>().Add(
  10. x => x.ID,
  11. x => x.Code,
  12. x => x.Description,
  13. x => x.Rate
  14. );
  15. }
  16. public override Filter<TaxCode> DefineFilter()
  17. {
  18. return null;
  19. }
  20. public override SortOrder<TaxCode> DefineSortOrder()
  21. {
  22. return new SortOrder<TaxCode>(x => x.Code);
  23. }
  24. public override string FormatLookup(Dictionary<string, object?> values, IEnumerable<string> exclude)
  25. {
  26. return $"{values["Code"]} ({values["Rate"]:F2}%)";
  27. }
  28. }
  29. }