Click or drag to resize

clsImportEquipmentCategory Class

Import for table MPEquipmentCategory: EquipmentCategory: Cagetory Master

View: MARIEquipmentCategory: :Table: MPEquipmentCategory

Table in access: MARIProjektImportEquipmentCategory. See clsImportBase.eImportMode relative tables in MS-Access.

Use MPInterface.bImportEquipmentCategory(clsImportEquipmentCategory, clsImportBaseeImportMode) to import.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportEquipmentCategory

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

The clsImportEquipmentCategory type exposes the following members.

Constructors
  NameDescription
Public methodclsImportEquipmentCategory
Initializes a new instance of the clsImportEquipmentCategory class
Top
Properties
  NameDescription
Public propertyAccessAll
AccessAll: Based on the bit flagg of user groups
Public propertyAccessChange
AccessChange: Based on the bit flagg of user groups
Public propertyAccessDelete
AccessDelete: Based on the bit flagg of user groups
Public propertyAccessInsert
AccessInsert: Based on the bit flagg of user groups
Public propertyAccessMode
AccessMode
Public propertyAccessRead
AccessRead: Based on the bit flagg of user groups
Public propertyCategoryName
CategoryName
Public propertyCollectionParts
Public propertyCreationPrefix
CreationPrefix can be used for new equipment of this category E400*
Public propertyCustomerAccessAll
CustomerAccessAll: Based on the bit flagg of customer user groups
Public propertyCustomerAccessChange
CustomerAccessChange: Based on the bit flagg of customer user groups
Public propertyCustomerAccessDelete
CustomerAccessDelete: Based on the bit flagg of customer user groups
Public propertyCustomerAccessInsert
CustomerAccessInsert: Based on the bit flagg of customer user groups
Public propertyCustomerAccessMode
CustomerAccessMode
Public propertyCustomerAccessRead
CustomerAccessRead: Based on the bit flagg of customer user groups
Public propertyDefaultCompanyID
DefaultCompanyID. Used as additional information to store the DefaultItemCode.
Public propertyDefaultItemCode
DefaultItemCode
Public propertyDefaultProject
DefaultProject
Public propertyEquipmentCategoryID
EquipmentCategory (Internal number. Can be 0 and will be created. Should be 1-99999 for internal reference in the access database) (IDs < 100000 used in mdb will be replaced after creation of the category)
Public propertyGroup1
Group1. GroupType=10500. EquipmentCategoryGroup1
Public propertyGroup2
Group2. GroupType=10501. EquipmentCategoryGroup2
Public propertyGroup3
Group3. GroupType=10502. EquipmentCategoryGroup3
Public propertyHandleQuantity
HandleQuantity
Public propertyImportCategorySubjectReservationPlanningDays
To create a category, it is mandatory to have one subject of the type clsImportEquipmentCategorySubjecteUnitHandling ReservationPlanningDays(1). The information are necessary to create a category. Please create an instance of clsImportEquipmentCategorySubject with the corresponding information and link it to the new category.
Public propertyInactive
Inactive
Public propertyListCategorySubjects
List for adding several CategorySubjects. (There must be one of the type
Public propertyMemo
Memo
Public propertyPictureArrayOfBytes
The picture can be transfered via a byte array instead of a PictureFileName.
Public propertyPictureFileName
Linking a file name, will load this file into the database. The file content has to be accessable from the import process.

The picture content is stored in: View: MARIPictures : : Table: MPBilder

Public propertyQuantityUnit
QuantityUnit
Public propertySLA_ID
SLA Rule for tickets created based on equipment of this category.
Public propertyViewPort
ViewPort Definition of a special view of user defined fields in the equipment master.
Public propertyViewPortCustomerID
ViewPort for the customer portal user (view of user defined fields in the equipment master)
Top
Methods
  NameDescription
Public methodbReadFromDB
Reads the equipment category from the database and copies the values to the class Only for internal use! To load data use your own SQL.
(Overrides clsImportBasebReadFromDB(MPInterface, String).)
Public methodbSaveRSToMDB (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).)
Public methodGetListUserDefinedFields
Returns the user defined field for the new created Equipment Category. The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Top
Examples
Create Equipment Category Example
private int CreateEquipmentCategory(int lCompany1BusinessUnit, int lCompany2BusinessUnit) {
    MARIInterface.clsImportEquipmentCategory NewEquipmentCategory = new MARIInterface.clsImportEquipmentCategory();
    NewEquipmentCategory.CategoryName = "New Rental Equipment Category";
    NewEquipmentCategory.PictureArrayOfBytes = oGetDummyPictureAsBytes();
    NewEquipmentCategory.DefaultCompanyID = 1;
    NewEquipmentCategory.DefaultItemCode = "210000"; // Purchase item
    // ... Add more properties

    //Add the first mandatory cost type (equpment subject)
    MARIInterface.clsImportEquipmentCategorySubject NewSubject = new MARIInterface.clsImportEquipmentCategorySubject();
    NewSubject.SubjectName = "Rental in days";
    NewSubject.UnitHandling = MARIInterface.clsImportEquipmentCategorySubject.eUnitHandling.ReservationPlanningDays;
    NewSubject.DefaultCostMode = clsImportEquipmentCategorySubject.eCategorySubjectCostMode.ItemsAndCostByCompany;
    NewSubject.Unit = "d";
    NewSubject.Description1 = "Rental in days (Text visible by the customer in the contract)";
    NewSubject.HelpValidFrom = new DateTime(2014, 10, 1);

    //Set for each company the Item Code, cost price and sales price

    NewSubject.AddSubjectRate(lCompany1BusinessUnit, "220001", 33.23m, 130.1m); // Company 1
    if (lCompany2BusinessUnit > 1) {
        NewSubject.AddSubjectRate(lCompany2BusinessUnit, "220001", 33.23m, 130.1m); // Company 2
    }

    NewEquipmentCategory.ImportCategorySubjectReservationPlanningDays = NewSubject;

    if (!oMPInterface.bImportEquipmentCategory(NewEquipmentCategory, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) {
        LogFail(oMPInterface.oErrors.PrintErrors());
        return 0;
    } else {
        string sMessage = "New Equipment Category Created. Unique key EquipmentCategory = " + NewEquipmentCategory.EquipmentCategoryID.ToString();
        return NewEquipmentCategory.EquipmentCategoryID;
    }
}
See Also