Click or drag to resize

clsImportService Class

Data holder to import services master data with linked items from the ERP System. Use multiple line for more than one company or the ListOfServicePositions to add all companies in one step

Used by MS Access table: MARIProjektImportService

Use MPInterface.bImportService(clsImportService, clsImportBaseeImportMode) to import.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportService

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

The clsImportService type exposes the following members.

Constructors
  NameDescription
Public methodclsImportService
Initializes a new instance of the clsImportService class
Top
Properties
  NameDescription
Public propertyCompanyID
Company ID. Used to create the properties for the first company. More company can be managed via clsImportServicePosition and the list ListOfServicePositions.
Public propertyDescription1Day
Invoice in days: Description1 of the service linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See Description1.
Public propertyDescription1Hour
Invoice in hours: Description1 of the service linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See Description1.
Public propertyDescription2Day
Invoice in days: Description2 of the service linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See Description2.
Public propertyDescription2Hour
Invoice in hours: Description2 of the service linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See Description2.
Public propertyDescriptionMemo1Day
Invoice in days: Description3 for the customer for placeholders by each time booking line linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. Placeholders can be imported using the current user language place holder codes. For example [Posting information]. See Description3.
Public propertyDescriptionMemo1Hour
Invoice in hours: Description3 for the customer for placeholders by each time booking line linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. Placeholders can be imported using the current user language place holder codes. For example [Posting information]. See Description3.
Public propertyDescriptionMemo2Day
Invoice in days: Description4 for the customer for placeholders by each time booking line linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. Placeholders can be imported using the current user language place holder codes. See Description4.
Public propertyDescriptionMemo2Hour
Invoice in hours: Description4 for the customer linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. Placeholders can be imported using the current user language place holder codes. See Description4.
Public propertyGroup1
Service Group1 (Optional)
Public propertyGroup2
Service Group2 (Optional)
Public propertyGroup3
Service Group3 (Optional)
Public propertyItemCodeDay
Invoice in days: Item number from SBO (OITM.ItemCode) linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See ItemCode.
Public propertyItemCodeHour
Invoice in hours: Item number from SBO (OITM.ItemCode) linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See ItemCode.
Public propertyItemPriceDay
Invoice in days: Selling price per hour of the service linked via CompanyID for services based on days (MARIProject SystemCurrency). More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See ContractPrice.
Public propertyItemPriceHour
Invoice in hours: Selling price per hour of the service linked via CompanyID for services based on hours (MARIProject SystemCurrency). More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See ContractPrice.
Public propertyListOfPoolLinks
List of resource pools linked to this service. See clsImportServicePoolLink.
Public propertyListOfServicePositions
Collection of hour items, day items per company. See clsImportServicePosition.
Public propertyMatchcodeDay
Invoice in days: Matchcode of the service linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See Matchcode.
Public propertyMatchcodeHour
Invoice in hours: Matchcode of the service linked via CompanyID for services based on hours, visible in the time keeping. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See Matchcode.
Public propertyOptionMemo
Internal Memo for additional properties
Public propertyPurchasePriceDay
Invoice in days: Imputed Purchase Price of the service linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See PurchasePriceManual.
Public propertyPurchasePriceHour
Invoice in hours: Imputed Purchase Price of the service linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See PurchasePriceManual.
Public propertyQuantityDay
Invoice in days: Quantity of the service linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See ContractQuantity.
Public propertyQuantityHour
Invoice in hours: Quantity of the service linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See ContractQuantity.
Public propertyQuantityUnitDay
Invoice in days: Quantity unit ("d") of the service linked via CompanyID for services based on days. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See UnitOfMeasurement.
Public propertyQuantityUnitHour
Invoice in hours: Quantity unit ("h") of the service linked via CompanyID for services based on hours. More company can be managed via clsImportServicePosition and the list ListOfServicePositions. See UnitOfMeasurement.
Public propertyServiceMatchcode
Matchcode of the service
Public propertyServiceNumber
Employee Service Number Identifier (Unique Key). Format must follow settings
Public propertyStandardphase
Store link to a phase holder. Not used
Top
Methods
  NameDescription
