|
|
|
@@ -1018,6 +1018,8 @@ Public Class frmValidator
|
|
|
|
MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}")
|
|
|
|
MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}")
|
|
|
|
MyValidationLogger.Debug("========================================")
|
|
|
|
MyValidationLogger.Debug("========================================")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DT_AdditionalSearches_Resultset_Docs = Nothing
|
|
|
|
|
|
|
|
|
|
|
|
Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA
|
|
|
|
Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA
|
|
|
|
Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC
|
|
|
|
Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1048,6 +1050,7 @@ Public Class frmValidator
|
|
|
|
MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---")
|
|
|
|
MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---")
|
|
|
|
Dim validSQLSearches As DataTable = allSQLSearches.Clone()
|
|
|
|
Dim validSQLSearches As DataTable = allSQLSearches.Clone()
|
|
|
|
Dim validDocSearches As DataTable = allDocSearches.Clone()
|
|
|
|
Dim validDocSearches As DataTable = allDocSearches.Clone()
|
|
|
|
|
|
|
|
Dim aggregatedDocResults As DataTable = Nothing
|
|
|
|
|
|
|
|
|
|
|
|
If hasDATASearches Then
|
|
|
|
If hasDATASearches Then
|
|
|
|
For i As Integer = 0 To allSQLSearches.Rows.Count - 1
|
|
|
|
For i As Integer = 0 To allSQLSearches.Rows.Count - 1
|
|
|
|
@@ -1091,6 +1094,12 @@ Public Class frmValidator
|
|
|
|
If IsValidDocSearchResult(testDT) Then
|
|
|
|
If IsValidDocSearchResult(testDT) Then
|
|
|
|
validDocSearches.ImportRow(searchRow)
|
|
|
|
validDocSearches.ImportRow(searchRow)
|
|
|
|
MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden")
|
|
|
|
MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden")
|
|
|
|
|
|
|
|
If aggregatedDocResults Is Nothing Then
|
|
|
|
|
|
|
|
aggregatedDocResults = testDT.Clone()
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
For Each resultRow As DataRow In testDT.Rows
|
|
|
|
|
|
|
|
aggregatedDocResults.ImportRow(resultRow)
|
|
|
|
|
|
|
|
Next
|
|
|
|
Else
|
|
|
|
Else
|
|
|
|
MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.")
|
|
|
|
MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.")
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
@@ -1102,6 +1111,10 @@ Public Class frmValidator
|
|
|
|
End Try
|
|
|
|
End Try
|
|
|
|
Next
|
|
|
|
Next
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
DT_AdditionalSearches_Resultset_Docs = aggregatedDocResults
|
|
|
|
|
|
|
|
If DT_AdditionalSearches_Resultset_Docs IsNot Nothing Then
|
|
|
|
|
|
|
|
MyValidationLogger.Debug($"Zusätzliche Doc-Results gecached: {DT_AdditionalSearches_Resultset_Docs.Rows.Count} Rows")
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0
|
|
|
|
AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0
|
|
|
|
AdditionalDocResultsExist = validDocSearches.Rows.Count > 0
|
|
|
|
AdditionalDocResultsExist = validDocSearches.Rows.Count > 0
|
|
|
|
@@ -8578,9 +8591,9 @@ Public Class frmValidator
|
|
|
|
|
|
|
|
|
|
|
|
oFilenameOnly = Path.GetFileName(DocPathWindows)
|
|
|
|
oFilenameOnly = Path.GetFileName(DocPathWindows)
|
|
|
|
oExtension = Path.GetExtension(DocPathWindows)
|
|
|
|
oExtension = Path.GetExtension(DocPathWindows)
|
|
|
|
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbcrlf &
|
|
|
|
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
|
|
|
|
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbcrlf &
|
|
|
|
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
|
|
|
|
"SELECT @Filename"
|
|
|
|
"SELECT @Filename"
|
|
|
|
|
|
|
|
|
|
|
|
Dim oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
|
|
|
Dim oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
|
|
|
If Not IsNothing(oExportFilename) Then
|
|
|
|
If Not IsNothing(oExportFilename) Then
|
|
|
|
@@ -8621,23 +8634,49 @@ Public Class frmValidator
|
|
|
|
MyValidationLogger.Info($"File {oFile2Export} exported successfully!")
|
|
|
|
MyValidationLogger.Info($"File {oFile2Export} exported successfully!")
|
|
|
|
oCount += 1
|
|
|
|
oCount += 1
|
|
|
|
Else
|
|
|
|
Else
|
|
|
|
MsgBox("Error encountered while extracting Export-Filename!" & vbcrlf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
MsgBox("Error encountered while extracting Export-Filename!" & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is Nothing - SQL: {oSQLGetFilename}")
|
|
|
|
|
|
|
|
MsgBox("Error encountered while extracting Export-Filename - Result is Nothing!" & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
Dim oFileCount As Integer = 1
|
|
|
|
Dim oFileCount As Integer = 1
|
|
|
|
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
|
|
|
|
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
|
|
|
|
|
|
|
|
|
|
|
|
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
|
|
|
|
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
|
|
|
|
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")
|
|
|
|
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")?.ToString()
|
|
|
|
Dim oDocID = oFileRecord.Item("DocID")
|
|
|
|
Dim oDocID = oFileRecord.Item("DocID")
|
|
|
|
If File.Exists(oFromFilename) Then
|
|
|
|
|
|
|
|
|
|
|
|
' COPY_WMFILE_2TEMP: Pfad analog zu GetDocPathWindows() auflösen
|
|
|
|
|
|
|
|
Dim oResolvedFilename As String = oFromFilename
|
|
|
|
|
|
|
|
If COPY_WMFILE_2TEMP = True AndAlso Not String.IsNullOrWhiteSpace(oFromFilename) Then
|
|
|
|
|
|
|
|
Dim options As New DocumentPathHandler.DocumentPathOptions With {
|
|
|
|
|
|
|
|
.EnableMapping = True,
|
|
|
|
|
|
|
|
.WMSuffix = WMSUFFIX,
|
|
|
|
|
|
|
|
.SpecificDrive = If(Len(MAP_SHARE_DRIVE) = 1, MAP_SHARE_DRIVE, ""),
|
|
|
|
|
|
|
|
.DriveBlacklist = MAP_BLACKLIST,
|
|
|
|
|
|
|
|
.CopyToTemp = True,
|
|
|
|
|
|
|
|
.TempFolder = TEMP_DOCUMENT_FOLDER,
|
|
|
|
|
|
|
|
.UnmapAfterCopy = True
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Dim result = _documentPathHandler.ProcessDocumentPath(oFromFilename, options)
|
|
|
|
|
|
|
|
If result.Success AndAlso Not String.IsNullOrWhiteSpace(result.FinalPath) AndAlso File.Exists(result.FinalPath) Then
|
|
|
|
|
|
|
|
MyValidationLogger.Info($"✓ Zusatzdokument via Temp aufgelöst: [{result.FinalPath}]")
|
|
|
|
|
|
|
|
oResolvedFilename = result.FinalPath
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
MyValidationLogger.Warn($"⚠️ Temp-Auflösung fehlgeschlagen für [{oFromFilename}]: {result.ErrorMessage} - Fallback auf Originalpfad")
|
|
|
|
|
|
|
|
oResolvedFilename = oFromFilename
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If File.Exists(oResolvedFilename) Then
|
|
|
|
|
|
|
|
MyValidationLogger.Debug($"Found additional document for export: [{oResolvedFilename}] (WM: [{oFromFilename}]) with DocID [{oDocID}]")
|
|
|
|
oFileCount += 1
|
|
|
|
oFileCount += 1
|
|
|
|
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbcrlf &
|
|
|
|
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
|
|
|
|
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbcrlf &
|
|
|
|
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
|
|
|
|
"SELECT @Filename"
|
|
|
|
"SELECT @Filename"
|
|
|
|
oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
|
|
|
oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
|
|
|
oExtension = Path.GetExtension(oFromFilename)
|
|
|
|
oExtension = Path.GetExtension(oResolvedFilename)
|
|
|
|
If Not IsNothing(oExportFilename) Then
|
|
|
|
If Not IsNothing(oExportFilename) Then
|
|
|
|
If IsDBNull(oExportFilename) Then
|
|
|
|
If IsDBNull(oExportFilename) Then
|
|
|
|
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is DBNULL - SQL: {oSQLGetFilename}")
|
|
|
|
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is DBNULL - SQL: {oSQLGetFilename}")
|
|
|
|
@@ -8645,18 +8684,25 @@ Public Class frmValidator
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
If oExportFilename <> String.Empty Then
|
|
|
|
If oExportFilename <> String.Empty Then
|
|
|
|
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
|
|
|
|
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
|
|
|
|
File.Copy(oFromFilename, oTargetPath)
|
|
|
|
File.Copy(oResolvedFilename, oTargetPath)
|
|
|
|
|
|
|
|
MyValidationLogger.Info($"Additional file [{oResolvedFilename}] exported successfully to [{oTargetPath}]")
|
|
|
|
oCount += 1
|
|
|
|
oCount += 1
|
|
|
|
Else
|
|
|
|
Else
|
|
|
|
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!"
|
|
|
|
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!"
|
|
|
|
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
|
|
|
|
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
|
|
|
|
MsgBox(omsg & vbcrlf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
MsgBox(omsg & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}] - Result is Nothing!"
|
|
|
|
|
|
|
|
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
|
|
|
|
|
|
|
|
MsgBox(omsg & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
'oFilenameOnly = Path.GetFileName(oFromFilename)
|
|
|
|
Else
|
|
|
|
|
|
|
|
MyValidationLogger.Warn($"⚠️ Additional file for export not found: [{oResolvedFilename}] (WM: [{oFromFilename}]) with DocID [{oDocID}]")
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Next
|
|
|
|
Next
|
|
|
|
|
|
|
|
Else
|
|
|
|
|
|
|
|
MyValidationLogger.Info("No additional documents to export (DT_AdditionalSearches_Resultset_Docs is Nothing)")
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
CONFIG.Config.LastExportPath = FolderBrowserDialog1.SelectedPath
|
|
|
|
CONFIG.Config.LastExportPath = FolderBrowserDialog1.SelectedPath
|
|
|
|
@@ -8665,7 +8711,7 @@ Public Class frmValidator
|
|
|
|
|
|
|
|
|
|
|
|
Catch ex As Exception
|
|
|
|
Catch ex As Exception
|
|
|
|
MyValidationLogger.Error(ex)
|
|
|
|
MyValidationLogger.Error(ex)
|
|
|
|
MsgBox("Could not move file to target: " & vbcrlf & ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
MsgBox("Could not move file to target: " & vbCrLf & ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE)
|
|
|
|
End Try
|
|
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|