Click or drag to resize

clsImportSkill Class

Import for table MPSkills: Skill . Use MPInterface.bImportSkill(clsImportSkill, clsImportBaseeImportMode) to import. Reads the MARIProjektImportData.mdb and the tables MARIProjektImportSkills.
Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportSkill

Namespace:  MARIInterface
Assembly:  MARIInterface (in MARIInterface.dll) Version: 8.0.0.100
Syntax
public class clsImportSkill : clsImportBase

The clsImportSkill type exposes the following members.

Constructors
  NameDescription
Public methodclsImportSkill
Initializes a new instance of the clsImportSkill class
Top
Properties
  NameDescription
Public propertyDescription
Description of the skill
Public propertyIndent
Indent 1=First indent level
Public propertyOptionMemo
Memo field for a skill
Public propertyParent
Parent. Points to the parent ID.
Public propertyPositionOrder
PositionOrder: Order of all skills. If 0 in import, the new skill will be apanded.
Public propertySkillID
Internal ID for the skill. Created during import.
Public propertySkillMemo
Memo field for a skill
Public propertyTreeType
1=Leave, 2=branch
Top
Methods
Remarks
Examples
Create new skills
public void CreateSkills() {

    int lParent = CreateSkillMaster("Language Skills");
    if (lParent != 0) {
        CreateSkillMaster("English", lParent);
        CreateSkillMaster("German", lParent);
        CreateSkillMaster("Spanish", lParent);
        CreateSkillMaster("Frensh", lParent);
    }
}

public int CreateSkillMaster(string sDescription, int lParent = 0) {

    MARIInterface.clsImportSkill NewSkill = new clsImportSkill();
    NewSkill.Description = sDescription;
    if (lParent == 0) {
        NewSkill.Indent = 1;
    } else {
        NewSkill.Parent = lParent;
        NewSkill.Indent = 2;
    }

    if (!oMPInterface.bImportSkill(NewSkill, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) {
        throw new Exception(oMPInterface.oErrors.PrintErrors());
    } else {
        return NewSkill.SkillID;
    }
}
Link a skill to an existing employee
public void AddSkill2Employee(string sEmployeeNumber) {

    MARIInterface.clsImportEmployeeSkillLink NewEmployeeSkillLink = new MARIInterface.clsImportEmployeeSkillLink();
    NewEmployeeSkillLink.EmployeeNumber = sEmployeeNumber;
    NewEmployeeSkillLink.SkillID = 100006; //SELECT EmployeeGroupID FROM MARISkillMaster WHERE TreeType=1
    NewEmployeeSkillLink.ValidFrom = new DateTime(2015, 12, 1);
    NewEmployeeSkillLink.Knowledge = "perfect";

    if (!oMPInterface.bImportEmployeeSkillLink(NewEmployeeSkillLink, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) {
        throw new Exception(oMPInterface.oErrors.PrintErrors());
    }
}
See Also