TimeSheetModel.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.ObjectModel;
  3. using System.Windows.Media;
  4. using Comal.Classes;
  5. using InABox.Core;
  6. using InABox.WPF;
  7. namespace PRSDesktop
  8. {
  9. public class TimeSheetModel : Model<TimeSheetModel,TimeSheet>
  10. {
  11. public DateTime Date { get; }
  12. public TimeSpan Start { get; }
  13. public TimeSpan Finish { get; }
  14. public TimeSpan ApprovedStart { get; }
  15. public TimeSpan ApprovedFinish { get; }
  16. public DateTime Approved { get; }
  17. public String? Code { get; }
  18. public String? Color { get; }
  19. public String? Subject { get; }
  20. public String? Notes { get; }
  21. public Guid EmployeeID { get; }
  22. public TimeSheetModel(CoreRow row) : base(row)
  23. {
  24. Date = Get(x => x.Date);
  25. Start = Get(x => x.Start);
  26. Finish = Get(x => x.Finish);
  27. ApprovedStart = Get(x => x.ApprovedStart);
  28. ApprovedFinish = Get(x => x.ApprovedFinish);
  29. Approved = Get(x => x.Approved);
  30. Code = Get(x => x.ActivityLink.Code);
  31. Subject = Get(x => x.ActivityLink.Description);
  32. Color = Get(x => x.ActivityLink.Color);
  33. Notes = Get(x => x.Notes);
  34. EmployeeID = Get(x => x.EmployeeLink.ID);
  35. }
  36. public override Columns<TimeSheet> GetColumns()
  37. {
  38. return InABox.Core.Columns.None<TimeSheet>().Add(x => x.ID)
  39. .Add(x => x.Date)
  40. .Add(x => x.Start)
  41. .Add(x => x.Finish)
  42. .Add(x => x.ApprovedStart)
  43. .Add(x => x.ApprovedFinish)
  44. .Add(x => x.Approved)
  45. .Add(x => x.EmployeeLink.ID)
  46. .Add(x=>x.ActivityLink.Code)
  47. .Add(x=>x.ActivityLink.Description)
  48. .Add(x=>x.ActivityLink.Color)
  49. .Add(x=>x.Notes);
  50. }
  51. }
  52. }