Public methodAddPosition
Method to add additional positions. Does not replace existing. See AddPositionWithReplace(clsImportServicePosition)
Public methodAddPositionWithReplace
Public Method to add a Service Position. This function will replace existing postiions of the same type (per day/per hour). Use AddPosition(clsImportServicePosition) to add only extra positions.
Public methodbReadFromDB
Reads the service data 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).)
Top
Remarks
Examples
Add service master with items for the first company
private string CreateServiceMaster() {
    string sErrordetails;
    clsImportService oNewService = new clsImportService();

    int lBusinessUnit = 1;//sample business unit

    //Get next free number based on the (sample) number format
    oNewService.ServiceNumber = oNewService.sGetClassNummer(oMPInterface, "S1*", clsImportBase.eCoreDataClassID.Service, lBusinessUnit);
    oNewService.ServiceMatchcode = "Project Management";

    //Setting for the service in hours (company 1)
    oNewService.CompanyID = 1;
    oNewService.ItemCodeHour = "12345"; //OITM.ItemCode
    oNewService.MatchcodeHour = "Project Management Hours"; // Text visible in the time registration
    oNewService.Description1Hour = "Project Management"; // Text visible on the invoice (for service at cost)
    oNewService.Description2Hour = "based on hours used";
    oNewService.QuantityHour = 1; // standard is one hour
    oNewService.ItemPriceHour = 125; // standard sales price per hout

    //Setting service in days (company 1)
    oNewService.ItemCodeDay = "12346"; //OITM.ItemCode
    oNewService.MatchcodeDay = "Project Management days"; // Text visible in the time registration
    oNewService.Description1Day = "Project Management"; // Text visible on the invoice (for service at cost)
    oNewService.Description2Day = "based on days used";
    oNewService.QuantityDay = 1; // standard is one day
    oNewService.ItemPriceDay = 1000; // standard sales price per hout


    if (oMPInterface.bImportService(oNewService, clsImportBase.eImportMode.ValidateAndImport)) {
        return oNewService.ServiceNumber;
    } else {
        sErrordetails = oMPInterface.oErrors.PrintErrors(true);
        Assert.False(true, sErrordetails);
        return "";
    }
}
Add a service master with a list of linked companies
private string CreateServiceMasterCompanies() {
    string sErrordetails;
    clsImportService oNewService = new clsImportService();

    //This sample creates a service and links the service to three companies
    //This sample assumes, that the item codes are synchronized between the companies

    List<short> ListCompanies = new List<short> { 1, 2, 3 };


    //Get next free number based on the (sample) number format
    oNewService.ServiceNumber = oNewService.sGetClassNummer(oMPInterface, "S1*", clsImportBase.eCoreDataClassID.Service);
    oNewService.ServiceMatchcode = "Project Management";

    //Create  3*2=6 Positions
    foreach (short Company in ListCompanies) {
        CreatePos(oNewService, Company, clsImportProjectContractPosition.eQuantityType.ServiceEquipmentInHours, "12345", "CAD in hours", 125);
        CreatePos(oNewService, Company, clsImportProjectContractPosition.eQuantityType.ServiceEquipmentInDays, "12346", "CAD in hours", 1000);
    }

    if (oMPInterface.bImportService(oNewService, clsImportBase.eImportMode.ValidateAndImport)) {
        return oNewService.ServiceNumber;
    } else {
        sErrordetails = oMPInterface.oErrors.PrintErrors(true);
        Assert.False(true, sErrordetails);
        return "";
    }
}

private void CreatePos(clsImportService oNewService, short Company, clsImportProjectContractPosition.eQuantityType QualtityType, string ItemCode, string Matchcode, Decimal Price) {
    clsImportServicePosition oPos = new clsImportServicePosition();
    oPos.PositionTyp = clsImportProjectContractPosition.eContractPositionType.ServiceAtCost;
    oPos.QuantityType = QualtityType;
    oPos.ItemCode = ItemCode;
    oPos.Matchcode = Matchcode;
    oPos.Description1 = Matchcode;
    oPos.ContractQuantity = 1;
    oPos.ContractPrice = Price;
    oNewService.AddPositionWithReplace(oPos);
}
See Also