Click or drag to resize

clsImportBPAuditPlan Class

Imports an audit plan. This links an audit template (clsImportBPAuditTemplate) to a business partner (clsImportBusinessPartner).

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

Use MPInterface.bImportBPAuditPlan(clsImportBPAuditPlan, clsImportBaseeImportMode) to import.

MSAccess Import Table: MARIProjektImportWorkItemBPAuditPlan.

Inheritance Hierarchy
SystemObject
  MARIInterfaceclsImportBase
    MARIInterfaceclsImportBPAuditPlan

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

The clsImportBPAuditPlan type exposes the following members.

Constructors
  NameDescription
Public methodclsImportBPAuditPlan
Initializes a new instance of the clsImportBPAuditPlan class
Top
Properties
  NameDescription
Public propertyAuditPlanDocNum
INT (4) Visible ID based on Number Series. Will be created automatically. Leave this blank.
Public propertyAuditPlanDocSeries
INT (4) ID of the number series
Public propertyAuditPlanID
Internal ID of the audit plan INT (4) Unique ID (via MPTAN). In access can be <100000 to align the positiosn
Public propertyAuditPlanStatus
INT (4) Status (depending on type) 1=Active,2=InActive. See clsImportBPAuditPlaneAuditPlanStatus for details.
Public propertyAuditTemplateID
Link to the Audit Template (mandatory field). See clsImportBPAuditTemplate to create Audit Templates.
Public propertyCardCode
Business Partner OCRD.CardCode
Public propertyCheckList
CheckList (int)
Public propertyCompanyID
SMALLINT (2) Link to company (SBO Database)
Public propertyCycleType
Cycle Type: Defines the recuurent cycle for the Audit Plans. Define as standard. Can be overwritten in the Plan
Public propertyCycleValue
Cycle Value = Number of month. For standard CycleType this value is set automatically
Public propertyEndDate
WorkItemEnd End of the plan
Public propertyMatchcode
NVARCHAR (50) Name of the Audit Plan
Public propertyScheduleType
Handling definition to create the plan dates for a service plan. See eScheduleType. When a ServicePlanTemplate (QualificationID) is linked and this value=None, the value is copied from the template.
Public propertyStartDate
StartDate start of the plan
Public propertyWorkDescription
NTEXT (0) Memo What to do
Public propertyWorkNotes
NTEXT (0) Memo for notes on site
Top
Methods
  NameDescription
Public methodGetListUserDefinedFields
Returns the user defined field definition for all dimension "WorkItem: Service Plan Template, Service Plan, Service Task, etc.". The fields have to be defined directly in MARIProject.
(Overrides clsImportBaseGetListUserDefinedFields(MPInterface).)
Top
Remarks
Examples
Create an audit plan linked to a business partner and an audit template
public int CreateBPAuditPlan(string sAuditPlan, int lAuditTemplate) {
    Log($"CreateBPAuditPlan({sAuditPlan}, {lAuditTemplate})");
    clsImportBPAuditPlan oBPAuditPlan = new clsImportBPAuditPlan();

    oBPAuditPlan.CompanyID = 1;
    oBPAuditPlan.CardCode = "10003";
    oBPAuditPlan.Matchcode = sAuditPlan;
    oBPAuditPlan.AuditTemplateID = lAuditTemplate;
    oBPAuditPlan.CycleType = clsImportWorkItemServicePlanTemplate.ePlanTemplateCycleType.Monthly;
    oBPAuditPlan.StartDate = DateTime.Today;
    oBPAuditPlan.EndDate = DateTime.Today.AddDays(6);

    if (!oMPInterface.bImportBPAuditPlan(oBPAuditPlan, clsImportBase.eImportMode.ValidateAndImport)) {
        // oTimeKeepingLine.oErrors contains all Errors
        LogFail(oMPInterface.oErrors.PrintErrors());
        return 0;
    } else {
        Log($"CreateBPAuditPlan: {oBPAuditPlan.AuditPlanID}");
        return oBPAuditPlan.AuditPlanID;
    }
}
See Also