Hi everybody,
I have this:
[code]
Overridable Function getMachineInstallationData(ByVal pCompKey As Integer, ByVal pMachineInstallation_Key As Integer, ByRef Machine As TextBox, ByRef MachineLocation As TextBox) As Integer
Machine.Text = ""
MachineLocation.Text = ""
lblLastInstallationMaintenanceDate.Text = ""
Dim dataObj As New DataLayer.MachineInstallationData
If pMachineInstallation_Key = 0 Then 'Geen sleutel kijk of er maar één is
dataObj.GetRows(pCompKey)
Else
dataObj.GetRow(pMachineInstallation_Key)
End If
With dataObj
If .Count = 1 Then
txtMachineInstallatie.Text = .GetVal("MachineInstallation_Description")
txtMachineInstallation_Location.Text = .GetVal("MachineInstallation_Location")
If pMachineInstallation_Key <> 0 AndAlso (MachineInstallationKey.Value <> MachineInstallationKeySave.Value OrElse CInt("0" & MachineInstallationKey.Value) = 0) Then
txtInternal.Text &= vbCrLf & .GetVal("MachineInstallation_Remarks")
End If
MachineInstallationKey.Value = .GetVal("MachineInstallation_Key")
MachineInstallationKeySave.Value = .GetVal("MachineInstallation_Key")
If CDate(.GetVal("MachineInstallation_LastMaintenanceDate")) <> Date.MinValue Then
'lblLastInstallationMaintenanceDate.Text = CDate(.GetVal("MachineInstallation_LastMaintenanceDate")).ToShortDateString 'JV 2013-09-25
lblLastInstallationMaintenanceDate.Text = CDate(.GetVal("MachineInstallation_LastMaintenanceDate")).ToShortDateString & " / " & CDate(.GetVal("MachineInstallation_NextMaintenanceDate")).ToShortDateString
End If
End If
End With
'JK 20-3-2014 tooltip met onderhoudgrid laten zien
Dim tipTekst As String = ""
tipTekst = ""
"
| " & getText(wForm, "tblType", "Type", Me.Page.ToString, Language) & " | "" & getText(wForm, "tblFrequentie", "Frequentie", Me.Page.ToString, Language) & " | "" & getText(wForm, "tblLaatste", "Laatste", Me.Page.ToString, Language) & " | "" & getText(wForm, "tblVolgende", "Volgende", Me.Page.ToString, Language) & " | "" | " | " |
If txtMachineInstallatie.Text <> "" Then
ToolTipOnderhoudInstal.TooltipText = tipTekst
End If
'laatst gepleegde onderhoud en eerstvolgende onderhoud laten zien.
If lblLastInstallationMaintenanceDate.Text = "" And txtMachineInstallatie.Text <> "" Then
objMaintenance.GetRows(, , "MaintenanceInstallationKey =" & MachineInstallationKey.Value, "MaintenanceLastDate Desc")
If objMaintenance.Count > 0 Then
lblLastInstallationMaintenanceDate.Text = CDate(objMaintenance.GetVal("MaintenanceLastDate")).ToShortDateString
End If
objMaintenance.GetRows(, , "MaintenanceInstallationKey =" & MachineInstallationKey.Value, "MaintenanceNextDate Asc")
If objMaintenance.Count > 0 Then
lblLastInstallationMaintenanceDate.Text &= " / " & CDate(objMaintenance.GetVal("MaintenanceNextDate")).ToShortDateString
End If
End If
'getMachineData(0, CInt(MachineKey.Value), txtMachine, txtMachineLocation)
Return dataObj.Count
End Function
Overridable Function objMaintenanceTooltip(ByRef machinekey As HtmlInputHidden) As Integer
Dim tipTekst As String = ""
Dim objMaintenance As New DataLayer.Maintenance
Dim objDataType As New DataLayer.ListData
Dim jobType As String
Dim frequency As String
Dim LastService As DateTime
Dim NextService As DateTime
objMaintenance.GetRows(, , "MaintenanceInstallationKey =" & MachineInstallationKey.Value, "MaintenanceNextDate Asc")
For Each oH As DataRow In objMaintenance.Rows
tipTekst &= "" "
objDataType.GetRow(objMaintenance.GetVal("MaintenanceTypeKey", oH))
jobType = objDataType.GetVal("ListDetailDescription", oH)
objDataType.GetRow(objMaintenance.GetVal("MaintenanceFrequentyKey", oH))
frequency = objDataType.GetVal("ListDetailDescription", oH)
LastService = CDate(objMaintenance.GetVal("MaintenanceLastDate", oH)).ToShortDateString
NextService = CDate(objMaintenance.GetVal("MaintenanceNextDate", oH)).ToShortDateString
tipTekst &= "" & jobType & " "
tipTekst &= "" & frequency & " "
tipTekst &= "" & LastService & " "
tipTekst &= "" & NextService & " "
tipTekst &= "
Next
End Function
[/code]
But I get this error:
De objectvariabele of With block-variabele is niet ingesteld.
Beschrijving: Er is een onverwerkte uitzondering opgetreden tijdens het uitvoeren van de huidige webaanvraag. Raadpleeg de stacktracering voor meer informatie over deze fout en de oorsprong ervan in de code.Details van uitzondering: System.NullReferenceException: De objectvariabele of With block-variabele is niet ingesteld.
Fout in bron:
|
Bronbestand: D:\inetpub\wwwroot\_RSM_V39\RSM\RSM_V39\Meldingen\MeldingEdit.aspx.vb Regel: 462
Stacktracering:
Thank you
albert albertPosted Mar 31, 2014, 3:56 AM
I have it now like this:
[code]
But then I get this error:
De indeling van de invoertekenreeks is onjuist.
Beschrijving: Er is een onverwerkte uitzondering opgetreden tijdens het uitvoeren van de huidige webaanvraag. Raadpleeg de stacktracering voor meer informatie over deze fout en de oorsprong ervan in de code.Details van uitzondering: System.FormatException: De indeling van de invoertekenreeks is onjuist.
Fout in bron:
Bronbestand: D:\inetpub\wwwroot\_RSM_V39\RSM\RSM_V39\Meldingen\MeldingEdit.aspx.vb Regel: 483
albert albertPosted Mar 31, 2014, 3:05 AM
[code]
but then I get this error:
Error32Argument not specified for parameter 'machinekey' of 'Public Overridable Function objMaintenance(ByRef machinekey As System.Web.UI.HtmlControls.HtmlInputHidden) As Integer'.