clsImportGroups Class |
Use MPInterface.bImportGroup to import.
To list existing groups use MPInterface.oGetGroups
See also clsImportProjectGroups for project groups
Namespace: MARIInterface
The clsImportGroups type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportGroups | Initializes a new instance of the clsImportGroups class |
| Name | Description | |
|---|---|---|
| BusinessUnit | not used | |
| Description | Main visible field 40 char long. | |
| GroupID |
Inernal (invisible) group code. Will be created in the import. This value is stored in the different master data as group value.
| |
| GroupMemo | internal Memo | |
| GroupType |
Internal Code for the type of group. Mandatory to use. See eGroupType for details.
| |
| Indent | Not used right now. Hierarchy starting by 0 | |
| LeafType | not used | |
| Parent | not used | |
| Position | Order in the group. If empty, the new entry will be added at the end. |
| Name | Description | |
|---|---|---|
| bReadFromDB |
Only for internal use! To load data use your own SQL.
(Overrides clsImportBasebReadFromDB(MPInterface, String).) | |
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) |
| Name | Description | |
|---|---|---|
| OptionMemo | not used |
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; } }