JobITP.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Linq.Expressions;
  3. using InABox.Core;
  4. namespace Comal.Classes
  5. {
  6. [UserTracking(typeof(Job))]
  7. public class JobITP : Entity, IRemotable, IPersistent, IOneToMany<Job>, IStringAutoIncrement<JobITP>, ILicense<ProjectManagementLicense>,
  8. IExportable,
  9. IImportable, IMergeable
  10. {
  11. [NullEditor]
  12. [EditorSequence(0)]
  13. public JobLink Job { get; set; }
  14. [CodeEditor(Editable = Editable.Enabled)]
  15. [EditorSequence(1)]
  16. public string Code { get; set; }
  17. [TextBoxEditor]
  18. [EditorSequence(2)]
  19. public string Description { get; set; }
  20. [MemoEditor]
  21. [EditorSequence(3)]
  22. public string Comments { get; set; }
  23. [EditorSequence(4)]
  24. public EmployeeLink EmployeeLink { get; set; }
  25. [DateEditor]
  26. [EditorSequence(5)]
  27. public DateTime DueDate { get; set; }
  28. [Caption("ITP Form Type")]
  29. [EditorSequence(6)]
  30. public DigitalFormLink DigitalForm { get; set; }
  31. public Expression<Func<JobITP, string>> AutoIncrementField()
  32. {
  33. return x => x.Code;
  34. }
  35. public Filter<JobITP> AutoIncrementFilter()
  36. {
  37. return null;
  38. }
  39. public string AutoIncrementPrefix() => "";
  40. public string AutoIncrementFormat() => "{0:D4}";
  41. protected override void Init()
  42. {
  43. base.Init();
  44. Job = new JobLink();
  45. EmployeeLink = new EmployeeLink();
  46. DigitalForm = new DigitalFormLink();
  47. }
  48. public override string ToString()
  49. {
  50. return string.Format("{0}: {1}", Code, Description);
  51. }
  52. }
  53. }