MeetingModel.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 MeetingModel : Model<MeetingModel, Meeting>
  10. {
  11. public Guid MeetingID { get; set; }
  12. public int Number { get; set; }
  13. public String? Title { get; set; }
  14. public String? Description { get; set; }
  15. public DateTime Date { get; }
  16. public TimeSpan Start { get; set; }
  17. public TimeSpan Finish { get; set; }
  18. public TimeSpan Duration { get; }
  19. public Guid ActivityID { get; set; }
  20. public string? ActivityCode { get; }
  21. public string? ActivityDescription { get; }
  22. public string? Color { get; }
  23. public MeetingModel(CoreRow row) : base(row)
  24. {
  25. MeetingID = Get(x => x.ID);
  26. Number = Get(x => x.Number);
  27. Title = Get(x => x.Title);
  28. Description = Get(x => x.Description);
  29. Date = Get(x=>x.Date);
  30. Start = Get(x => x.Time.Start);
  31. Finish = Get(x => x.Time.Finish);
  32. Duration = Get(x => x.Time.Duration);
  33. ActivityID = Get(x => x.Activity.ID);
  34. ActivityCode = Get(x => x.Activity.Code);
  35. ActivityDescription = Get(x => x.Activity.Description);
  36. Color = Get(x => x.Activity.Color);
  37. }
  38. public override Columns<Meeting> GetColumns()
  39. {
  40. return InABox.Core.Columns.None<Meeting>().Add(x => x.ID)
  41. .Add(x => x.Number)
  42. .Add(x => x.Title)
  43. .Add(x => x.Description)
  44. .Add(x => x.Date)
  45. .Add(x => x.Time.Start)
  46. .Add(x => x.Time.Duration)
  47. .Add(x => x.Time.Finish)
  48. .Add(x => x.Activity.ID)
  49. .Add(x => x.Activity.Code)
  50. .Add(x => x.Activity.Description)
  51. .Add(x => x.Activity.Color);
  52. }
  53. }
  54. }