DigitalFormInstanceShell.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 : BaseObject, 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. .Map(nameof(Cancelled), x=>x.FormCancelled);
  26. }
  27. public String Number
  28. {
  29. get => Get<String>();
  30. set => Set(value);
  31. }
  32. public Guid ParentID
  33. {
  34. get => Get<Guid>();
  35. set => Set(value);
  36. }
  37. public Guid FormID
  38. {
  39. get => Get<Guid>();
  40. set => Set(value);
  41. }
  42. public String FormCode
  43. {
  44. get => Get<String>();
  45. set => Set(value);
  46. }
  47. public String FormDescription
  48. {
  49. get => Get<String>();
  50. set => Set(value);
  51. }
  52. public DateTime Created => Get<DateTime>();
  53. public DateTime Completed
  54. {
  55. get => Get<DateTime>();
  56. set => Set(value);
  57. }
  58. public DateTime Cancelled
  59. {
  60. get => Get<DateTime>();
  61. set => Set(value);
  62. }
  63. public DateTime Started
  64. {
  65. get => Get<DateTime>();
  66. set => Set(value);
  67. }
  68. public String Data
  69. {
  70. get => Get<String>();
  71. set => Set(value);
  72. }
  73. }
  74. }