Creditsave-Rountine, Mailsender, etc.

This commit is contained in:
2025-09-03 10:04:56 +02:00
parent 01a8f1f7ad
commit 18f433f345
6 changed files with 830 additions and 277 deletions

View File

@@ -86,6 +86,11 @@ Partial Class usrctlProcedures
Me.btnTC_FtpIUpload = New System.Windows.Forms.Button()
Me.Button48 = New System.Windows.Forms.Button()
Me.Button47 = New System.Windows.Forms.Button()
Me.TabPage6 = New System.Windows.Forms.TabPage()
Me.Button51 = New System.Windows.Forms.Button()
Me.cbxMDM_Testsystem = New System.Windows.Forms.CheckBox()
Me.Button50 = New System.Windows.Forms.Button()
Me.Button49 = New System.Windows.Forms.Button()
Me.Button18 = New System.Windows.Forms.Button()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.lblAnzahl = New System.Windows.Forms.Label()
@@ -139,6 +144,9 @@ Partial Class usrctlProcedures
Me.Button43 = New System.Windows.Forms.Button()
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Label17 = New System.Windows.Forms.Label()
Me.Label18 = New System.Windows.Forms.Label()
Me.Label19 = New System.Windows.Forms.Label()
Me.TabControl1.SuspendLayout()
Me.TabPage3.SuspendLayout()
Me.TabPage1.SuspendLayout()
@@ -148,6 +156,7 @@ Partial Class usrctlProcedures
Me.TabPage2.SuspendLayout()
Me.TabPage4.SuspendLayout()
Me.TabPage5.SuspendLayout()
Me.TabPage6.SuspendLayout()
Me.SuspendLayout()
'
'TabControl1
@@ -157,6 +166,7 @@ Partial Class usrctlProcedures
Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Controls.Add(Me.TabPage4)
Me.TabControl1.Controls.Add(Me.TabPage5)
Me.TabControl1.Controls.Add(Me.TabPage6)
Me.TabControl1.Location = New System.Drawing.Point(7, 407)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
@@ -769,6 +779,61 @@ Partial Class usrctlProcedures
Me.Button47.Text = "getTAD"
Me.Button47.UseVisualStyleBackColor = True
'
'TabPage6
'
Me.TabPage6.Controls.Add(Me.Label19)
Me.TabPage6.Controls.Add(Me.Label18)
Me.TabPage6.Controls.Add(Me.Label17)
Me.TabPage6.Controls.Add(Me.Button51)
Me.TabPage6.Controls.Add(Me.cbxMDM_Testsystem)
Me.TabPage6.Controls.Add(Me.Button50)
Me.TabPage6.Controls.Add(Me.Button49)
Me.TabPage6.Location = New System.Drawing.Point(4, 22)
Me.TabPage6.Name = "TabPage6"
Me.TabPage6.Size = New System.Drawing.Size(601, 288)
Me.TabPage6.TabIndex = 5
Me.TabPage6.Text = "MDM Importe"
Me.TabPage6.UseVisualStyleBackColor = True
'
'Button51
'
Me.Button51.Location = New System.Drawing.Point(32, 97)
Me.Button51.Name = "Button51"
Me.Button51.Size = New System.Drawing.Size(106, 28)
Me.Button51.TabIndex = 68
Me.Button51.Text = "Offertenpos"
Me.Button51.UseVisualStyleBackColor = True
'
'cbxMDM_Testsystem
'
Me.cbxMDM_Testsystem.AutoSize = True
Me.cbxMDM_Testsystem.Checked = True
Me.cbxMDM_Testsystem.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxMDM_Testsystem.Location = New System.Drawing.Point(14, 13)
Me.cbxMDM_Testsystem.Name = "cbxMDM_Testsystem"
Me.cbxMDM_Testsystem.Size = New System.Drawing.Size(98, 17)
Me.cbxMDM_Testsystem.TabIndex = 69
Me.cbxMDM_Testsystem.Text = "TESTSYSTEM"
Me.cbxMDM_Testsystem.UseVisualStyleBackColor = True
'
'Button50
'
Me.Button50.Location = New System.Drawing.Point(172, 63)
Me.Button50.Name = "Button50"
Me.Button50.Size = New System.Drawing.Size(106, 28)
Me.Button50.TabIndex = 67
Me.Button50.Text = "FIBU-Kundenkür."
Me.Button50.UseVisualStyleBackColor = True
'
'Button49
'
Me.Button49.Location = New System.Drawing.Point(32, 63)
Me.Button49.Name = "Button49"
Me.Button49.Size = New System.Drawing.Size(106, 28)
Me.Button49.TabIndex = 66
Me.Button49.Text = "Standard-Off."
Me.Button49.UseVisualStyleBackColor = True
'
'Button18
'
Me.Button18.Location = New System.Drawing.Point(59, 183)
@@ -984,7 +1049,7 @@ Partial Class usrctlProcedures
Me.txt.Multiline = True
Me.txt.Name = "txt"
Me.txt.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txt.Size = New System.Drawing.Size(124, 91)
Me.txt.Size = New System.Drawing.Size(124, 77)
Me.txt.TabIndex = 38
'
'TextBox9
@@ -993,7 +1058,7 @@ Partial Class usrctlProcedures
Me.TextBox9.Multiline = True
Me.TextBox9.Name = "TextBox9"
Me.TextBox9.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.TextBox9.Size = New System.Drawing.Size(124, 91)
Me.TextBox9.Size = New System.Drawing.Size(124, 77)
Me.TextBox9.TabIndex = 39
'
'Button22
@@ -1231,7 +1296,7 @@ Partial Class usrctlProcedures
'
'Button43
'
Me.Button43.Location = New System.Drawing.Point(694, 29)
Me.Button43.Location = New System.Drawing.Point(565, 29)
Me.Button43.Name = "Button43"
Me.Button43.Size = New System.Drawing.Size(145, 49)
Me.Button43.TabIndex = 65
@@ -1248,6 +1313,33 @@ Partial Class usrctlProcedures
Me.DataGridViewTextBoxColumn2.HeaderText = "anz"
Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2"
'
'Label17
'
Me.Label17.AutoSize = True
Me.Label17.Location = New System.Drawing.Point(11, 71)
Me.Label17.Name = "Label17"
Me.Label17.Size = New System.Drawing.Size(19, 13)
Me.Label17.TabIndex = 66
Me.Label17.Text = "1. "
'
'Label18
'
Me.Label18.AutoSize = True
Me.Label18.Location = New System.Drawing.Point(11, 105)
Me.Label18.Name = "Label18"
Me.Label18.Size = New System.Drawing.Size(16, 13)
Me.Label18.TabIndex = 70
Me.Label18.Text = "2."
'
'Label19
'
Me.Label19.AutoSize = True
Me.Label19.Location = New System.Drawing.Point(11, 45)
Me.Label19.Name = "Label19"
Me.Label19.Size = New System.Drawing.Size(66, 13)
Me.Label19.TabIndex = 71
Me.Label19.Text = "CSV-Importe"
'
'usrctlProcedures
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -1320,6 +1412,8 @@ Partial Class usrctlProcedures
Me.TabPage4.ResumeLayout(False)
Me.TabPage4.PerformLayout()
Me.TabPage5.ResumeLayout(False)
Me.TabPage6.ResumeLayout(False)
Me.TabPage6.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
@@ -1441,4 +1535,12 @@ Partial Class usrctlProcedures
Friend WithEvents Button47 As Button
Friend WithEvents Button48 As Button
Friend WithEvents btnTC_FtpIUpload As Button
Friend WithEvents Button49 As Button
Friend WithEvents Button50 As Button
Friend WithEvents Button51 As Button
Friend WithEvents TabPage6 As TabPage
Friend WithEvents cbxMDM_Testsystem As CheckBox
Friend WithEvents Label19 As Label
Friend WithEvents Label18 As Label
Friend WithEvents Label17 As Label
End Class

View File

@@ -3459,7 +3459,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
@@ -4016,6 +4016,218 @@ 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 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")