Wenn Daten von Creditsafe nicht ausreichend für einen Creditreport, wird im Aviso abgebrochen und darauf hingewiesen (um unnötige Abfragen abzufangen)! Weitere Hinweise bei NonActive/Pending/Other-Kunden.

This commit is contained in:
2023-05-03 14:53:10 +02:00
parent 1949d67f54
commit d17485be1a
5 changed files with 193 additions and 111 deletions

View File

@@ -100,6 +100,7 @@ Partial Class usrcntlCreditsafe
Me.dgvCreditsafe.AKTUALISIERUNGS_INTERVALL = -1
Me.dgvCreditsafe.AllowUserToAddRows = False
Me.dgvCreditsafe.AllowUserToDeleteRows = False
Me.dgvCreditsafe.AllowUserToOrderColumns = True
Me.dgvCreditsafe.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)

View File

@@ -1,4 +1,6 @@

Imports DocumentFormat.OpenXml.Drawing.Diagrams
Imports itextsharp.text.pdf
Imports VERAG_PROG_ALLGEMEIN
@@ -8,6 +10,7 @@ Public Class usrcntlCreditsafe
Dim land As String
Dim dataTable As New DataTable()
Public comp As Company
Dim uidDefault As String
Sub New()
InitializeComponent()
@@ -19,7 +22,9 @@ Public Class usrcntlCreditsafe
Sub New(_UID As String, _name As String, _land As String)
InitializeComponent()
txtUID.Text = _UID
uidDefault = _UID
_name = _name.Replace(Chr(34), "") 'Anführungszeichen entfernen
_name = _name.Replace(Chr(176), "") '° entfernen
txtFirma.Text = _name
land = _land
init()
@@ -28,7 +33,6 @@ Public Class usrcntlCreditsafe
End Sub
Private Sub init()
user = VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_CSuser
pw = VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_CSpwd
@@ -38,7 +42,7 @@ Public Class usrcntlCreditsafe
cbxLand.fillWithSQL(" SELECT [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandBez " &
" FROM [Länderverzeichnis für die Außenhandelsstatistik] LEFT JOIN [Währungstabelle] ON [Länderverzeichnis für die Außenhandelsstatistik].LandNr = [Währungstabelle].[Währungsschlüssel] " &
" WHERE ([Währungstabelle].[MitgliedslandEU] = 1) " &
" WHERE ([Währungstabelle].[MitgliedslandEU] = 1 Or [Länderverzeichnis für die Außenhandelsstatistik].LandKz = 'TR' Or [Länderverzeichnis für die Außenhandelsstatistik].LandKz = 'GB' Or [Länderverzeichnis für die Außenhandelsstatistik].LandKz = 'RS') " &
" ORDER BY [Länderverzeichnis für die Außenhandelsstatistik].LandKz ", , "FMZOLL", True)
cbxLand.changeItem(land)
@@ -46,6 +50,22 @@ Public Class usrcntlCreditsafe
btnUebernehmen.Enabled = False
Cursor = Cursors.Default
If uidDefault <> "" Then
uidDefault = uidDefault.Replace(" ", "")
uidDefault = uidDefault.Trim()
If uidDefault.ToUpper.StartsWith("ATU") Then
uidDefault = uidDefault.Replace("ATU", "")
txtUID.Text = "ATU " & uidDefault
Else
txtUID.Text = uidDefault
End If
End If
End Sub
Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
@@ -140,33 +160,64 @@ Public Class usrcntlCreditsafe
.Columns("dateOfLatestChange").HeaderText = "letzte Änderung"
End With
For Each row As DataGridViewRow In dgvCreditsafe.Rows
If Not IsDBNull(row.Cells("status").Value) Then
Dim akiv As String = (row.Cells("status").Value.ToString).ToLower
If akiv = "active" Then
row.DefaultCellStyle.BackColor = Color.LightGreen
ElseIf akiv = "nonactive" Then
row.DefaultCellStyle.BackColor = Color.IndianRed
Else
row.DefaultCellStyle.BackColor = Color.LightYellow
End If
End If
Next
End If
End Sub
Private Sub btnUebernehmen_Click(sender As Object, e As EventArgs) Handles btnUebernehmen.Click
If dgvCreditsafe.SelectedRows.Count <> 1 Then
btnUebernehmen.DialogResult = DialogResult.None
Exit Sub
Else
For Each row As DataGridViewRow In dgvCreditsafe.SelectedRows
comp = New Company(IIf(IsDBNull(row.Cells("name").Value), "", row.Cells("name").Value),
IIf(IsDBNull(row.Cells("vatNo").Value), "", row.Cells("vatNo").Value),
IIf(IsDBNull(row.Cells("country").Value), "", row.Cells("country").Value),
IIf(IsDBNull(row.Cells("safeNo").Value), "", row.Cells("safeNo").Value),
IIf(IsDBNull(row.Cells("regNo").Value), "", row.Cells("regNo").Value),
IIf(IsDBNull(row.Cells("street").Value), "", row.Cells("street").Value),
IIf(IsDBNull(row.Cells("city").Value), "", row.Cells("city").Value),
IIf(IsDBNull(row.Cells("postCode").Value), "", row.Cells("postCode").Value),
IIf(IsDBNull(row.Cells("id").Value), "", row.Cells("id").Value),
IIf(IsDBNull(row.Cells("phoneNo").Value), "", row.Cells("phoneNo").Value),
IIf(IsDBNull(row.Cells("dateOfLatestChange").Value), "", row.Cells("dateOfLatestChange").Value))
Next
btnUebernehmen.DialogResult = DialogResult.OK
Dim o As Form = Nothing
If Me.Parent.GetType() Is GetType(Form) Then o = Me.Parent
For Each row As DataGridViewRow In dgvCreditsafe.SelectedRows
comp = New Company(IIf(IsDBNull(row.Cells("name").Value), "", row.Cells("name").Value),
IIf(IsDBNull(row.Cells("vatNo").Value), "", row.Cells("vatNo").Value),
IIf(IsDBNull(row.Cells("country").Value), "", row.Cells("country").Value),
IIf(IsDBNull(row.Cells("safeNo").Value), "", row.Cells("safeNo").Value),
IIf(IsDBNull(row.Cells("regNo").Value), "", row.Cells("regNo").Value),
IIf(IsDBNull(row.Cells("street").Value), "", row.Cells("street").Value),
IIf(IsDBNull(row.Cells("city").Value), "", row.Cells("city").Value),
IIf(IsDBNull(row.Cells("postCode").Value), "", row.Cells("postCode").Value),
IIf(IsDBNull(row.Cells("id").Value), "", row.Cells("id").Value),
IIf(IsDBNull(row.Cells("phoneNo").Value), "", row.Cells("phoneNo").Value),
IIf(IsDBNull(row.Cells("dateOfLatestChange").Value), "", row.Cells("dateOfLatestChange").Value),
IIf(IsDBNull(row.Cells("status").Value), "", row.Cells("status").Value))
Next
If comp.safeNo Is Nothing Or comp.safeNo = "" Then
lblWarning.Text = "Daten von Creditsafe sind unvollständig, es kann kein Creditreport erstellt werden!"
o.DialogResult = DialogResult.None
ElseIf comp.status.ToLower <> "active" Then
Dim a As MsgBoxResult = MsgBox("Das Unternehmen " & comp.name & " besitzt den Status: " & comp.status & vbNewLine & "Trotzdem fortfahren?", vbYesNo)
If a = vbYes Then
o.DialogResult = DialogResult.OK
Exit Sub
Else
o.DialogResult = DialogResult.None
End If
Else
lblWarning.Text = ""
o.DialogResult = DialogResult.OK
Exit Sub
End If
End Sub
@@ -184,9 +235,10 @@ Public Class usrcntlCreditsafe
Public Property postCode As String
Public Property phoneNo As String
Public Property dateOfLatestChange As Date
Public Property status As String
Public Sub New(_name As String, _vatNo As String, _country As String, _safeNo As String, _regNo As String, _street As String, _city As String, _postCode As String, _credissafeId As String, _phoneNo As String, _dateOfLatestChange As DateTime)
Public Sub New(_name As String, _vatNo As String, _country As String, _safeNo As String, _regNo As String, _street As String, _city As String, _postCode As String, _credissafeId As String, _phoneNo As String, _dateOfLatestChange As DateTime, _status As String)
name = _name
vatNo = _vatNo
country = _country
@@ -198,6 +250,7 @@ Public Class usrcntlCreditsafe
credissafeId = _credissafeId
phoneNo = _phoneNo
dateOfLatestChange = dateOfLatestChange
status = _status
End Sub