瀏覽代碼

Added RoleQualification and EmployeeRequiredQualification to manage required tickets for employees
Added Job Descriptions and Review standards to Role class

Frank van den Bos 2 年之前
父節點
當前提交
7e7b10b739

+ 52 - 0
prs.classes/Entities/Qualification/EmployeeRequiredQualification.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Linq.Expressions;
+using InABox.Core;
+
+namespace Comal.Classes
+{
+    
+    public interface IEmployeeRequiredQualification
+    {
+        EmployeeLink Employee { get; set; }
+        
+        QualificationLink Qualification { get; set; }        
+    }
+    
+    public class EmployeeRequiredQualificationCrossGenerator : AutoEntityCrossGenerator<IEmployeeRequiredQualification,EmployeeRole,RoleQualification>
+    {
+        public override Expression<Func<EmployeeRole, Guid>> LeftProperty => x => x.EmployeeLink.ID;
+        public override Expression<Func<IEmployeeRequiredQualification, Guid>> LeftMapping => x => x.Employee.ID;
+        public override Expression<Func<EmployeeRole, Guid>> LeftLink => x => x.RoleLink.ID;
+
+        public override Expression<Func<RoleQualification, Guid>> RightProperty => x => x.Qualification.ID;
+        public override Expression<Func<IEmployeeRequiredQualification, Guid>> RightMapping => x => x.Qualification.ID;
+        public override Expression<Func<RoleQualification, Guid>> RightLink => x => x.Role.ID;
+
+        public override bool Distinct => true;
+
+        public override Column<IEmployeeRequiredQualification>[] IDColumns => new Column<IEmployeeRequiredQualification>[]
+        {
+            new Column<IEmployeeRequiredQualification>(x => x.Employee.ID),
+            new Column<IEmployeeRequiredQualification>(x => x.Qualification.ID)
+        };
+    }
+    
+    [UserTracking(typeof(Employee))]
+    [AutoEntity(typeof(EmployeeRequiredQualificationCrossGenerator))]
+    public class EmployeeRequiredQualification : Entity, IRemotable, IPersistent, IEmployeeRequiredQualification,
+        ILicense<CoreLicense>
+    {
+        [EntityRelationship(DeleteAction.Cascade)]
+        public EmployeeLink Employee { get; set; }
+
+        [EntityRelationship(DeleteAction.Cascade)]
+        public QualificationLink Qualification { get; set; }
+
+        protected override void Init()
+        {
+            base.Init();
+            Employee = new EmployeeLink();
+            Qualification = new QualificationLink();
+        }
+    }
+}

+ 28 - 0
prs.classes/Entities/Qualification/RoleQualification.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Linq.Expressions;
+using InABox.Core;
+
+namespace Comal.Classes
+{
+    [UserTracking(typeof(Qualification))]
+    public class RoleQualification : Entity, IRemotable, IPersistent, IManyToMany<Role, Qualification>, ILicense<HumanResourcesLicense>,
+        IExportable, IImportable
+    {
+        [EditorSequence(0)]
+        [EntityRelationship(DeleteAction.Cascade)]
+        public RoleLink Role { get; set; }
+
+        [EditorSequence(1)]
+        [EntityRelationship(DeleteAction.Cascade)]
+        public QualificationLink Qualification { get; set; }
+        
+        protected override void Init()
+        {
+            base.Init();
+            Role = new RoleLink();
+            Qualification = new QualificationLink();
+        }
+    }
+    
+
+}

+ 23 - 2
prs.classes/Entities/Role/Role.cs

@@ -1,4 +1,5 @@
-using InABox.Core;
+using System;
+using InABox.Core;
 
 namespace Comal.Classes
 {
@@ -42,7 +43,27 @@ namespace Comal.Classes
         [EditorSequence(2)]
         [TextBoxEditor]
         public string Name { get; set; }
-
+        
+        [MemoEditor]
+        [EditorSequence("Standards",1)]
+        public String Description { get; set; }
+        
+        [MemoEditor]
+        [EditorSequence("Standards",2)]
+        public String JobKnowledge { get; set; }
+        
+        [MemoEditor]
+        [EditorSequence("Standards",3)]
+        public String WorkQuality { get; set; }
+        
+        [MemoEditor]
+        [EditorSequence("Standards",3)]
+        public String Productivity { get; set; }
+                
+        [MemoEditor]
+        [EditorSequence("Standards",4)]
+        public String Relationships { get; set; }
+        
         public OrgChartSettings<RoleLink> OrgChart { get; set; }
 
         protected override void Init()