DigitalFormInstanceShell.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System;
  2. using Comal.Classes;
  3. using InABox.Core;
  4. using InABox.Mobile;
  5. namespace PRS.Mobile
  6. {
  7. public abstract class DigitalFormInstanceShell<TModel, TParent, TParentLink,TForm> : Shell<TModel, TForm>, IDigitalFormInstanceShell
  8. where TModel : ICoreRepository
  9. where TParent : Entity
  10. where TParentLink :IEntityLink<TParent>, new()
  11. where TForm : EntityForm<TParent,TParentLink,TForm>, new()
  12. {
  13. protected override void ConfigureColumns(ShellColumns<TModel, TForm> columns)
  14. {
  15. columns
  16. .Map(nameof(Number), x=>x.Number)
  17. .Map(nameof(ParentID), x => x.Parent.ID)
  18. .Map(nameof(FormID), x=>x.Form.ID)
  19. .Map(nameof(FormCode), x => x.Form.Code)
  20. .Map(nameof(FormDescription), x => x.Form.Description)
  21. .Map(nameof(Completed), x => x.FormCompleted)
  22. .Map(nameof(Started), x=>x.FormStarted)
  23. .Map(nameof(Data), x=>x.FormData)
  24. .Map(nameof(Created), x=>x.Created);
  25. }
  26. public String Number
  27. {
  28. get => Get<String>();
  29. set => Set(value);
  30. }
  31. public Guid ParentID
  32. {
  33. get => Get<Guid>();
  34. set => Set(value);
  35. }
  36. public Guid FormID
  37. {
  38. get => Get<Guid>();
  39. set => Set(value);
  40. }
  41. public String FormCode
  42. {
  43. get => Get<String>();
  44. set => Set(value);
  45. }
  46. public String FormDescription
  47. {
  48. get => Get<String>();
  49. set => Set(value);
  50. }
  51. public DateTime Created => Get<DateTime>();
  52. public DateTime Completed
  53. {
  54. get => Get<DateTime>();
  55. set => Set(value);
  56. }
  57. public DateTime Started
  58. {
  59. get => Get<DateTime>();
  60. set => Set(value);
  61. }
  62. public String Data
  63. {
  64. get => Get<String>();
  65. set => Set(value);
  66. }
  67. }
  68. }