clsImportEquipmentCategory Class |
View: MARIEquipmentCategory: :Table: MPEquipmentCategory
Table in access: MARIProjektImportEquipmentCategory. See clsImportBase.eImportMode relative tables in MS-Access.Use MPInterface.bImportEquipmentCategory(clsImportEquipmentCategory, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportEquipmentCategory type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportEquipmentCategory | Initializes a new instance of the clsImportEquipmentCategory class |
| Name | Description | |
|---|---|---|
| AccessAll | AccessAll: Based on the bit flagg of user groups | |
| AccessChange | AccessChange: Based on the bit flagg of user groups | |
| AccessDelete | AccessDelete: Based on the bit flagg of user groups | |
| AccessInsert | AccessInsert: Based on the bit flagg of user groups | |
| AccessMode | AccessMode | |
| AccessRead | AccessRead: Based on the bit flagg of user groups | |
| CategoryName | CategoryName | |
| CollectionParts | ||
| CreationPrefix | CreationPrefix can be used for new equipment of this category E400* | |
| CustomerAccessAll | CustomerAccessAll: Based on the bit flagg of customer user groups | |
| CustomerAccessChange | CustomerAccessChange: Based on the bit flagg of customer user groups | |
| CustomerAccessDelete | CustomerAccessDelete: Based on the bit flagg of customer user groups | |
| CustomerAccessInsert | CustomerAccessInsert: Based on the bit flagg of customer user groups | |
| CustomerAccessMode | CustomerAccessMode | |
| CustomerAccessRead | CustomerAccessRead: Based on the bit flagg of customer user groups | |
| DefaultCompanyID | DefaultCompanyID. Used as additional information to store the DefaultItemCode. | |
| DefaultItemCode | DefaultItemCode | |
| DefaultProject | DefaultProject | |
| EquipmentCategoryID | 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)
| |
| Group1 | Group1. GroupType=10500. EquipmentCategoryGroup1 | |
| Group2 | Group2. GroupType=10501. EquipmentCategoryGroup2 | |
| Group3 | Group3. GroupType=10502. EquipmentCategoryGroup3 | |
| HandleQuantity | HandleQuantity | |
| ImportCategorySubjectReservationPlanningDays |
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.
| |
| Inactive | Inactive | |
| ListCategorySubjects |
List for adding several CategorySubjects. (There must be one of the type
| |
| Memo | Memo | |
| PictureArrayOfBytes |
The picture can be transfered via a byte array instead of a PictureFileName.
| |
| PictureFileName | 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 | |
| QuantityUnit | QuantityUnit | |
| SLA_ID | SLA Rule for tickets created based on equipment of this category. | |
| ViewPort | ViewPort Definition of a special view of user defined fields in the equipment master. | |
| ViewPortCustomerID | ViewPort for the customer portal user (view of user defined fields in the equipment master) |
| Name | Description | |
|---|---|---|
| bReadFromDB |
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).) | |
| bSaveRSToMDB | (Overrides clsImportBasebSaveRSToMDB(MPInterface, DataRow, DataTable).) | |
| GetListUserDefinedFields |
Returns the user defined field for the new created Equipment Category. The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).) |
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; } }