Anpassung der Logs beim Export von Belegen nach Y
This commit is contained in:
@@ -8578,8 +8578,8 @@ Public Class frmValidator
|
||||
|
||||
oFilenameOnly = Path.GetFileName(DocPathWindows)
|
||||
oExtension = Path.GetExtension(DocPathWindows)
|
||||
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbcrlf &
|
||||
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbcrlf &
|
||||
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
|
||||
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
|
||||
"SELECT @Filename"
|
||||
|
||||
Dim oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
||||
@@ -8621,20 +8621,23 @@ Public Class frmValidator
|
||||
MyValidationLogger.Info($"File {oFile2Export} exported successfully!")
|
||||
oCount += 1
|
||||
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
|
||||
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
|
||||
|
||||
Dim oFileCount As Integer = 1
|
||||
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
|
||||
|
||||
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
|
||||
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")
|
||||
Dim oDocID = oFileRecord.Item("DocID")
|
||||
If File.Exists(oFromFilename) Then
|
||||
MyValidationLogger.Debug($"Found additional document for export: [{oFromFilename}] with DocID [{oDocID}]")
|
||||
oFileCount += 1
|
||||
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbcrlf &
|
||||
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbcrlf &
|
||||
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
|
||||
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
|
||||
"SELECT @Filename"
|
||||
oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
|
||||
oExtension = Path.GetExtension(oFromFilename)
|
||||
@@ -8646,17 +8649,25 @@ Public Class frmValidator
|
||||
If oExportFilename <> String.Empty Then
|
||||
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
|
||||
File.Copy(oFromFilename, oTargetPath)
|
||||
LOGGER.Info($"Additional file [{oFromFilename}] exported successfully to [{oTargetPath}]")
|
||||
oCount += 1
|
||||
Else
|
||||
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!"
|
||||
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
|
||||
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
|
||||
'oFilenameOnly = Path.GetFileName(oFromFilename)
|
||||
|
||||
Else
|
||||
MyValidationLogger.Warn($"⚠️ Additional file for export not found: [{oFromFilename}] with DocID [{oDocID}]")
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
MyValidationLogger.Info("No additional documents to export (DT_AdditionalSearches_Resultset_Docs is Nothing)")
|
||||
End If
|
||||
|
||||
CONFIG.Config.LastExportPath = FolderBrowserDialog1.SelectedPath
|
||||
@@ -8665,7 +8676,7 @@ Public Class frmValidator
|
||||
|
||||
Catch ex As Exception
|
||||
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 Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user