Role.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using InABox.Core;
  3. namespace Comal.Classes
  4. {
  5. public class OrgChartSettings<TEntityLink> : BaseObject, IEnclosedEntity
  6. where TEntityLink : IEntityLink, new()
  7. {
  8. public OrgChartSettings()
  9. {
  10. ReportsTo = new TEntityLink();
  11. Color = "#00000000";
  12. Visible = true;
  13. }
  14. [EditorSequence("Org Chart", 1)]
  15. [Caption("Reports To", IncludePath = false)]
  16. public TEntityLink ReportsTo { get; set; }
  17. [EditorSequence("Org Chart", 2)]
  18. [ColorEditor]
  19. [Caption("Color", IncludePath = false)]
  20. public string Color { get; set; }
  21. [EditorSequence("Org Chart", 3)]
  22. [CheckBoxEditor]
  23. [Caption("Visible", IncludePath = false)]
  24. public bool Visible { get; set; }
  25. }
  26. public interface IOrgChart<TEntityLink> where TEntityLink : IEntityLink, new()
  27. {
  28. OrgChartSettings<TEntityLink> OrgChart { get; set; }
  29. }
  30. [UserTracking(typeof(Employee))]
  31. public class Role : Entity, IPersistent, IRemotable, IOrgChart<RoleLink>, ILicense<CoreLicense>, IExportable, IImportable
  32. {
  33. [EditorSequence(1)]
  34. [UniqueCodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
  35. public string Code { get; set; }
  36. [EditorSequence(2)]
  37. [TextBoxEditor]
  38. public string Name { get; set; }
  39. [MemoEditor]
  40. [EditorSequence("Standards",1)]
  41. public String Description { get; set; }
  42. [MemoEditor]
  43. [EditorSequence("Standards",2)]
  44. public String JobKnowledge { get; set; }
  45. [MemoEditor]
  46. [EditorSequence("Standards",3)]
  47. public String WorkQuality { get; set; }
  48. [MemoEditor]
  49. [EditorSequence("Standards",3)]
  50. public String Productivity { get; set; }
  51. [MemoEditor]
  52. [EditorSequence("Standards",4)]
  53. public String Relationships { get; set; }
  54. public OrgChartSettings<RoleLink> OrgChart { get; set; }
  55. protected override void Init()
  56. {
  57. base.Init();
  58. OrgChart = new OrgChartSettings<RoleLink>();
  59. }
  60. public override string ToString()
  61. {
  62. return Name;
  63. }
  64. }
  65. }