Proc, etc.

This commit is contained in:
2025-06-13 10:05:53 +02:00
parent dbb7a78111
commit fd43887f58
6 changed files with 1666 additions and 1441 deletions

View File

@@ -3965,6 +3965,110 @@ Public Class usrctlProcedures
End Using
End Sub
Private Sub Button49_Click(sender As Object, e As EventArgs) Handles Button49.Click
Dim cnt = 0
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
Dim kdnr_tmp = ""
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = CheckBox3.Checked
Try
Dim fd As New OpenFileDialog
If fd.ShowDialog = DialogResult.OK Then
If fd.FileName.ToLower.EndsWith(".csv") Then
' fd.FileName.EndsWith(".csv")
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 Not (currentRow(0).Trim() = "aktiv") Then
If currentRow.Length > 12 Then
Dim kundenNr = isleernothing((currentRow(1)))
If kundenNr IsNot Nothing Then
kdnr_tmp = kundenNr
'Mahnung an
If isleernothing((currentRow(9))) IsNot Nothing Then
Dim KDKont As New VERAG_PROG_ALLGEMEIN.cKundenKontakte(10, kundenNr)
KDKont.kkd_Email = isleernothing((currentRow(9)))
KDKont.kkd_kkaId = 10 'Mahnung an
KDKont.kkd_kkaBez = "Mahnung an"
If KDKont.SAVE() Then
TextBox10.Text &= KDKont.kkd_id & vbNewLine
Else
MsgBox("FEHLER: " & currentRow(2).Trim() & " - " & currentRow(3).Trim())
End If
End If
'Rechnung an
If isleernothing((currentRow(10))) IsNot Nothing Then
Dim KDKont As New VERAG_PROG_ALLGEMEIN.cKundenKontakte(8, kundenNr)
KDKont.kkd_Email = isleernothing((currentRow(10)))
KDKont.kkd_kkaId = 8 'Rechnung an
KDKont.kkd_kkaBez = "Rechnung an"
If KDKont.SAVE() Then
TextBox10.Text &= KDKont.kkd_id & vbNewLine
Else
MsgBox("FEHLER: " & currentRow(2).Trim() & " - " & currentRow(3).Trim())
End If
End If
End If
If cnt Mod 10 = 0 Then
Application.DoEvents()
Label10.Text = (cnt + 1)
End If
Else
'MsgBox(currentRow(2))
End If
End If
End If
'For Each currentField In currentRow
cnt += 1
'Next
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