This commit is contained in:
2020-03-23 16:14:39 +01:00
parent 0f7749c810
commit 42eef08dc5
4 changed files with 211 additions and 212 deletions

View File

@@ -1901,12 +1901,13 @@ Public Class frmValidator
End Try
End Function
Private Function GetWMDocPathWindows(_CheckStandard As Integer)
Private Function GetDocPathWindows(_CheckStandard As Integer)
Try
Dim oResult As String
Dim oSQL = $"SELECT dbo.FNPM_GET_FILEPATH ({CURRENT_DOC_GUID},{_CheckStandard})"
oResult = ClassDatabase.Execute_Scalar(oSQL, CONNECTION_STRING)
LOGGER.Debug($"Checking file 0 [{oResult}] exists?...")
WMDocPathWindows = String.Empty
If File.Exists(oResult) = False Then
'If USER_USERNAME = "SchreiberM" Then
' oResult = "\\dd-gan.local.digitaldata.works\DD-DFSR01\UserObjects\UserFiles\schreiberm\Desktop\AANG-3302-swbn.pdf"
@@ -1919,7 +1920,7 @@ Public Class frmValidator
oResult = ClassDatabase.Execute_Scalar(oSQL, CONNECTION_STRING)
LOGGER.Debug($"Checking file 1[{oResult}] exists?...")
If File.Exists(oResult) = False Then
LOGGER.Warn($"File {oResult} not existing!")
LOGGER.Warn($"GetDocPathWindows: File [{oResult}] not existing!")
Return False
End If
'End If
@@ -1933,7 +1934,7 @@ Public Class frmValidator
WMDocPathWindows = ""
OLD_Document_Path = ""
CURRENT_DOC_PATH = ""
errormessage = $"Unexpected error in GetWMDocPathWindows: [{ex.Message}]!"
errormessage = $"Unexpected error in GetDocPathWindows: [{ex.Message}]!"
frmError.ShowDialog()
Return False
End Try
@@ -1995,7 +1996,7 @@ Public Class frmValidator
End If
LOGGER.Debug("Dokument-GUID: '" & CURRENT_DOC_GUID.ToString & "'")
If CURRENT_DOC_GUID > 0 Then
If GetWMDocPathWindows(0) = False Then
If GetDocPathWindows(0) = False Then
MsgBox("The file can not be diplayed!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End If
If IDB_ACTIVE = False Then
@@ -2004,93 +2005,91 @@ Public Class frmValidator
End If
Else
Load_IDB_DOC_DATA()
If IDB_DT_DOC_DATA.Rows.Count = 1 Then
LOGGER.Debug("Got one IDB DocData Result")
End If
End If
'Beschriftung des Navigators
'lblNavigator_anzDok.Text = position & " of " & Anzahl_ValDoks & " files"
If WMDocPathWindows <> String.Empty Then
' >> >> >> >> >> >>##### Das Dokument in Bearbeitung nehmen ###########################
Dim sql = $"UPDATE TBPM_PROFILE_FILES SET IN_WORK = 1, IN_WORK_WHEN = GETDATE(), WORK_USER = '{USER_USERNAME}' WHERE GUID = {CURRENT_DOC_GUID}"
ClassDatabase.Execute_non_Query(sql)
'If WMDocPathWindows <> String.Empty Then
' >> >> >> >> >> >>##### Das Dokument in Bearbeitung nehmen ###########################
Dim sql = $"UPDATE TBPM_PROFILE_FILES SET IN_WORK = 1, IN_WORK_WHEN = GETDATE(), WORK_USER = '{USER_USERNAME}' WHERE GUID = {CURRENT_DOC_GUID}"
ClassDatabase.Execute_non_Query(sql)
' ############ Infos eintragen #################
' txtDateipfad.Text = Document_Path
bsiInformation.Caption = "Datei " & docCounter.ToString & " von " & Anzahl_ValDoks.ToString
LOGGER.Info(">> Validierung für Dokument '" & WMDocPathWindows & "' gestartet")
bsiDocID.Caption = "Document-ID: " & CURRENT_DOC_ID & " - GUID: " & CURRENT_DOC_GUID
' ############ Infos eintragen #################
' txtDateipfad.Text = Document_Path
bsiInformation.Caption = "Datei " & docCounter.ToString & " von " & Anzahl_ValDoks.ToString
bsiDocID.Caption = "Document-ID: " & CURRENT_DOC_ID & " - GUID: " & CURRENT_DOC_GUID
LOGGER.Debug("AllDocInfo created...")
If IDB_ACTIVE = False Then
oErrorMessage = Windream_get_Doc_info()
Else
' oErrorMessage = IDB_GetDocInfo()
End If
LOGGER.Debug("AllDocInfo created...")
If IDB_ACTIVE = False Then
oErrorMessage = Windream_get_Doc_info()
Else
' oErrorMessage = IDB_GetDocInfo()
End If
If oErrorMessage = "" Then
If oErrorMessage = "" Then
If WMDocPathWindows <> String.Empty Then
load_viewer()
LOGGER.Debug("Viewer loaded!")
If WMDocPathWindows.ToLower.EndsWith(".pdf") = False Then
bbtniAnnotation.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
End If
FillIndexValues(first)
For Each oControl As Control In pnldesigner.Controls
LoadSQLData(oControl, DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid)
Next
LOGGER.Debug("Indexmask loaded")
'Nun im Vektoprindex loggen das das Profil geladen wurde
'If PROFIL_VEKTORINDEX <> "" Then
' Dim Profilstring = "DD-PM" & PMDelimiter & "Profil: '" & PROFIL_NAME & "'" & PMDelimiter & USER_NAME & PMDelimiter & Now.ToString
' If Indexiere_VektorfeldPM(Profilstring, PROFIL_VEKTORINDEX) = False Then
' If LogErrorsOnly = False Then LOGGER.Info(" >> Profilname erfolgreich in Vektorfeld PM geschrieben")
' 'Else
' ' errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
' ' My.Settings.Save()
' ' frmError.ShowDialog()
' ' _error = True
' End If
'End If
'Nun loggen das das Profil geladen wurde
If PROFIL_LOGINDEX <> "" Then
Dim oLogString = $"PMProfile loaded: [{CURRENT_ProfilGUID}-{CURRENT_ProfilName}]{PMDelimiter}{USER_USERNAME}{PMDelimiter}{Now.ToString}"
If IDB_ACTIVE = False Then
WMIndexVectofield(oLogString, PROFIL_LOGINDEX)
Else
oLogString = $"PMProfile loaded: [{CURRENT_ProfilGUID}-{CURRENT_ProfilName}]"
IDBData.SetVariableValue(PROFIL_LOGINDEX, oLogString)
'LOGGER.Debug("Profilname erfolgreich in Vektorfeld LOG geschrieben")
'Else
' errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
' My.Settings.Save()
' frmError.ShowDialog()
' _error = True
End If
End If
activate_controls(True)
Else
errormessage = oErrorMessage
frmError.ShowDialog()
End If
FillIndexValues(first)
For Each oControl As Control In pnldesigner.Controls
LoadSQLData(oControl, DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid)
Next
LOGGER.Debug("Indexmask loaded")
'Nun im Vektoprindex loggen das das Profil geladen wurde
'If PROFIL_VEKTORINDEX <> "" Then
' Dim Profilstring = "DD-PM" & PMDelimiter & "Profil: '" & PROFIL_NAME & "'" & PMDelimiter & USER_NAME & PMDelimiter & Now.ToString
' If Indexiere_VektorfeldPM(Profilstring, PROFIL_VEKTORINDEX) = False Then
' If LogErrorsOnly = False Then LOGGER.Info(" >> Profilname erfolgreich in Vektorfeld PM geschrieben")
' 'Else
' ' errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
' ' My.Settings.Save()
' ' frmError.ShowDialog()
' ' _error = True
' End If
'End If
'Nun loggen das das Profil geladen wurde
If PROFIL_LOGINDEX <> "" Then
Dim oLogString = $"PMProfile loaded: [{CURRENT_ProfilGUID}-{CURRENT_ProfilName}]{PMDelimiter}{USER_USERNAME}{PMDelimiter}{Now.ToString}"
If IDB_ACTIVE = False Then
WMIndexVectofield(oLogString, PROFIL_LOGINDEX)
Else
oLogString = $"PMProfile loaded: [{CURRENT_ProfilGUID}-{CURRENT_ProfilName}]"
IDBData.SetVariableValue(PROFIL_LOGINDEX, oLogString)
'LOGGER.Debug("Profilname erfolgreich in Vektorfeld LOG geschrieben")
'Else
' errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
' My.Settings.Save()
' frmError.ShowDialog()
' _error = True
End If
End If
activate_controls(True)
Else
errormessage = oErrorMessage
frmError.ShowDialog()
End If
Else
frmError.ShowDialog()
End If
'Else
' errormessage = oErrorMessage
' frmError.ShowDialog()
'End If
Else
If oErrorMessage <> "" Then
errormessage = oErrorMessage
frmError.ShowDialog()