This commit is contained in:
2024-09-17 10:14:10 +02:00
parent 0bbf26e855
commit ce0865f629
12 changed files with 217 additions and 177 deletions

View File

@@ -2808,59 +2808,53 @@ Public Class usrCntlKundenuebersicht
Exit Sub
End If
Select Case ADRESSE.LandKz
Case "A" : land = "AT"
Case "D" : land = "DE"
Case Else
land = ADRESSE.LandKz
End Select
If ADRESSE.LandKz.ToString.Length <> 2 Then
land = cProgramFunctions.getISO2Land(ADRESSE.LandKz)
Else
land = ADRESSE.LandKz
End If
Dim company As New cCreditSafeAPI.Company("", "", "", land, KUNDE_ERW.kde_CreditSaveNo, KUNDE_ERW.kde_CreditSaveId, Nothing, "", "", "", "", "", "", "", "", "")
If lblBonitaetsdatum._value <> Nothing Then
Dim lastChecked As Date = Date.ParseExact(lblBonitaetsdatum._value, "dd.MM.yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
company.lastChecked = lastChecked
If lastChecked = Today Then
Dim bonaus = VERAG_PROG_ALLGEMEIN.cBonitaetsauskunft.LOADByKdNrDate(kdNr, Today)
If bonaus.ba_Pruefungstool = "creditsafe API" AndAlso bonaus.ba_datenarchivId > -1 Then
MsgBox("Heute wurde bereits eine erfolgreiche Abfrage durchgeführt" & vbNewLine & "Vorgang wird abgebrochen!")
Cursor = Cursors.Default
btnCreditsafe.Enabled = True
Exit Sub
End If
End If
If cs.checkDateOfLastRequest(company) < lastChecked Then
Dim a As MsgBoxResult = MsgBox("Seit der letzen Abfrage (" & lastChecked.ToShortDateString & ") wurde bei Creditsafe keine Änderung gemacht!" & vbNewLine & "Trotzdem Creditreport-Daten aktualisieren?", vbYesNo)
If a = vbYes Then
setCreditsafereportEntry(cs, company, True) 'doppelte Abfragen mitprotokollieren
Dim lastChecked As Date = Date.ParseExact(lblBonitaetsdatum._value, "dd.MM.yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo)
company.lastChecked = lastChecked
If lastChecked = Today Then
Dim bonaus = VERAG_PROG_ALLGEMEIN.cBonitaetsauskunft.LOADByKdNrDate(kdNr, Today)
If bonaus.ba_Pruefungstool = "creditsafe API" AndAlso bonaus.ba_datenarchivId > -1 Then
MsgBox("Heute wurde bereits eine erfolgreiche Abfrage durchgeführt" & vbNewLine & "Vorgang wird abgebrochen!")
Cursor = Cursors.Default
btnCreditsafe.Enabled = True
Exit Sub
End If
End If
If cs.checkDateOfLastRequest(company) < lastChecked Then
Dim a As MsgBoxResult = MsgBox("Seit der letzen Abfrage (" & lastChecked.ToShortDateString & ") wurde bei Creditsafe keine Änderung gemacht!" & vbNewLine & "Trotzdem Creditreport-Daten aktualisieren?", vbYesNo)
If a = vbYes Then
setCreditsafereportEntry(cs, company, True) 'doppelte Abfragen mitprotokollieren
End If
Else
setCreditsafereportEntry(cs, company)
End If
Else
setCreditsafereportEntry(cs, company)
End If
Else
setCreditsafereportEntry(cs, company)
End If
Else
MsgBox("Authentifizierungsfehler bei Creditsafe-User")
MsgBox("Authentifizierungsfehler bei Creditsafe-User")
End If