LogikalProject.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using InABox.Core;
  4. using InABox.Integration.Logikal;
  5. using Newtonsoft.Json;
  6. namespace PRSDesktop.Integrations.Logikal
  7. {
  8. public class LogikalProject : LogikalItem, ILogikalProject
  9. {
  10. [NullEditor]
  11. public Guid ID { get; set; }
  12. [EditorSequence(1)]
  13. [TextBoxEditor]
  14. [Caption("Projects")]
  15. public string? Title { get; set; }
  16. [EditorSequence(2)]
  17. [TextBoxEditor(Width = 150)]
  18. [Caption("Manager")]
  19. public string? PersonInCharge { get; set; }
  20. [EditorSequence(3)]
  21. [DateTimeEditor(Width = 100, Format = "dd MMM yy")]
  22. public DateTime LastUpdated { get; set; }
  23. [TextBoxEditor(Width = 100)]
  24. public string? JobNumber { get; set; }
  25. [TextBoxEditor(Width = 100)]
  26. public string? OfferNumber { get; set; }
  27. [NullEditor]
  28. public string? Path { get; set; }
  29. [NullEditor]
  30. public DateTime Created { get; set; }
  31. public String GetReference()
  32. {
  33. return $"Logikal:{ID}";
  34. }
  35. public static bool ParseReference(string? reference, out Guid id)
  36. {
  37. id = Guid.Empty;
  38. if (reference?.StartsWith("Logikal:") != true)
  39. return false;
  40. var comps = reference.Split(':');
  41. if (comps.Length < 2)
  42. return false;
  43. if (!Guid.TryParse(comps[1], out id))
  44. return false;
  45. return true;
  46. }
  47. public override void ValidateQuery(string sql, List<string> errors)
  48. {
  49. }
  50. }
  51. }