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

View File

@@ -1013,8 +1013,7 @@ Module Mail
If Body = "" Then If Body = "" Then
Body = "Anbei befinden sich die Auswertungen Zollanmeldungen von " & von.ToShortDateString & " bis " & bis.ToShortDateString & "." & Body = "Anbei befinden sich die Auswertungen Zollanmeldungen von " & von.ToShortDateString & " bis " & bis.ToShortDateString & "." &
"<br><br>Erstellt am: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString & "<br><br>Erstellt am: " & Now.ToShortDateString & ", um " & Now.ToShortTimeString &
"<br><br><br>Automatisch generiertes E-Mail. Bitte Antworten Sie nicht an dieses E-Mail." & "<br><br><br>Automatisch generiertes E-Mail. Bitte Antworten Sie nicht an dieses E-Mail."
"<br><br>VERAG SPEDITION AG"
Else Else
Body = replaceBodyVariable(Body, von, bis) Body = replaceBodyVariable(Body, von, bis)

View File

@@ -86,6 +86,11 @@ Partial Class usrctlProcedures
Me.btnTC_FtpIUpload = New System.Windows.Forms.Button() Me.btnTC_FtpIUpload = New System.Windows.Forms.Button()
Me.Button48 = New System.Windows.Forms.Button() Me.Button48 = New System.Windows.Forms.Button()
Me.Button47 = 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.Button18 = New System.Windows.Forms.Button()
Me.TextBox1 = New System.Windows.Forms.TextBox() Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.lblAnzahl = New System.Windows.Forms.Label() Me.lblAnzahl = New System.Windows.Forms.Label()
@@ -140,6 +145,9 @@ Partial Class usrctlProcedures
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Button49 = New System.Windows.Forms.Button() Me.Button49 = New System.Windows.Forms.Button()
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.TabControl1.SuspendLayout()
Me.TabPage3.SuspendLayout() Me.TabPage3.SuspendLayout()
Me.TabPage1.SuspendLayout() Me.TabPage1.SuspendLayout()
@@ -149,6 +157,7 @@ Partial Class usrctlProcedures
Me.TabPage2.SuspendLayout() Me.TabPage2.SuspendLayout()
Me.TabPage4.SuspendLayout() Me.TabPage4.SuspendLayout()
Me.TabPage5.SuspendLayout() Me.TabPage5.SuspendLayout()
Me.TabPage6.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'TabControl1 'TabControl1
@@ -158,6 +167,7 @@ Partial Class usrctlProcedures
Me.TabControl1.Controls.Add(Me.TabPage2) Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Controls.Add(Me.TabPage4) Me.TabControl1.Controls.Add(Me.TabPage4)
Me.TabControl1.Controls.Add(Me.TabPage5) Me.TabControl1.Controls.Add(Me.TabPage5)
Me.TabControl1.Controls.Add(Me.TabPage6)
Me.TabControl1.Location = New System.Drawing.Point(7, 407) Me.TabControl1.Location = New System.Drawing.Point(7, 407)
Me.TabControl1.Name = "TabControl1" Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0 Me.TabControl1.SelectedIndex = 0
@@ -770,6 +780,61 @@ Partial Class usrctlProcedures
Me.Button47.Text = "getTAD" Me.Button47.Text = "getTAD"
Me.Button47.UseVisualStyleBackColor = True 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 'Button18
' '
Me.Button18.Location = New System.Drawing.Point(59, 183) Me.Button18.Location = New System.Drawing.Point(59, 183)
@@ -985,7 +1050,7 @@ Partial Class usrctlProcedures
Me.txt.Multiline = True Me.txt.Multiline = True
Me.txt.Name = "txt" Me.txt.Name = "txt"
Me.txt.ScrollBars = System.Windows.Forms.ScrollBars.Vertical 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 Me.txt.TabIndex = 38
' '
'TextBox9 'TextBox9
@@ -994,7 +1059,7 @@ Partial Class usrctlProcedures
Me.TextBox9.Multiline = True Me.TextBox9.Multiline = True
Me.TextBox9.Name = "TextBox9" Me.TextBox9.Name = "TextBox9"
Me.TextBox9.ScrollBars = System.Windows.Forms.ScrollBars.Vertical 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 Me.TextBox9.TabIndex = 39
' '
'Button22 'Button22
@@ -1232,7 +1297,7 @@ Partial Class usrctlProcedures
' '
'Button43 '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.Name = "Button43"
Me.Button43.Size = New System.Drawing.Size(145, 49) Me.Button43.Size = New System.Drawing.Size(145, 49)
Me.Button43.TabIndex = 65 Me.Button43.TabIndex = 65
@@ -1249,6 +1314,33 @@ Partial Class usrctlProcedures
Me.DataGridViewTextBoxColumn2.HeaderText = "anz" Me.DataGridViewTextBoxColumn2.HeaderText = "anz"
Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" 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"
'
'Button49 'Button49
' '
Me.Button49.Location = New System.Drawing.Point(741, 654) Me.Button49.Location = New System.Drawing.Point(741, 654)
@@ -1331,6 +1423,8 @@ Partial Class usrctlProcedures
Me.TabPage4.ResumeLayout(False) Me.TabPage4.ResumeLayout(False)
Me.TabPage4.PerformLayout() Me.TabPage4.PerformLayout()
Me.TabPage5.ResumeLayout(False) Me.TabPage5.ResumeLayout(False)
Me.TabPage6.ResumeLayout(False)
Me.TabPage6.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@@ -1453,4 +1547,12 @@ Partial Class usrctlProcedures
Friend WithEvents Button48 As Button Friend WithEvents Button48 As Button
Friend WithEvents btnTC_FtpIUpload As Button Friend WithEvents btnTC_FtpIUpload As Button
Friend WithEvents Button49 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
Friend WithEvents Button49 As Button
End Class End Class

