clsImportWorkItemServiceTaskResults Class |
MS Access table: MARIProjektImportWorkItemServiceTaskResults.
Use MPInterface.bImportServiceTasksResources(clsImportWorkItemServiceTaskResource, clsImportBaseeImportMode) to import.
Namespace: MARIInterface
The clsImportWorkItemServiceTaskResults type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportWorkItemServiceTaskResults | Initializes a new instance of the clsImportWorkItemServiceTaskResults class |
| Name | Description | |
|---|---|---|
| Activity |
NVARCHAR (100) Activity
| |
| Approval |
INT (4) Approval
| |
| ApprovalDate |
Datetime (8) ApprovalDate
| |
| ApprovalText |
NTEXT (0) ApprovalText
| |
| ApprovalUser |
NVARCHAR (4) ApprovalUser
| |
| InspectedBy |
NVARCHAR (20) InspectedBy -> Employee Number of the inspector
| |
| InspectedByType |
INT (4) InspectedByType = 33 Employee
| |
| QualityProcess | Helper Variable to easy load the corresponding question from the check list. If 0, it is loaded by the QualityProcessQuestion property. See clsImportQualityProcess | |
| QualityProcessQuestion |
INT (4) QualityProcessQuestion. Mandatory link to the question. See clsImportQualityProcessQuestion for details.
| |
| ResultValue |
NUMERIC(19,6) (8) ResultValue for numeric results
| |
| ResultValueText |
NVARCHAR (20) ResultValueText for text results
| |
| ServiceTaskId | Link to the service task. See clsImportWorkItemServiceTask for details. | |
| ServiceTaskPosID |
INT (4) WorkItemPosID Link to task (service task, internal service task, result task) position referencing to the equipment or customer service object (base line). See clsImportWorkItemServiceTaskPosition for details.
| |
| ServiceTaskResultID |
INT (4) WorkItemResultID Internal unique id.
|
/// <summary> /// Store to one line of a service task results to one check list question. /// </summary> /// <param name="cResultValue">Value to be stored</param> /// <param name="sResult">Value to be stored</param> /// <param name="dtTestDone">Test Time</param> /// <param name="sActivity">Additional text</param> /// <param name="oServiceTask">Task, where the base line to the equipment or CSO is stored</param> /// <param name="oLinkPos">Line of the linked equipment or customer service object</param> /// <param name="lQualityProcessQuestion">ID of the question for this result. The position in the service task has to be linked to the corresponding check list.</param> /// <param name="sEmployee">Auditor storing the resutlt</param> /// <returns></returns> private bool ImportResultsToServiceTask(decimal cResultValue, string sResult, DateTime dtTestDone, string sActivity, clsImportWorkItemServiceTask oServiceTask, clsImportWorkItemServiceTaskPosition oLinkPos, int lQualityProcessQuestion, string sEmployee) { clsImportWorkItemServiceTaskResults oResult = new clsImportWorkItemServiceTaskResults(); oResult.QualityProcess = oLinkPos.QualityProcess; oResult.ServiceTaskPosID = oLinkPos.ServiceTaskPosID; oResult.ServiceTaskId = oLinkPos.ServiceTaskID; oResult.QualityProcessQuestion = lQualityProcessQuestion; oResult.InspectedByType = (int)clsImportBase.eCoreDataClassID.Employees; //33 oResult.InspectedBy = sEmployee; if (!string.IsNullOrEmpty(sResult)) oResult.ResultValueText = sResult; else oResult.ResultValue = cResultValue; oResult.Activity = sActivity; if (oMPInterface.bImportServiceTaskResults(oResult, clsImportBase.eImportMode.ValidateAndImport)) { return true; } else { Assert.False(true, oMPInterface.oErrors.PrintErrors()); return false; } }
public bool CreateServiceTaskAndResult(string sEquipmentCode, int lCheckList, int lServiceplanID) { string sErrordetails = ""; //Create Service Task clsImportWorkItemServiceTask oServiceTask = new clsImportWorkItemServiceTask(); oServiceTask.Matchcode = "DTW Result Task"; oServiceTask.ServiceTaskType = clsImportWorkItemServiceTask.eServiceTaskType.ResultTask; oServiceTask.WorkItemStart = new DateTime(2016, 12, 12, 07, 30, 00); oServiceTask.WorkItemEnd = new DateTime(2016, 12, 12, 15, 30, 00); oServiceTask.CompanyId = 1; oServiceTask.WorkItemStatus = clsImportWorkItemServiceTask.eWorkItemStatus.ServiceActive; oServiceTask.CardCode = "10000"; if (oMPInterface.bImportServiceTask(oServiceTask, clsImportBase.eImportMode.ValidateAndImport)) { //Create Service Task Position clsImportWorkItemServiceTaskPosition oLinkPos = new clsImportWorkItemServiceTaskPosition(); oLinkPos.ServiceTaskID = oServiceTask.ServiceTaskID; oLinkPos.PosType = clsImportWorkItemServiceTaskPosition.ePositionTyp.EquipmentServiceIsFor; oLinkPos.LineKeyValue = sEquipmentCode; oLinkPos.QualityProcess = lCheckList; //Store Reference to the scheduled date oLinkPos.ReferenceServicePlan = lServiceplanID; oLinkPos.QualityResult = 100000; // Result Status: SELECT QualityStatus FROM MARIQualityStatus WHERE ClassID=378 if (oMPInterface.bImportServiceTasksPositions(oLinkPos, clsImportBase.eImportMode.ValidateAndImport)) { //Create Result to the check list clsImportWorkItemServiceTaskResults oResult = new clsImportWorkItemServiceTaskResults(); oResult.QualityProcess = oLinkPos.QualityProcess; oResult.ServiceTaskPosID = oLinkPos.ServiceTaskPosID; oResult.ServiceTaskId = oLinkPos.ServiceTaskID; oResult.QualityProcessQuestion = 100009; //one selected question SELECT QualityProcessQuestion FROM MARIQualityProcessQuestions oResult.ResultValue = 88.881m; if (oMPInterface.bImportServiceTaskResults(oResult, clsImportBase.eImportMode.ValidateAndImport)) { return true; } else { sErrordetails = oMPInterface.oErrors.PrintErrors(true); LogFail(sErrordetails); return false; } } else { sErrordetails = oMPInterface.oErrors.PrintErrors(true); LogFail(sErrordetails); return false; } } else { return false; } }