This commit is contained in:
2021-06-24 23:04:15 +02:00
parent 5187fe0e71
commit 2d06d935ef
38 changed files with 6730 additions and 1088 deletions

View File

@@ -149,7 +149,7 @@ Public Class frmSendungAnhangImport
Button5.Visible = PdfViewer.Visible
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
@@ -282,7 +282,7 @@ Public Class frmSendungAnhangImport
End If
Next
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
@@ -301,7 +301,7 @@ Public Class frmSendungAnhangImport
End If
Next
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
@@ -529,7 +529,7 @@ Public Class frmSendungAnhangImport
'GC.Collect()
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Return False
End Try
Return True
@@ -629,7 +629,7 @@ Public Class frmSendungAnhangImport
'GC.Collect()
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Return False
End Try
Return True
@@ -662,7 +662,7 @@ Public Class frmSendungAnhangImport
Reader.Close()
Return True
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
@@ -734,7 +734,7 @@ Public Class frmSendungAnhangImport
' 'Reader.Close()
' Return True
' Catch ex As Exception
' MsgBox(ex.Message & ex.StackTrace)
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name )
' End Try
' Return False
'End Function
@@ -878,7 +878,7 @@ Public Class frmSendungAnhangImport
' Return True
' Catch ex As Exception
' MsgBox(ex.Message & ex.StackTrace)
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name )
' End Try
' Return False
'End Function
@@ -931,7 +931,7 @@ Public Class frmSendungAnhangImport
Return True
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return False
End Function
@@ -1028,7 +1028,7 @@ Public Class frmSendungAnhangImport
Next
End Sub
Function deleteElement(FILE_DOCID, FILE_ANHID, Optional showMessage = True) As Boolean
Shared Function deleteElement(FILE_DOCID, FILE_ANHID, Optional showMessage = True) As Boolean
If Not showMessage OrElse vbYes = MsgBox("Möchten Sie das Element löschen?", vbYesNoCancel) Then
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(FILE_DOCID)
If DS.DELETE_COMPLETE AndAlso VERAG_PROG_ALLGEMEIN.cAvisoAnhaenge.DELETE(FILE_ANHID) Then
@@ -1076,7 +1076,20 @@ Public Class frmSendungAnhangImport
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ATA-Nr", "ATA"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("UID-Prüfung", "UID"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("EORI-Prüfung", "EORI"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Lieferschein", "Lieferschein"))
If VERAG_PROG_ALLGEMEIN.cAllgemein.STAMMFILIALE = 7001 Then
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB - C88", "C88"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB - E2", "E2"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB - Atanak Rechnung", "Atanak_RG"))
End If
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Sonstiges", "Sonstiges"))
cboArt._TRANSLATE()
initSendungen()
@@ -1271,7 +1284,7 @@ Public Class frmSendungAnhangImport
End If
Catch ex As Exception
MsgBox("FEHLER Scan: " & ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name,, "Fehler Scan")
End Try
End Sub
@@ -1334,6 +1347,38 @@ Public Class frmSendungAnhangImport
End If
End Sub
Public Shared Function addData_SendungAnhangFD(AvisoId) As Boolean
Dim fd As New OpenFileDialog
fd.Multiselect = True
If fd.ShowDialog = vbOK Then
For Each F_listItem In fd.FileNames
Dim fi As New FileInfo(F_listItem)
Dim filename = fi.Name
If filename = "" Then
MsgBox("Dateiname konnte nicht ermittelt werden." & vbNewLine & F_listItem)
Else
' Dim TMP_Path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(filename, fi.Extension,, False, "SendungsAnhaenge")
' MsgBox(TMP_Path)
' File.Copy(F_listItem, TMP_Path)
Dim da_id = -1
Dim anhId = -1
Dim destPath = ""
Dim Typ = ""
If getFileTypeValid(fi.Extension.Replace(".", ""), Typ) Then
saveToDS(AvisoId, filename, F_listItem, "", Typ, da_id, anhId, destPath)
End If
End If
Next
Return True
End If
Return False
End Function
Public Function addData_SendungAnhang(Path, Optional addFlpnl = True) As Integer
@@ -1346,9 +1391,9 @@ Public Class frmSendungAnhangImport
Dim Typ = ""
If getFileTypeValid(fi.Extension.Replace(".", ""), Typ) Then
If saveToDS(AvisoId, fi.Name, Path, "", Typ, da_id, anhId, destPath) Then
If addFlpnl Then addUsrcnlToPnl(destPath, da_id, anhId, filename, Typ)
End If
If addFlpnl Then addUsrcnlToPnl(destPath, da_id, anhId, filename, Typ)
End If
End If
Return anhId
End Function
@@ -1378,6 +1423,34 @@ Public Class frmSendungAnhangImport
Return True
End Function
Public Shared Function quickScan(AvisoId, Optional SendungsId = Nothing) As Boolean
Try
'If KdNr < 0 Then Exit Sub
Dim frmScan As New VERAG_PROG_ALLGEMEIN.frmScan("QuickScan")
frmScan.DefaultFileName = "Scan" ' Me._TEXT_PDF
If frmScan.ShowDialog() = DialogResult.OK Then
If frmScan.ReturnValue IsNot Nothing Then
Dim Filename = frmScan.fileName
Dim TMP_Path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(Filename, ".pdf",, False, "SendungsAnhaenge")
File.WriteAllBytes(TMP_Path, frmScan.ReturnValue)
Dim da_id = -1
Dim anhId = -1
Dim destPath = ""
If frmSendungAnhangImport.saveToDS(AvisoId, Filename, TMP_Path, "", "PDF", da_id, anhId, destPath, SendungsId) Then
Return True
End If
'addUsrcnlToPnl(TMP_Path)
End If
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name,, "Fehler QuickScan")
End Try
Return False
End Function
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs)
BrowserLoaded = True
End Sub
@@ -1477,7 +1550,7 @@ Public Class frmSendungAnhangImport
Catch ex As ArgumentOutOfRangeException
'out of range
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
@@ -1745,7 +1818,7 @@ Public Class frmSendungAnhangImport
' initSendungen()
initFlpANH_LIST()
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
@@ -1826,7 +1899,7 @@ Public Class frmSendungAnhangImport
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
@@ -1836,19 +1909,19 @@ Public Class frmSendungAnhangImport
' We have a embedded file. First lets try to get the file name out of memory
Dim theStream As IO.Stream = CType(e.Data.GetData("FileGroupDescriptor"), IO.Stream)
Dim fileGroupDescriptor(512) As Byte
theStream.Read(fileGroupDescriptor, 0, 512)
Dim fileName As System.Text.StringBuilder = New System.Text.StringBuilder("")
Dim i As Integer = 76
Dim fileGroupDescriptor(512) As Byte
theStream.Read(fileGroupDescriptor, 0, 512)
Dim fileName As System.Text.StringBuilder = New System.Text.StringBuilder("")
Dim i As Integer = 76
While Not (fileGroupDescriptor(i) = 0)
fileName.Append(Convert.ToChar(fileGroupDescriptor(i)))
System.Math.Min(System.Threading.Interlocked.Increment(i), i - 1)
End While
While Not (fileGroupDescriptor(i) = 0)
fileName.Append(Convert.ToChar(fileGroupDescriptor(i)))
System.Math.Min(System.Threading.Interlocked.Increment(i), i - 1)
End While
theStream.Close()
' We should have the file name or if its an email, the subject line. Create our temp file based on the temp path and this info
Dim myTempFile As String = IO.Path.GetTempPath & fileName.ToString
theStream.Close()
' We should have the file name or if its an email, the subject line. Create our temp file based on the temp path and this info
Dim myTempFile As String = IO.Path.GetTempPath & fileName.ToString
' Look to see if this is a email message. If so save that temporarily and get the temp file.
If InStr(myTempFile, ".msg") > 0 Then
Dim objOL As New Microsoft.Office.Interop.Outlook.Application
@@ -1884,7 +1957,7 @@ Public Class frmSendungAnhangImport
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
EmAilAttach = String.Empty
End Try

View File

@@ -30,6 +30,12 @@
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("ATA-Nr", "ATA"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("UID-Prüfung", "UID"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("EORI-Prüfung", "EORI"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Lieferschein", "Lieferschein"))
If VERAG_PROG_ALLGEMEIN.cAllgemein.STAMMFILIALE = 7001 Then
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB - C88", "C88"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB - E2", "E2"))
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("GB - Atanak Rechnung", "Atanak_RG"))
End If
cboArt.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Sonstiges", "Sonstiges"))
txtBezeichnung.Text = nameOLD
cboArt.changeItem(artOLD)