This commit is contained in:
2025-09-05 08:58:22 +02:00
5 changed files with 1438 additions and 874 deletions

View File

@@ -3263,9 +3263,9 @@ Public Class usrctlProcedures
AD.Name_2 = Nothing
AD.Straße = getTrimedString(Blatt.Range("C" & index).Value, 40)
If If(AD.Straße, "").trim = "" Then AD.Straße = Nothing
If If(AD.Straße, "").Trim = "" Then AD.Straße = Nothing
AD.Ort = getTrimedString(Blatt.Range("H" & index).Value, 40)
If If(AD.Ort, "").trim = "" Then AD.Ort = "-"
If If(AD.Ort, "").Trim = "" Then AD.Ort = "-"
Dim LandKz = getTrimedString(Blatt.Range("F" & index).Value, 3)
Dim PLZ = getTrimedString(Blatt.Range("G" & index).Value, 7)
@@ -3281,16 +3281,16 @@ Public Class usrctlProcedures
End If
End If
If If(AD.Telefon, "").trim = "" Then AD.Telefon = Nothing
If If(AD.Telefon, "").Trim = "" Then AD.Telefon = Nothing
AD.Mobiltelefon = Nothing
AD.Telefax = Nothing
AD.E_Mail = getTrimedString(Blatt.Range("L" & index).Value, 40)
If If(AD.E_Mail, "").trim = "" Then AD.E_Mail = Nothing
If If(AD.E_Mail, "").Trim = "" Then AD.E_Mail = Nothing
AD.E_Mail2 = Nothing
' AD. = row("Internet1")
If Blatt.Range("J" & index).value IsNot Nothing Then AD.Ansprechpartner = getTrimedString(Blatt.Range("J" & index).Value.ToString, 40)
If If(AD.Ansprechpartner, "").trim = "" Then AD.Ansprechpartner = Nothing
If If(AD.Ansprechpartner, "").Trim = "" Then AD.Ansprechpartner = Nothing
KD.Währungscode = "EUR" 'getTrimedStringACCES(row("Standard FakturenWährung"), 3)
KD.Zahlungsziel = Nothing
@@ -3343,7 +3343,7 @@ Public Class usrctlProcedures
KD.KundenNrZentrale = KD.KundenNr
KD.FilialenNr = 5701
If If(KD.Sachbearbeiter, "").trim = "" Then KD.Sachbearbeiter = "AUTO"
If If(KD.Sachbearbeiter, "").Trim = "" Then KD.Sachbearbeiter = "AUTO"
KD.Währungscode = "EUR"
KD.Eingegeben_am = Now.ToShortDateString
@@ -3354,7 +3354,7 @@ Public Class usrctlProcedures
AD.LandKz = If(isleernothing(cProgramFunctions.getISO1Land(AD.LandKz)), AD.LandKz)
AD.Rechnungsdruck = True
If If(KD.EORITIN, "").trim = "" Then KD.EORITIN = Nothing
If If(KD.EORITIN, "").Trim = "" Then KD.EORITIN = Nothing
KD.Vorlageprovision = 0.01
KD.Kreditaufwendungen = 0.02
KD.Bankspesen = 0
@@ -3460,7 +3460,7 @@ Public Class usrctlProcedures
Dim kdnr_tmp = ""
Try
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim fd As New OpenFileDialog
If fd.ShowDialog = DialogResult.OK Then
@@ -4017,6 +4017,139 @@ Public Class usrctlProcedures
End Sub
Private Sub Button49_Click_1(sender As Object, e As EventArgs) Handles Button49.Click
Dim cnt = 0
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
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
' 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 (isleernothing(currentRow(0)) IsNot Nothing AndAlso isleernothing(currentRow(0)) <> "NULL") AndAlso (isleernothing(currentRow(1)) IsNot Nothing AndAlso isleernothing(currentRow(1)) <> "NULL") AndAlso (isleernothing(currentRow(2)) IsNot Nothing AndAlso isleernothing(currentRow(2)) <> "NULL") AndAlso (isleernothing(currentRow(3)) IsNot Nothing AndAlso isleernothing(currentRow(3)) <> "NULL") Then
'OffertenNr, Währung, LeistungsNr, LeistungsBez
Dim STDOF As New cStandardofferten(currentRow(0), currentRow(1), currentRow(2), currentRow(3))
If STDOF.hasEntry Then
Dim save As Boolean = False
If isleernothing(currentRow(12)) IsNot Nothing AndAlso isleernothing(currentRow(12)) <> "NULL" Then
save = True
STDOF.LeistungsBez_EN = isleernothing(currentRow(12))
End If
If isleernothing(currentRow(13)) IsNot Nothing AndAlso isleernothing(currentRow(13)) <> "NULL" Then
save = True
STDOF.LeistungsBez_RO = isleernothing(currentRow(13))
End If
If isleernothing(currentRow(14)) IsNot Nothing AndAlso isleernothing(currentRow(14)) <> "NULL" Then
save = True
STDOF.LeistungsBez_TR = isleernothing(currentRow(14))
End If
If save Then STDOF.SAVE()
ElseIf currentRow(2) = 117 Or currentRow(2) = 118 Or currentRow(2) = 119 Then
STDOF.SAVE()
End If
End If
End If
cnt += 1
Catch ex As Exception
MsgBox(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 Button50_Click(sender As Object, e As EventArgs) Handles Button50.Click
Dim cnt = 0
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
Dim kdnr_tmp = ""
Try
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
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 isleernothing(currentRow(0)) IsNot Nothing AndAlso IsNumeric(currentRow(0)) Then
Dim KUNDE_ERW As New cKundenErweitert(currentRow(0))
If KUNDE_ERW IsNot Nothing Then
KUNDE_ERW.kde_BezFIBU = currentRow(4)
KUNDE_ERW.SAVE()
End If
End If
End If
cnt += 1
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 Sub
Private Sub Button49_Click_1(sender As Object, e As EventArgs) Handles Button49.Click
Try
Dim mrn As String = "ATC400003850720243230"
@@ -4040,6 +4173,83 @@ Public Class usrctlProcedures
End Try
End Sub
Private Sub Button51_Click(sender As Object, e As EventArgs) Handles Button51.Click
Dim cnt = 0
Dim sql As New VERAG_PROG_ALLGEMEIN.SQL
Try
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
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 AndAlso isleernothing(currentRow(0)) IsNot Nothing AndAlso IsNumeric(currentRow(0)) Then
Dim OFPOS As New cOffertPosition(currentRow(0), currentRow(1), currentRow(2), currentRow(4))
Dim andereLeistungsNr As Boolean = False
If isleernothing(currentRow(2)) IsNot Nothing AndAlso isleernothing(currentRow(3)) AndAlso IsNumeric(currentRow(2)) AndAlso IsNumeric(currentRow(3)) Then
If CInt(currentRow(2)) <> CInt(currentRow(3)) Then
andereLeistungsNr = True
Else
andereLeistungsNr = False
End If
End If
If OFPOS IsNot Nothing Then
If Not andereLeistungsNr Then
OFPOS.LeistungsBez = currentRow(5)
OFPOS.UPDATE(currentRow(4).ToString)
Else
OFPOS.LeistungsBez = currentRow(5)
OFPOS.UPDATE(currentRow(4).ToString)
OFPOS.LeistungsNr = currentRow(3)
OFPOS.UPDATE(CInt(currentRow(2)))
End If
End If
End If
cnt += 1
Catch ex As Exception
MsgBox(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")