View File

@@ -3263,9 +3263,9 @@ Public Class usrctlProcedures
AD.Name_2 = Nothing AD.Name_2 = Nothing
AD.Straße = getTrimedString(Blatt.Range("C" & index).Value, 40) 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) 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 LandKz = getTrimedString(Blatt.Range("F" & index).Value, 3)
Dim PLZ = getTrimedString(Blatt.Range("G" & index).Value, 7) Dim PLZ = getTrimedString(Blatt.Range("G" & index).Value, 7)
@@ -3281,16 +3281,16 @@ Public Class usrctlProcedures
End If End If
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.Mobiltelefon = Nothing
AD.Telefax = Nothing AD.Telefax = Nothing
AD.E_Mail = getTrimedString(Blatt.Range("L" & index).Value, 40) 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.E_Mail2 = Nothing
' AD. = row("Internet1") ' AD. = row("Internet1")
If Blatt.Range("J" & index).value IsNot Nothing Then AD.Ansprechpartner = getTrimedString(Blatt.Range("J" & index).Value.ToString, 40) 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.Währungscode = "EUR" 'getTrimedStringACCES(row("Standard FakturenWährung"), 3)
KD.Zahlungsziel = Nothing KD.Zahlungsziel = Nothing
@@ -3343,7 +3343,7 @@ Public Class usrctlProcedures
KD.KundenNrZentrale = KD.KundenNr KD.KundenNrZentrale = KD.KundenNr
KD.FilialenNr = 5701 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.Währungscode = "EUR"
KD.Eingegeben_am = Now.ToShortDateString KD.Eingegeben_am = Now.ToShortDateString
@@ -3354,7 +3354,7 @@ Public Class usrctlProcedures
AD.LandKz = If(isleernothing(cProgramFunctions.getISO1Land(AD.LandKz)), AD.LandKz) AD.LandKz = If(isleernothing(cProgramFunctions.getISO1Land(AD.LandKz)), AD.LandKz)
AD.Rechnungsdruck = True 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.Vorlageprovision = 0.01
KD.Kreditaufwendungen = 0.02 KD.Kreditaufwendungen = 0.02
KD.Bankspesen = 0 KD.Bankspesen = 0
@@ -3460,7 +3460,7 @@ Public Class usrctlProcedures
Dim kdnr_tmp = "" Dim kdnr_tmp = ""
Try Try
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim fd As New OpenFileDialog Dim fd As New OpenFileDialog
If fd.ShowDialog = DialogResult.OK Then If fd.ShowDialog = DialogResult.OK Then
@@ -4017,6 +4017,139 @@ Public Class usrctlProcedures
End Sub 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 Private Sub Button49_Click_1(sender As Object, e As EventArgs) Handles Button49.Click
Try Try
Dim mrn As String = "ATC400003850720243230" Dim mrn As String = "ATC400003850720243230"
@@ -4040,6 +4173,83 @@ Public Class usrctlProcedures
End Try End Try
End Sub 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) '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") ' For Each d In System.IO.Directory.GetDirectories("\\192.168.0.91\Datenarchiv\DAKOSY\ECHTSYSTEM\Nachrichtendaten_Ablage\2019")

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,18 @@
Imports System.Data.OleDb Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.IO Imports System.IO
Imports System.Net Imports System.Net
Imports System.Net.Security Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates Imports System.Security.Cryptography.X509Certificates
Imports System.Text Imports System.Text
Imports System.Threading
Imports System.Xml Imports System.Xml
Imports com.sun.media.sound
Imports com.sun.org.apache.xerces.internal.impl.dv.xs
Imports DAKOSY_Worker
Imports MDM_Worker Imports MDM_Worker
Imports Org.BouncyCastle.Bcpg
Imports Renci.SshNet Imports Renci.SshNet
Imports sun.java2d
Imports TELOTEC_Worker
Imports VERAG_PROG_ALLGEMEIN Imports VERAG_PROG_ALLGEMEIN
Imports VERAG_PROG_ALLGEMEIN.cTelotecAPI Imports VERAG_PROG_ALLGEMEIN.cTelotecAPI
Public Class frmStartOptions Public Class frmStartOptions
Dim WithEvents timer As New Timer Dim WithEvents timer As New System.Windows.Forms.Timer
Private Sub lklAufschubkontenATLASEZOLL_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lklAufschubkontenATLASEZOLL.LinkClicked, LinkLabel3.LinkClicked Private Sub lklAufschubkontenATLASEZOLL_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles lklAufschubkontenATLASEZOLL.LinkClicked, LinkLabel3.LinkClicked
Dim f As New frmRoutineManager("AUFSCHUB", True, cbxHistory.Checked) Dim f As New frmRoutineManager("AUFSCHUB", True, cbxHistory.Checked)
@@ -4870,6 +4864,8 @@ Public Class frmStartOptions
checkTBLandTWLNr() checkTBLandTWLNr()
getLatestBatchNrMSE() getLatestBatchNrMSE()
ElseIf tbcntr.SelectedIndex = 5 Then
countmissingCSinPortfolio()
End If End If
End Sub End Sub
@@ -6255,7 +6251,148 @@ weiter:
End Sub End Sub
Private Sub btnCreditsaveLauf_Click(sender As Object, e As EventArgs) Handles btnCreditsaveLauf.Click
'Existing companies in the portfolio will be skipped, and only new unique entries will be added.
Dim sql As New SQL
Dim cs = New cCreditSafeAPI("creditsafe")
Dim addCreditsave As Boolean = False
If cs.authenticate() = "200" Then addCreditsave = True
While addCreditsave
Dim creditsave As String = "select kde_CreditSaveNo 'Safe Number', '' as 'Local Org No.',left(kde_CreditSaveId,2) as 'Country Code', '' as Reference, '' as 'Free Text', '' as 'Personal Limit' from tblKundenErweitert where isnull(tblKundenErweitert.kde_CreditSaveId,'') <> '' and kde_CreditSaveId <> 'True' and kde_CreditSaveId <>'False' and isnull(kde_CreditSaveNo,'') <> '' and kde_CSPortfolioAdded = 0 group by kde_CreditSaveNo, kde_CreditSaveId"
Dim dtCreditsafe_CSV As DataTable = sql.loadDgvBySql(creditsave, "FMZOLL")
If dtCreditsafe_CSV.Rows.Count = 0 Then
addCreditsave = False
Else
Dim Path As String = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genCSVFromDT(dtCreditsafe_CSV,,, "importcsv")
If Path <> "" Then
If cs.AddCompaniesCSVToPortfolio(Path) <> "OK" Then 'bei Fehler abbrechen!
Exit While
End If
End If
End If
Dim displayView = New DataView(dtCreditsafe_CSV, "", "Safe Number", DataViewRowState.CurrentRows)
Dim distinctDT_CSV As DataTable = displayView.ToTable(True, "Safe Number")
Dim CS_ID As String = ""
Dim counter = 0
For Each row As DataRow In distinctDT_CSV.Rows
CS_ID &= "'" & row.Item("Safe Number") & "'"
counter = counter + 1
If (distinctDT_CSV.Rows.Count <> 1 And counter <> distinctDT_CSV.Rows.Count) Then CS_ID &= ","
Next
If CS_ID <> "" Then
addCreditsave = sql.doSQL("Update tblKundenErweitert set kde_CSPortfolioAdded = 1 where kde_CreditSaveNo in (" & CS_ID & ")", "FMZOLL")
End If
End While
End Sub
Private Sub countmissingCSinPortfolio()
Dim count As Integer = 0
Dim sql As New SQL
Dim sqlCount As String = sql.getValueTxtBySql("select isnull(count(*),0) from tblKundenErweitert where isnull(tblKundenErweitert.kde_CreditSaveId,'') <> '' and kde_CreditSaveId <> 'True' and kde_CreditSaveId <>'False' and isnull(kde_CreditSaveNo,'') <> '' and kde_CSPortfolioAdded = 0 group by kde_CreditSaveNo, kde_CreditSaveId", "FMZOLL")
If sqlCount <> "" AndAlso IsNumeric(sqlCount) Then count = CInt(sqlCount)
lblMissingCS.Text &= count
End Sub
Private Sub Button28_Click_1(sender As Object, e As EventArgs) Handles Button28.Click
Dim datumString = ""
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
If cbCheckDate.Checked Then
If txtCSDate.Text <> "" AndAlso IsDate(txtCSDate.Text) Then
datumString = txtCSDate.Text
Else
MsgBox("Datum hat falsches Format!" & vbNewLine & "Vorgang wird abgebrochen!")
Exit Sub
End If
Else
datumString = Today.ToShortDateString
End If
Dim creditsave As String = "
select ba_KundenNr FROM tblBonitaetsauskunft WHERE ba_Pruefungstool = 'creditsafe API'
EXCEPT
SELECT * FROM ( SELECT ba_KundenNr
FROM tblBonitaetsauskunft
WHERE ba_Pruefungstool = 'creditsafe API' and cast(ba_Datum as Date) >= '" & datumString & "'
UNION ALL
SELECT e.KundenNr
FROM (
SELECT e.KundenNr,
e.eventDate,
'creditsafe API' AS Source
FROM [VERAG].[dbo].[tblCreditsafeEvents] e
INNER JOIN [VERAG].[dbo].[tblBonitaetsauskunft] b
ON e.bonId = b.ba_id
WHERE b.ba_Pruefungstool = 'creditsafe API'
AND (e.localEventCode IN ('CL','CR') OR e.globalEventCode IN ('CL','CR'))
) e
WHERE cast(e.eventDate as Date) >= '" & datumString & "'
GROUP BY Source, e.KundenNr, cast(e.eventDate as Date)
) AS Temp"
Dim dtCreditsafe As DataTable = (New SQL).loadDgvBySql(creditsave, "FMZOLL")
If dtCreditsafe.Rows.Count = 0 Then Exit Sub
Dim cs = New cCreditSafeAPI("creditsafe")
If cs.authenticate() = "200" Then
For Each row As DataRow In dtCreditsafe.Rows
Dim KUNDE_ERW As New cKundenErweitert(row("ba_KundenNr"))
Dim company As New cCreditSafeAPI.Company("", "", "", "", KUNDE_ERW.kde_CreditSaveNo, KUNDE_ERW.kde_CreditSaveId, Nothing, "", "", "", "", "", "", "", "", "", KUNDE_ERW.kde_KundenNr)
If txtCSDate.Text <> "" AndAlso IsDate(txtCSDate.Text) Then
company.lastChecked = CDate(txtCSDate.Text)
End If
Dim currentBonID As Integer = (New SQL).getValueTxtBySql("Select Top(1) isnull(ba_id, -1) FROM [tblBonitaetsauskunft] where ba_KundenNr = " & KUNDE_ERW.kde_KundenNr & " AND [ba_Pruefungstool] = 'creditsafe API' ORDER BY ba_Datum DESC", "FMZOLL")
If currentBonID > 0 Then company.csBonID = currentBonID
Dim dt As New DataTable()
cs.getCompanyEvents(company, dt, cbCheckDate.Checked, bcxKundendatenaktCS.Checked)
Thread.Sleep(2000)
Next
End If
End Sub
Private Sub cbCheckDate_CheckedChanged(sender As Object, e As EventArgs) Handles cbCheckDate.CheckedChanged
txtCSDate.Enabled = cbCheckDate.Checked
If cbCheckDate.Checked Then txtCSDate.Text = ""
End Sub
End Class End Class