Click or drag to resize

clsImportGroups Class

Dataholder to import the Groups into MARIGroups or MARIProjectGroups

Use MPInterface.bImportGroup to import.

To list existing groups use MPInterface.oGetGroups

See also clsImportProjectGroups for project groups

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportGroups

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

The clsImportGroups type exposes the following members.

Constructors
  NameDescription
Public methodclsImportGroups
Initializes a new instance of the clsImportGroups class
Top
Properties
  NameDescription
Public propertyBusinessUnit
not used
Public propertyDescription
Main visible field 40 char long.
Public propertyGroupID
Inernal (invisible) group code. Will be created in the import. This value is stored in the different master data as group value.
Public propertyGroupMemo
internal Memo
Public propertyGroupType
Internal Code for the type of group. Mandatory to use. See eGroupType for details.
Public propertyIndent
Not used right now. Hierarchy starting by 0
Public propertyLeafType
not used
Public propertyParent
not used
Public propertyPosition
Order in the group. If empty, the new entry will be added at the end.
Top
Methods
Fields
  NameDescription
Public fieldOptionMemo
not used
Top
Remarks
Examples
Get existing group or create a new group
public int GetOrCreateGroup(clsImportGroups.eGroupType nGroupType, string GroupName) {
    List<MARIInterface.clsKeyPair> ListOfGroup;
    //Load list all group values
    ListOfGroup = oMPInterface.oGetGroups(nGroupType);

    //Seach if groups is existing
    foreach (MARIInterface.clsKeyPair oPair in ListOfGroup) {
        if (oPair.sMatchcode.ToUpper() == GroupName.ToUpper()) {
            return Int32.Parse(oPair.sKeyInternal);
        }
    }

    //Group not found, create it
    clsImportGroups NewGroup = new clsImportGroups();
    NewGroup.GroupType = nGroupType;
    NewGroup.Description = GroupName;
    if (oMPInterface.bImportGroup(NewGroup, clsImportBase.eImportMode.ValidateAndImport)) {
        return NewGroup.GroupID;
    } else {
        string sErrordetails = oMPInterface.oErrors.PrintErrors(true);
        Assert.False(true, sErrordetails);
        return 0;
    }
}
See Also