clsImportWorkItemTrainingCourse Class |
A training course is stored in the same tables as service tasks. For MARIInterface different classes are used, to explain the different usage of details
After creating the main trainings course, add positions resources and options:Use the bImportTrainingCourse(clsImportWorkItemTrainingCourse, clsImportBaseeImportMode) function to import the trainigs course.
Namespace: MARIInterface
The clsImportWorkItemTrainingCourse type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportWorkItemTrainingCourse | Initializes a new instance of the clsImportWorkItemTrainingCourse class |
| Name | Description | |
|---|---|---|
| AddrAddressType | Address Type to distinguish between a onsite location (offline) or an online course. clsImportWorkItemTrainingCourseeAddressType | |
| AddrBlock |
Location of the training: Block
| |
| AddrBuilding |
Location of the training: Building
| |
| AddrCardFName |
NVARCHAR (100) A0CardFName
| |
| AddrCity |
Location of the training: City
| |
| AddrContactPersonID |
Location of the training: Contract person for the location (out of the customer)
| |
| AddrCountry |
Location of the training: Country Code
| |
| AddrCounty |
Location of the training: County
| |
| AddressMemo | Extra address information. Also used for OnlineAddressAlternativText | |
| AddrMatchcode |
NVARCHAR (100) A0Matchcode
| |
| AddrName1 |
Location of the training: Name1
| |
| AddrName2 |
Location of the training: Name2
| |
| AddrName3 |
Location of the training: Name3
| |
| AddrSalutation |
Location of the training:
| |
| AddrState |
Location of the training: State Code
| |
| AddrStreet |
NLocation of the training: Street
| |
| AddrStreetNo |
Location of the training: Street Number
| |
| AddrZIP |
Location of the training: ZIP Code
| |
| CardCode |
Location of the training: Link to Customer/supplier
| |
| CheckList | optional CheckList | |
| CompanyId |
Link to company (SBO Database)
| |
| ContractID |
Link to managing and cost collecting contract
| |
| ContractPositionID |
Default setting for new positions. 0=New positions as "at cost", Link to fixed price position
| |
| EndDateTime |
End of the course with hh:mm
| |
| Group1 | Group1 The GroupType (GruppenArt) depends on the WorkItemType | |
| Group2 | Group2 The GroupType (GruppenArt) depends on the WorkItemType | |
| Group3 | Group3 The GroupType (GruppenArt) depends on the WorkItemType | |
| GroupID | Group0 The GroupType (GruppenArt) depends on the WorkItemType | |
| InvoiceOptions | Default Invoice handling for newly created registrations. clsImportWorkItemTrainingCourseeInvoiceOption | |
| ListOfCoursePositions | (Optionally) Add a list of clsImportWorkItemTrainingCoursePos positions in the training course. Some will be registration fees. Only if RegistrationOptions = ContractPosSelection or OptionAndContractPositionSelection Additionally positions for cost handling can be added | |
| ListOfCourseResources |
(Optionally) Add a list of clsImportWorkItemTrainingResources employees (trainer, backoffice), equipment, external contact person handling a training course.
| |
| ListOfOptions |
(Optionally) Add a list of clsImportWorkItemTrainingOption options for the registration to select. Only if RegistrationOptions = OptionSelection or OptionAndContractPositionSelection
| |
| ListOfScheduledDays |
A main training course can have additional follow up courses or alternative dates
| |
| Matchcode |
Name of the trainings course
| |
| MaxParticipants | Max Participants | |
| MinParticipants | MinParticipants | |
| OnlineAddressAlternativText | Only when AddrAddressType=OnlineAlternative: Stores the initial text for the registration notification, that the login information will follow. | |
| OnlineAddressPassword | ||
| OnlineAddressURL | ||
| OnlineAddressUser | ||
| PhaseID |
Standard phase to start
| |
| Project |
Link to Project for the course
| |
| Reference1 | Reference1 | |
| Reference2 | Reference2 | |
| Reference3 | Reference3 | |
| RegisterProcess | RegisterProcess | |
| RegistrationOptions | Registration Options. See clsImportWorkItemTrainingCourseeRegisterOptions | |
| StartDateTime |
Start of course with hh:mm
| |
| SysMasterProperties |
Optional: Link this training course to one or many SysMaster Properties. Having the ID in the list means, that the property is true.
See the clsImportSysMasterProperties description to create new properites. All selected properties must have a UsageFlag of ClassID492WorkItemTrainingCourse. | |
| TrainingCourseDocNum |
WorkItemDocNum INT (4) Visible ID based on Number Series. Will be created automatically. Leave this blank.
| |
| TrainingCourseDocSeries |
INT (4) ID of the number series
| |
| TrainingCourseID |
Internal trainings course id INT (4) Unique ID (via MPTAN). In access can be <100000 to align the positiosn
| |
| TrainingCourseIDMain | Links a training cours of the TrainingSubType = FollowUpTrainingCourse to the main training course | |
| TrainingCourseStatus |
INT (4) Status (depending on type) 1:Request,2=Active,3=CloseReadyToInvoice,4=ClosedInvoiced. See eTrainngCourseStatus for details.
| |
| TrainingSubType | WorkItemSubType Used for events | |
| VisibilityPortal | Defines the visibility in the web portal. See clsImportWorkItemTrainingCourseeVisibilityPortal | |
| WorkDescription |
NTEXT (0) Memo What to do
| |
| WorkNotes |
NTEXT (0) Memo for notes on site
|
| Name | Description | |
|---|---|---|
| bReadFromDB | (Overrides clsImportBasebReadFromDB(MPInterface, String).) | |
| GetListUserDefinedFields |
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).) |
private clsImportWorkItemTrainingCourse CreateCourse(string Matchcode, DateTime StartTime, string Project, int Contract, int ContractPos, int Phase) { Log($"CreateCourse(\"{Matchcode}\", {StartTime:yyyy-MM-dd hh:mm}, \"{Project}\", Contract {Contract}, Servicepos {ContractPos}, Phase{Phase})"); clsImportWorkItemTrainingCourse Course = new clsImportWorkItemTrainingCourse(); Course.Matchcode = Matchcode; Course.CompanyId = 1; Course.StartDateTime = StartTime; Course.EndDateTime = StartTime.AddDays(1).AddHours(8); Course.Project = Project; Course.ContractID = Contract; // Managing and cost collection contract Course.ContractPositionID = ContractPos; Course.PhaseID = Phase; Course.TrainingCourseStatus = clsImportWorkItemTrainingCourse.eTrainngCourseStatus.Active; Course.RegistrationOptions = clsImportWorkItemTrainingCourse.eRegisterOptions.OptionAndContractPositionSelection; Course.RegisterProcess = clsImportWorkItemTrainingCourse.eRegisterProcess.FreeRegistration; Course.VisibilityPortal = clsImportWorkItemTrainingCourse.eVisibilityPortal.PublicEvent; Course.WorkDescription = @"<!DOCTYPE HTML><h1>Topics</h1><div><ul> <li>Module 1</li> <li>Module 2</li> <li>Module 3</li> </ul></div>"; //Loaction via Address of OCRD Course.CardCode = "10001"; Course.AddrStreet = "In the oven"; Course.AddrStreetNo = "12"; Course.ListOfOptions = new List<clsImportWorkItemTrainingOption>() { new clsImportWorkItemTrainingOption() { OptionMatchcode = "Vegan"}, new clsImportWorkItemTrainingOption() { OptionMatchcode = "Hotel Stay"} }; //Registration Fees if (Course.ListOfCoursePositions == null) Course.ListOfCoursePositions = new List<clsImportWorkItemTrainingCoursePos>(); clsImportWorkItemTrainingCoursePos oPos = new clsImportWorkItemTrainingCoursePos(); oPos.PosType = clsImportWorkItemTrainingCoursePos.eTrainingCoursePositionTyp.RegistrationFee; oPos.InvoiceMode = clsImportWorkItemTrainingCoursePos.eInvoicePositionMode.PreselectedPosition; oPos.PortalMode = clsImportWorkItemTrainingCoursePos.ePositionSelectionVisibleMode.VisibleNotSelectable; oPos.LineKeyValue = "210001"; // Item Code OITM.ItemCode oPos.QuantityInvoicable = 1m; oPos.Matchcode = "Fee 1"; // internal Code oPos.Description1 = "Training Course Fee"; // visible line on the invoice oPos.NetUnitPriceLoc = 125.50m; Course.ListOfCoursePositions.Add(oPos); oPos = new clsImportWorkItemTrainingCoursePos(); oPos.PosType = clsImportWorkItemTrainingCoursePos.eTrainingCoursePositionTyp.RegistrationFee; oPos.InvoiceMode = clsImportWorkItemTrainingCoursePos.eInvoicePositionMode.PreselectedPosition; oPos.PortalMode = clsImportWorkItemTrainingCoursePos.ePositionSelectionVisibleMode.VisibleNotSelectable; oPos.LineKeyValue = "210002"; oPos.QuantityInvoicable = 1m; oPos.Matchcode = "Fee 2"; oPos.Description1 = "Training Course Fee"; oPos.NetUnitPriceLoc = 50.11m; Course.ListOfCoursePositions.Add(oPos); //Ressources. Backoffice+Trainer+Equipment if (Course.ListOfCourseResources == null) Course.ListOfCourseResources = new List<clsImportWorkItemTrainingResources>(); Course.ListOfCourseResources.Add(new clsImportWorkItemTrainingResources() { ResourceType = clsImportWorkitemResBase.eResourceType.Employee, ResourceKey = "0001" }); //Marc Manager MPPersonenstamm.Personalnummer //Course.ListOfCourseResources.Add(new clsImportWorkItemTrainingResources() { ResourceType = clsImportWorkitemResBase.eResourceType.Employee, ResourceKey = "0002", ResourceGroup = 100000 }); //Marc Manager MPPersonenstamm.Personalnummer Course.ListOfCourseResources.Add(new clsImportWorkItemTrainingResources() { ResourceType = clsImportWorkitemResBase.eResourceType.Employee, ResourceKey = "0002" }); //Projektleiter, Paula MPPersonenstamm.Personalnummer Course.ListOfCourseResources.Add(new clsImportWorkItemTrainingResources() { ResourceType = clsImportWorkitemResBase.eResourceType.EquipmentCategory, ResourceKey = "100003" }); //Projector. MARIEquipmentCategory.EquipmentCategory return Course; } private clsImportWorkItemTrainingCourse SaveCourse(clsImportWorkItemTrainingCourse Course) { if (oMPInterface.bImportTrainingCourse(Course, clsImportBase.eImportMode.ValidateAndImport)) { return Course; } else { LogFail("TrainingsCourse: " + oMPInterface.oErrors.PrintErrors(true)); return null; } }