Abfrageparameter bei Firmensuche erweitert um Ort, PLZ und Strasse

This commit is contained in:
2023-05-10 10:29:21 +02:00
parent bdc1d8112d
commit 32ec93ec00
5 changed files with 115 additions and 45 deletions

View File

@@ -401,20 +401,6 @@ Public Class cCreditSafeAPI
Dim jsonRespString = SendGetRequestWithAuthHeader(myUrl, Nothing, acceptContentType, "GET", token)
'Dim json As New Chilkat.JsonObject
'Dim success As Boolean = json.Load(jsonRespString)
'If (success <> True) Then
' Debug.WriteLine(json.LastErrorText)
'End If
'Dim sb As New Chilkat.StringBuilder
'json.StringOfSb("pdfReportStream", sb)
'Dim bd As New Chilkat.BinData
'bd.AppendEncodedSb(sb, "base64")
'Return Convert.FromBase64String(sb.ToString)
If jsonRespString IsNot Nothing Then
Return Convert.FromBase64String(jsonRespString)
End If
@@ -437,10 +423,12 @@ Public Class cCreditSafeAPI
If company.vatNo <> "" Then
rest.AddQueryParam("vatNo", company.vatNo)
Else
If company.name <> "" Then
rest.AddQueryParam("name", company.name)
End If
End If
If company.name <> "" Then rest.AddQueryParam("name", company.name)
If company.csStreet <> "" Then rest.AddQueryParam("street", company.csStreet)
If company.csPostalcode <> "" Then rest.AddQueryParam("postCode", company.csPostalcode)
If company.csCity <> "" Then rest.AddQueryParam("city", company.csCity)
End If
@@ -458,20 +446,27 @@ Public Class cCreditSafeAPI
Dim success As Boolean = json.Load(jsonRespString)
If (success <> True) Then
Debug.WriteLine(json.LastErrorText)
Return "Verbindungsfehler"
Return New Date()
End If
Dim companies As Chilkat.JsonArray = json.ArrayOf("companies")
Dim compObj As Chilkat.JsonObject = companies.ObjectAt(0)
Dim dateTime As New Chilkat.CkDateTime
Dim dt As New Chilkat.DtObj
Dim getAsLocal As Boolean = False
success = compObj.DateOf("dateOfLatestChange", dateTime)
Debug.WriteLine(dateTime.GetAsTimestamp(getAsLocal))
Return dateTime.GetAsTimestamp(getAsLocal)
If companies IsNot Nothing Then
Dim compObj As Chilkat.JsonObject = companies.ObjectAt(0)
Dim dateTime As New Chilkat.CkDateTime
Dim dt As New Chilkat.DtObj
Dim getAsLocal As Boolean = False
success = compObj.DateOf("dateOfLatestChange", dateTime)
Debug.WriteLine(dateTime.GetAsTimestamp(getAsLocal))
Return dateTime.GetAsTimestamp(getAsLocal)
Else
Return New Date("01.01.1900")
End If
End Function
@@ -507,15 +502,21 @@ Public Class cCreditSafeAPI
Public Property csDFoundingDate As Date
Public Property csPDF As String
Public Property csFailure As String
Public Property csCity As String
Public Property csPostalcode As String
Public Property csStreet As String
Public Sub New(_name As String, _vatNo As String, _country As String, _creditsafeNo As String, _creditSafeId As String, _lastChecked As Date)
Public Sub New(_name As String, _vatNo As String, _country As String, _creditsafeNo As String, _creditSafeId As String, _lastChecked As Date, _street As String, _postalCode As String, _city As String)
creditSafeId = _creditSafeId
name = _name
vatNo = _vatNo
country = _country
creditsafeNo = _creditsafeNo
lastChecked = _lastChecked
csStreet = _street
csPostalcode = _postalCode
csCity = _city
End Sub
Public Sub New()