ActivityShell.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using Comal.Classes;
  6. using InABox.Mobile;
  7. namespace PRS.Mobile
  8. {
  9. public class ActivityShell : Shell<ActivityModel, EmployeeActivity>
  10. {
  11. protected override void ConfigureColumns(ShellColumns<ActivityModel, EmployeeActivity> columns)
  12. {
  13. // We Specifically want to remap the ID field here,
  14. // because we want to access the Activity ID, not the record ID
  15. columns
  16. .Map(nameof(ID), x => x.Activity.ID)
  17. .Map(nameof(Code), x => x.Activity.Code)
  18. .Map(nameof(Description), x => x.Activity.Description)
  19. .Map(nameof(IsLeave), x => x.Activity.IsLeave);
  20. }
  21. public String Code => Get<String>();
  22. public String Description => Get<String>();
  23. public bool IsLeave => Get<bool>();
  24. public IEnumerable<ActivityFormShell> Forms
  25. => Parent.Forms.Where(x => x.ActivityID == ID);
  26. }
  27. }