InOutShell.cs 943 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using Comal.Classes;
  3. using Xamarin.Forms;
  4. namespace comal.timesheets
  5. {
  6. public class InOutShell : Shell<InOutModel, Employee>
  7. {
  8. static InOutShell()
  9. {
  10. Columns
  11. .Map(nameof(ID), x => x.ID)
  12. .Map(nameof(Name), x=>x.Name)
  13. .Map(nameof(Mobile), x => x.Mobile);
  14. }
  15. public Guid ID => Get<Guid>();
  16. public String Name => Get<String>();
  17. public String Mobile => Get<String>();
  18. public ImageSource Call => String.IsNullOrWhiteSpace(Mobile)
  19. ? null
  20. : ImageSource.FromFile("call");
  21. public TimeSpan Start => Parent.StartTime(ID);
  22. public TimeSpan Finish => Parent.FinishTime(ID);
  23. //public Bitmap bmp
  24. public ImageSource In => Parent.IsClockedOn(ID)
  25. ? ImageSource.FromFile("greendot")
  26. : ImageSource.FromFile("graydot");
  27. }
  28. }