plose, etc.

This commit is contained in:
2026-08-17 14:50:29 +02:00
parent c07b170516
commit 7bb33a0833
7 changed files with 149 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ Imports DAKOSY_Worker
Imports DAKOSY_Worker.FreierVerkehrAktVeredelUmwandlung_004
Imports GrapeCity
Imports itextsharp.text.pdf
Imports MDM_Worker
Imports Microsoft.Office.Interop
Imports Newtonsoft.Json.Linq
Imports PdfSharp.Drawing
@@ -5044,6 +5045,79 @@ OPTION (MAXRECURSION 1000);", "AVISO") '
Return Nothing
End Function
Private Sub Button60_Click(sender As Object, e As EventArgs) Handles Button60.Click
Dim cnt = 0
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
Dim kdnr_tmp = ""
Try
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxMDM_Testsystem.Checked
Dim fd As New OpenFileDialog
If fd.ShowDialog = DialogResult.OK Then
If fd.FileName.ToLower.EndsWith(".csv") Then
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(fd.FileName, Encoding.Default)
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
Dim currentRow As String()
While Not MyReader.EndOfData
Try
currentRow = MyReader.ReadFields()
'If currentRow.Length > 2 Then
If currentRow.Length > 2 Then
If Not (currentRow(0).Trim() = "PloseCode") Then
If currentRow.Length > 15 Then
If isleernothing(currentRow(0)) IsNot Nothing AndAlso IsNumeric(currentRow(0)) AndAlso
isleernothing(currentRow(7)) IsNot Nothing AndAlso IsDate(currentRow(7)) AndAlso
isleernothing(currentRow(8)) IsNot Nothing AndAlso (currentRow(8) <> "") AndAlso
isleernothing(currentRow(14)) IsNot Nothing AndAlso (currentRow(14) <> "") Then
Dim plInv_SupplierRechnungsDatum = sql.isleernothingDateFormatstring(currentRow(7))
Dim ploseInv As New cPLOSE_Inv_Data(fd.SafeFileName, currentRow(0), currentRow(8), plInv_SupplierRechnungsDatum)
If ploseInv.hasEntry Then
ploseInv.plInv_PdfFileName = currentRow(14)
ploseInv.SAVE()
End If
End If
End If
End If
cnt += 1
End If
Catch ex As Exception
MsgBox(kdnr_tmp & " " & ex.Message & ex.StackTrace)
End Try
End While
End Using
End If
End If
Catch ex As Exception
MessageBox.Show("Datei nicht vorhanden.")
Finally
End Try
End Sub
'Private Sub Button26_Click(sender As Object, e As EventArgs)
' For Each d In System.IO.Directory.GetDirectories("\\192.168.0.91\Datenarchiv\DAKOSY\ECHTSYSTEM\Nachrichtendaten_Ablage\2019")
' Dim fi As New FileInfo(d)
@@ -5065,6 +5139,14 @@ OPTION (MAXRECURSION 1000);", "AVISO") '
' Next
'End Sub
Function isleernothingDateFormatstring(o) As Object
If o Is Nothing Then Return o
If o.ToString = "" Then Return Nothing
If IsDate(o) Then Return CDate(o).ToShortDateString
Return Nothing
End Function
End Class