diff --git a/app/DD_PM_WINDREAM/ClassPMWindream.vb b/app/DD_PM_WINDREAM/ClassPMWindream.vb index 6de4b4b..2dbbbc9 100644 --- a/app/DD_PM_WINDREAM/ClassPMWindream.vb +++ b/app/DD_PM_WINDREAM/ClassPMWindream.vb @@ -121,7 +121,14 @@ Public Class ClassPMWindream ' 02.07. Änderung der Lock Methode, um eine Validierung auch zuzulassen, wenn das Recht "Datei ändern" ' nicht gesetzt ist 'oDocument.lock() - oDocument.LockFor(WMObjectEditModeIndexEdit) + + Try + oDocument.LockFor(WMObjectEditModeIndexEdit) + Catch ex As Exception + LOGGER.Error(ex) + frmValidator.idxerr_message = "Could not lock WMFile - Check Your rights and inform the admin!" + Return False + End Try Dim i As Integer = 0 Dim indexname As String diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index c9c8bab..b2f3467 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -3018,61 +3018,64 @@ Public Class frmValidator Else - input = lookup.SelectedValues.FirstOrDefault() - + If IsNothing(input) Then + oMissing = True + oErrorMessage = "Could not get FirstOrDefault-Value of LookUpGrid!" + Exit For + End If 'den aktuellen Wert in windream auslesen Dim wertWD - If oIndexName.StartsWith("[%VKT") Then - wertWD = ReturnVektor_IndexValue(oIndexName) - Else - wertWD = CURRENT_WMFILE.GetVariableValue(oIndexName) - If Not IsNothing(wertWD) Then - If wertWD.ToString = "System.Object[]" Then - If wertWD.Length = 1 Then - wertWD = wertWD(0) - Else ' - LOGGER.Info(" >> Vectorfield " & oIndexName & "' contains more then one value - First value will be used") - wertWD = wertWD(0) - End If - End If + If oIndexName.StartsWith("[%VKT") Then + wertWD = ReturnVektor_IndexValue(oIndexName) Else - wertWD = "" - End If - - 'wenn Wert in Windream <> der Eingabe darf indexiert werden - If IsNothing(wertWD) Or wertWD <> input Then - 'Wenn der Wert in ein Vektorfeld geschrieben wird - If oIndexName.StartsWith("[%VKT") Then - input = Return_PM_VEKTOR(input, oIndexName) - 'Hier muss nun separat als Vektorfeld indexiert werden - If Indexiere_VektorfeldPM(input, PROFIL_VEKTORINDEX) = True Then - oMissing = True - oErrorMessage = "Fehler beim Indexieren Textbox als VEKTOR - ERROR: " & idxerr_message - Exit For + wertWD = CURRENT_WMFILE.GetVariableValue(oIndexName) + If Not IsNothing(wertWD) Then + If wertWD.ToString = "System.Object[]" Then + If wertWD.Length = 1 Then + wertWD = wertWD(0) + Else ' + LOGGER.Info(" >> Vectorfield " & oIndexName & "' contains more then one value - First value will be used") + wertWD = wertWD(0) + End If End If Else - Dim result() As String - ReDim Preserve result(0) - result(0) = input - If Indexiere_File(CURRENT_WMFILE, oIndexName, result) = False Then - oMissing = True - oErrorMessage = "Fehler beim Indexieren Textbox - ERROR: " & idxerr_message - Exit For + wertWD = "" + End If + + 'wenn Wert in Windream <> der Eingabe darf indexiert werden + If IsNothing(wertWD) Or wertWD <> input Then + 'Wenn der Wert in ein Vektorfeld geschrieben wird + If oIndexName.StartsWith("[%VKT") Then + input = Return_PM_VEKTOR(input, oIndexName) + 'Hier muss nun separat als Vektorfeld indexiert werden + If Indexiere_VektorfeldPM(input, PROFIL_VEKTORINDEX) = True Then + oMissing = True + oErrorMessage = "Fehler beim Indexieren Textbox als VEKTOR - ERROR: " & idxerr_message + Exit For + End If Else - 'Nun das Logging - If PROFIL_LOGINDEX <> "" Then - input = Return_LOGString(input, wertWD, oIndexName) - Indexiere_VektorfeldPM(input, PROFIL_LOGINDEX) + Dim result() As String + ReDim Preserve result(0) + result(0) = input + If Indexiere_File(CURRENT_WMFILE, oIndexName, result) = False Then + oMissing = True + oErrorMessage = "Fehler beim Indexieren Textbox - ERROR: " & idxerr_message + Exit For + Else + 'Nun das Logging + If PROFIL_LOGINDEX <> "" Then + input = Return_LOGString(input, wertWD, oIndexName) + Indexiere_VektorfeldPM(input, PROFIL_LOGINDEX) + End If End If End If End If End If End If - End If - End If + End If Catch ex As Exception LOGGER.Error(ex)