AssignmentModel.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 AssignmentModel : Model<AssignmentModel,Assignment>
  10. {
  11. public Guid EmployeeID { get; }
  12. public int Number { get; set; }
  13. public String? Subject { get; set; }
  14. public String? Notes { get; set; }
  15. public DateTime Completed { get; set; }
  16. public DateTime Date { get; }
  17. public TimeSpan BookedStart { get; set; }
  18. public TimeSpan BookedFinish { get; set; }
  19. public TimeSpan BookedDuration { get; }
  20. public TimeSpan ActualStart { get; set; }
  21. public TimeSpan ActualDuration { get; set; }
  22. public TimeSpan ActualFinish { get; set; }
  23. public Guid JobID { get; }
  24. public string? JobNumber { get; }
  25. public string? JobName { get; }
  26. public Guid ActivityID { get; set; }
  27. public string? ActivityCode { get; }
  28. public string? ActivityDescription { get; }
  29. public string? Color { get; }
  30. public Guid ItpID { get; set; }
  31. public string? ItpCode { get; set; }
  32. public string? ItpDescription { get; set; }
  33. public Guid DeliveryID { get; set; }
  34. public string? DeliveryNotes { get; set; }
  35. public Guid TaskID { get; set; }
  36. public int TaskNumber { get; set; }
  37. public AssignmentModel(CoreRow row) : base(row)
  38. {
  39. EmployeeID = Get(x=>x.EmployeeLink.ID);
  40. Number = Get(x => x.Number);
  41. Subject = Get(x => x.Title);
  42. Notes = Get(x => x.Description);
  43. Completed = Get(x => x.Completed);
  44. Date = Get(x=>x.Date);
  45. BookedDuration = Get(x => x.Booked.Duration);
  46. BookedStart = Get(x => x.Booked.Start);
  47. BookedFinish = Get(x => x.Booked.Finish);
  48. ActualStart = Get(x => x.Actual.Start);
  49. ActualDuration = Get(x => x.Actual.Duration);
  50. ActualFinish = Get(x => x.Actual.Finish);
  51. JobID = Get(x => x.JobLink.ID);
  52. JobNumber = Get(x => x.JobLink.JobNumber);
  53. JobName = Get(x => x.JobLink.Name);
  54. ActivityID = Get(x => x.ActivityLink.ID);
  55. ActivityCode = Get(x => x.ActivityLink.Code);
  56. ActivityDescription = Get(x => x.ActivityLink.Description);
  57. Color = Get(x => x.ActivityLink.Color);
  58. ItpID = Get(x => x.ITP.ID);
  59. ItpCode = Get(x => x.ITP.Code);
  60. ItpDescription = Get(x => x.ITP.Description);
  61. DeliveryID = Get(x => x.Delivery.ID);
  62. DeliveryNotes = Get(x => x.Delivery.Notes);
  63. TaskID = Get(x => x.Task.ID);
  64. TaskNumber = Get(x => x.Task.Number);
  65. }
  66. public override Columns<Assignment> GetColumns()
  67. {
  68. return new Columns<Assignment>(x => x.ID)
  69. .Add(x => x.EmployeeLink.ID)
  70. .Add(x => x.Number)
  71. .Add(x => x.Title)
  72. .Add(x => x.Description)
  73. .Add(x => x.Completed)
  74. .Add(x => x.Date)
  75. .Add(x => x.Booked.Start)
  76. .Add(x => x.Booked.Duration)
  77. .Add(x => x.Booked.Finish)
  78. .Add(x => x.Actual.Start)
  79. .Add(x => x.Actual.Duration)
  80. .Add(x => x.Actual.Finish)
  81. .Add(x => x.JobLink.ID)
  82. .Add(x => x.JobLink.JobNumber)
  83. .Add(x => x.JobLink.Name)
  84. .Add(x => x.ActivityLink.ID)
  85. .Add(x => x.ActivityLink.Code)
  86. .Add(x => x.ActivityLink.Description)
  87. .Add(x => x.ActivityLink.Color)
  88. .Add(x => x.ITP.ID)
  89. .Add(x => x.ITP.Code)
  90. .Add(x => x.ITP.Description)
  91. .Add(x => x.Delivery.ID)
  92. .Add(x => x.Delivery.Notes)
  93. .Add(x => x.Task.ID)
  94. .Add(x => x.Task.Number);
  95. }
  96. }
  97. }