Fiskalubersicht und Creditsafe-Verbesserungen

This commit is contained in:
2023-07-18 16:18:36 +02:00
parent d0657deda8
commit 07fd73fb69
8 changed files with 411 additions and 97 deletions

View File

@@ -4,7 +4,7 @@ Imports System.Reflection
Imports System.Threading
Imports System.Web.Routing
Imports System.Windows.Forms
Imports VERAG_PROG_ALLGEMEIN.cCreditSafeAPI
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
Public Class cATEZ_NCTS_DATA
@@ -30,8 +30,9 @@ Public Class cATEZ_NCTS_DATA
Public Property Carrier_Adress_Street As String
Public Property Carrier_EORI As String
Public Property Guarantee_GRN As String
Public Property TransitCustomsOffices As cATEZ_NCTS_DATA_TransitCustomsOffice()
Public Property Attachments As cATEZ_NCTS_DATA_Attachments
Public Property AvisoId As Integer
Public Property SendungsId As Integer
Public Property atezId As String
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
@@ -40,6 +41,8 @@ Public Class cATEZ_NCTS_DATA
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Id", Id, , True, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("AvisoId", AvisoId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("SendungsId", SendungsId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("VERAG_LRN", VERAG_LRN))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("LicensePlateContainerNo", LicensePlateContainerNo))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DepartureCustomsOffice", DepartureCustomsOffice))
@@ -51,7 +54,6 @@ Public Class cATEZ_NCTS_DATA
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DAKOSY_Division1", DAKOSY_Division1))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DAKOSY_Division2", DAKOSY_Division2))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("DAKOSY_Division3", DAKOSY_Division3))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Route_Country", Route_Country))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Carrier_Name", Carrier_Name))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Carrier_Adress_Country", Carrier_Adress_Country))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Carrier_Adress_Postcode", Carrier_Adress_Postcode))
@@ -59,6 +61,7 @@ Public Class cATEZ_NCTS_DATA
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Carrier_Adress_Street", Carrier_Adress_Street))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Carrier_EORI", Carrier_EORI))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Guarantee_GRN", Guarantee_GRN))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atezId", atezId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("status", status))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("erstellung", erstellung))
@@ -82,7 +85,7 @@ Public Class cATEZ_NCTS_DATA
Public Function SAVE(Optional errHinweis = "") As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblATEZ_NCTS_DATA WITH(updlock,serializable) WHERE Id=@Id) " &
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblATEZ_NCTS WITH(updlock,serializable) WHERE Id=@Id) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
@@ -105,7 +108,7 @@ Public Class cATEZ_NCTS_DATA
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblATEZ_NCTS_DATA] SET " & str & " WHERE Id=@Id ")
Return (" UPDATE [tblATEZ_NCTS] SET " & str & " WHERE Id=@Id ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
@@ -127,7 +130,7 @@ Public Class cATEZ_NCTS_DATA
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblATEZ_NCTS_DATA (" & str & ") VALUES(" & values & ") ")
Return (" INSERT INTO tblATEZ_NCTS (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
@@ -139,7 +142,7 @@ Public Class cATEZ_NCTS_DATA
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblATEZ_NCTS_DATA WHERE Id=@Id ", conn)
Using cmd As New SqlCommand("SELECT * FROM tblATEZ_NCTS WHERE Id=@Id ", conn)
cmd.Parameters.AddWithValue("@Id", Id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
@@ -166,33 +169,271 @@ Public Class cATEZ_NCTS_DATA
End Class
Public Class cATEZ_NCTS_DATA_TransitCustomsOffice
Public Class cATEZ_NCTS_TransitCustomsOffice
Public Property Id As Integer
Public Property AtezNCTS_Id As Integer
Public Property TransitCustomsOffice As String
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Public hasEntry As Boolean = False
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Id", Id, , True, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("AtezNCTS_Id", AtezNCTS_Id))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("TransitCustomsOffice", TransitCustomsOffice))
Return list
End Function
Sub New(AtezNCTS_Id, TransitCustomsOffice)
Me.AtezNCTS_Id = AtezNCTS_Id
Me.TransitCustomsOffice = TransitCustomsOffice
SAVE()
End Sub
Sub New(Id)
Me.Id = Id
LOAD()
End Sub
Public Function SAVE(Optional errHinweis = "") As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblATEZ_NCTS_TransitCustomsOffice WITH(updlock,serializable) WHERE Id=@Id) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Dim IdTMP = Id
IdTMP = SQL.doSQLVarListID(IdTMP, sqlstr, "FMZOLL", , list, , errHinweis)
If _Id <= 0 Then Id = IdTMP
Return Id > 0
End Function
Public Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblATEZ_NCTS_TransitCustomsOffice] SET " & str & " WHERE Id=@Id ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblATEZ_NCTS_TransitCustomsOffice (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblATEZ_NCTS_TransitCustomsOffice WHERE Id=@Id ", conn)
cmd.Parameters.AddWithValue("@Id", Id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
End Sub
Shared Sub LOAD_LIST_ByNCTS(ByRef TCO_LIST As List(Of cATEZ_NCTS_TransitCustomsOffice), tco_nctsId As Integer)
If TCO_LIST Is Nothing Then TCO_LIST = New List(Of cATEZ_NCTS_TransitCustomsOffice)
TCO_LIST.Clear()
Dim SQL As New SQL
For Each r In SQL.loadDgvBySql("SELECT id FROM tblATEZ_NCTS_TransitCustomsOffice WHERE AtezNCTS_Id=" & tco_nctsId, "FMZOLL").Rows
TCO_LIST.Add(New VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_TransitCustomsOffice(r("id")))
Next
End Sub
End Class
Public Class cATEZ_NCTS_DATA_Attachment
Public Property FileType As String
Public Property DocumentType As String
Public Property base64BinaryStream As String
Public Class cATEZ_NCTS_Routen
Public Property Id As Integer
Public Property AtezNCTS_Id As Integer
Public Property Route_Country As String
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Public hasEntry As Boolean = False
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Id", Id, , True, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("AtezNCTS_Id", AtezNCTS_Id))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Route_Country", Route_Country))
Return list
End Function
Sub New(AtezNCTS_Id, Route_Country)
Me.AtezNCTS_Id = AtezNCTS_Id
Me.Route_Country = Route_Country
SAVE()
End Sub
Sub New(Id)
Me.Id = Id
LOAD()
End Sub
Public Function SAVE(Optional errHinweis = "") As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblATEZ_NCTS_Routen WITH(updlock,serializable) WHERE Id=@Id) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Dim IdTMP = Id
IdTMP = SQL.doSQLVarListID(IdTMP, sqlstr, "FMZOLL", , list, , errHinweis)
If _Id <= 0 Then Id = IdTMP
Return Id > 0
End Function
Public Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblATEZ_NCTS_Routen] SET " & str & " WHERE Id=@Id ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblATEZ_NCTS_Routen (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
Return ""
End Function
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblATEZ_NCTS_Routen WHERE Id=@Id ", conn)
cmd.Parameters.AddWithValue("@Id", Id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace)
End Try
End Sub
Shared Sub LOAD_LIST_ByNCTS(ByRef ROUTEN_LIST As List(Of cATEZ_NCTS_Routen), routen_nctsId As Integer)
If ROUTEN_LIST Is Nothing Then ROUTEN_LIST = New List(Of cATEZ_NCTS_Routen)
ROUTEN_LIST.Clear()
Dim SQL As New SQL
For Each r In SQL.loadDgvBySql("SELECT id FROM tblATEZ_NCTS_Routen WHERE AtezNCTS_Id=" & routen_nctsId, "FMZOLL").Rows
ROUTEN_LIST.Add(New VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen(r("id")))
Next
End Sub
End Class
Public Class cATEZ_NCTS_DATA_Attachments
Public Property Attachment As cATEZ_NCTS_DATA_Attachment()
End Class
Public Class cATEZ_NCTS_IN
'DEV
Shared API_STRING As String = "https://dev-tds.singlewindow.io"
Shared token As String = ""
Public dataTable As New DataTable()
Shared jsonData As New Chilkat.JsonObject
Shared Function SendRequestAuthentificationToken(ByVal myuri As String, ByVal contentType As String, ByVal method As String, ByRef Itoken As String) As String
Try
If Itoken <> "" Then Return "token filled"
If Itoken <> "" Then Return "200"
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
@@ -237,7 +478,7 @@ Public Class cATEZ_NCTS_IN
token = jsonResp.StringOf("access_token")
Itoken = token
Return rest.ResponseStatusCode & " " & rest.ResponseStatusText
Return rest.ResponseStatusCode
Catch ex As WebException
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
@@ -254,7 +495,7 @@ Public Class cATEZ_NCTS_IN
End Function
Shared Function SendRequestWithAuthHeader(acceptContentType As String, json As Chilkat.JsonObject, ByRef failureDesc As String) As String
Shared Function SendRequestWithAuthHeader(acceptContentType As String, ByRef failureDesc As String) As String
Try
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
@@ -280,11 +521,9 @@ Public Class cATEZ_NCTS_IN
rest.AddHeader("Accept", acceptContentType)
Dim sbRequestBody As New Chilkat.StringBuilder
json.EmitSb(sbRequestBody)
jsonData.EmitSb(sbRequestBody)
Debug.WriteLine(sbRequestBody)
'rest.DebugMode = True
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestSb("POST", "/api/integrations/verag", sbRequestBody, sbResponseBody)
@@ -309,7 +548,8 @@ Public Class cATEZ_NCTS_IN
Dim jsonResult As New Chilkat.JsonObject
success = jsonResult.LoadSb(sbResponseBody)
Return jsonResult.Emit()
jsonResult.Emit()
Return jsonResult.StringOf("atezId")
End If
@@ -328,40 +568,58 @@ Public Class cATEZ_NCTS_IN
Dim success As Boolean
Dim json As New Chilkat.JsonObject
success = json.UpdateString("VERAG_LRN", ncts.VERAG_LRN)
success = json.UpdateString("LicensePlateContainerNo", ncts.LicensePlateContainerNo)
success = json.UpdateString("DAKOSY.TemplateCode", ncts.DAKOSY_TemplateCode)
success = json.UpdateString("DAKOSY.IOPartner", ncts.DAKOSY_IOPartner)
success = json.UpdateString("DAKOSY.Division1", ncts.DAKOSY_Division1)
success = json.UpdateString("DAKOSY.Division2", ncts.DAKOSY_Division2)
success = json.UpdateString("DAKOSY.Division3", ncts.DAKOSY_Division3)
success = json.UpdateString("DepartureCustomsOffice", ncts.DepartureCustomsOffice)
success = json.UpdateString("DestinationCustomsOffice", ncts.DestinationCustomsOffice)
success = json.UpdateString("DatDeterminationLimit", ncts.DatDeterminationLimit)
success = json.UpdateString("CoolingTemperature", ncts.CoolingTemperature)
success = json.UpdateString("Carrier.Name", ncts.Carrier_Name)
success = json.UpdateString("Carrier.Adress.Country", ncts.Carrier_Adress_Country)
success = json.UpdateString("Carrier.Adress.Postcode", ncts.Carrier_Adress_Postcode)
success = json.UpdateString("Carrier.Adress.City", ncts.Carrier_Adress_City)
success = json.UpdateString("Carrier.Adress.Street", ncts.Carrier_Adress_Street)
success = json.UpdateString("Guarantee.GRN", ncts.Guarantee_GRN)
success = json.UpdateString("Route[0].Country", ncts.Route_Country)
success = json.UpdateString("TransitCustomsOffices[0].TransitCustomsOffice", "text")
success = json.UpdateString("TransitCustomsOffices[1].TransitCustomsOffice", "text")
success = json.UpdateString("TransitCustomsOffices[2].TransitCustomsOffice", "text")
success = jsonData.UpdateString("VERAG_LRN", ncts.VERAG_LRN)
success = jsonData.UpdateString("LicensePlateContainerNo", ncts.LicensePlateContainerNo)
success = jsonData.UpdateString("DAKOSY.TemplateCode", ncts.DAKOSY_TemplateCode)
success = jsonData.UpdateString("DAKOSY.IOPartner", ncts.DAKOSY_IOPartner)
success = jsonData.UpdateString("DAKOSY.Division1", ncts.DAKOSY_Division1)
success = jsonData.UpdateString("DAKOSY.Division2", ncts.DAKOSY_Division2)
success = jsonData.UpdateString("DAKOSY.Division3", ncts.DAKOSY_Division3)
success = jsonData.UpdateString("DepartureCustomsOffice", ncts.DepartureCustomsOffice)
success = jsonData.UpdateString("DestinationCustomsOffice", ncts.DestinationCustomsOffice)
success = jsonData.UpdateString("DatDeterminationLimit", ncts.DatDeterminationLimit)
success = jsonData.UpdateString("CoolingTemperature", ncts.CoolingTemperature)
success = jsonData.UpdateString("Carrier.Name", ncts.Carrier_Name)
success = jsonData.UpdateString("Carrier.Adress.Country", ncts.Carrier_Adress_Country)
success = jsonData.UpdateString("Carrier.Adress.Postcode", ncts.Carrier_Adress_Postcode)
success = jsonData.UpdateString("Carrier.Adress.City", ncts.Carrier_Adress_City)
success = jsonData.UpdateString("Carrier.Adress.Street", ncts.Carrier_Adress_Street)
success = jsonData.UpdateString("Guarantee.GRN", ncts.Guarantee_GRN)
Dim Route_LIST As New List(Of VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen)
VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_Routen.LOAD_LIST_ByNCTS(Route_LIST, ncts.Id)
For Each r As DataGridViewRow In dgv.SelectedRows
For Each route In Route_LIST
Dim i As Integer = 0
Dim bd As New Chilkat.BinData
Dim json1 As New Chilkat.JsonObject
success = bd.LoadFile(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("anh_docId").Value))
'json1.UpdateBd("", "base64", bd)
success = json.UpdateString("Attachments.Attachment[" & i & "].FileType", "text")
success = json.UpdateString("Attachments.Attachment[" & i & "].DocumentType", "INVOICE")
success = json.UpdateString("Attachments.Attachment[" & i & "].base64BinaryStream", bd.GetEncoded("base64"))
i = +1
success = jsonData.UpdateString("Route[" & i & "].Country", route.Route_Country)
i = i + 1
Next
Dim TCO_LIST As New List(Of VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_TransitCustomsOffice)
VERAG_PROG_ALLGEMEIN.cATEZ_NCTS_TransitCustomsOffice.LOAD_LIST_ByNCTS(TCO_LIST, ncts.Id)
For Each tco In TCO_LIST
Dim i As Integer = 0
success = jsonData.UpdateString("TransitCustomsOffices[" & i & "].TransitCustomsOffice", tco.TransitCustomsOffice)
i = i + 1
Next
For Each r As DataGridViewRow In dgv.Rows
Dim isSelected = IIf(DBNull.Value Is r.Cells("anh_selekt").Value, False, r.Cells("anh_selekt").Value)
If isSelected Then
Dim i As Integer = 0
Dim bd As New Chilkat.BinData
'Dim json1 As New Chilkat.JsonObject
success = bd.LoadFile(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("anh_docId").Value))
success = jsonData.UpdateString("Attachments.Attachment[" & i & "].FileType", r.Cells("anh_Typ").Value)
success = jsonData.UpdateString("Attachments.Attachment[" & i & "].DocumentType", r.Cells("anh_Art").Value)
success = jsonData.UpdateString("Attachments.Attachment[" & i & "].base64BinaryStream", bd.GetEncoded("base64"))
i = i + 1
End If
Next
Return success

View File

@@ -331,32 +331,45 @@ Public Class cCreditSafeAPI
'},
Dim reportObj As Chilkat.JsonObject = json.ObjectOf("report")
If (json.LastMethodSuccess = True) Then
If company.country = "DE" Then ' nur bei DE ausführen!
Dim companyAddInformObj As Chilkat.JsonObject = reportObj.ObjectOf("additionalInformation")
If (reportObj.LastMethodSuccess = True) And companyAddInformObj IsNot Nothing Then
Dim companyMiscObj As Chilkat.JsonObject = companyAddInformObj.ObjectOf("misc")
company.csBusinessPurpose = companyMiscObj.StringOf("businessPurpose")
If (companyAddInformObj.LastMethodSuccess = True) Then
Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating")
If (companyAddInformObj.LastMethodSuccess = True) And deCurrentRatingObj IsNot Nothing Then
If (deCurrentRatingObj.LastMethodSuccess = True) Then
company.csIndex = deCurrentRatingObj.StringOf("value")
Else
Debug.WriteLine("deCurrentRatingObj object not found.")
End If
Debug.WriteLine("companyMiscObj object not found.")
End If
Debug.WriteLine("companyAddInformObj object not found.")
End If
Debug.WriteLine("reportObj object not found.")
'If company.country = "DE" Then ' nur bei DE ausführen!
Dim companyAddInformObj As Chilkat.JsonObject = reportObj.ObjectOf("additionalInformation")
If (reportObj.LastMethodSuccess = True) And companyAddInformObj IsNot Nothing Then
Dim turnoverArray As Chilkat.JsonArray = companyAddInformObj.ArrayOf("turnoverRanges")
If (companyAddInformObj.LastMethodSuccess = True) And turnoverArray IsNot Nothing Then
Dim turnover As Chilkat.JsonObject = turnoverArray.ObjectAt(0)
company.csTurnover = turnover.StringOf("range") & " (" & turnover.StringOf("year") & ")"
Else
Debug.WriteLine("otherInformationObject object not found.")
End If
End If
If (reportObj.LastMethodSuccess = True) And companyAddInformObj IsNot Nothing Then
Dim companyMiscObj As Chilkat.JsonObject = companyAddInformObj.ObjectOf("misc")
company.csBusinessPurpose = companyMiscObj.StringOf("businessPurpose")
If (companyAddInformObj.LastMethodSuccess = True) Then
Dim deCurrentRatingObj As Chilkat.JsonObject = companyMiscObj.ObjectOf("deCurrentRating")
If (companyAddInformObj.LastMethodSuccess = True) And deCurrentRatingObj IsNot Nothing Then
If (deCurrentRatingObj.LastMethodSuccess = True) Then
company.csIndex = deCurrentRatingObj.StringOf("value")
Else
Debug.WriteLine("deCurrentRatingObj object not found.")
End If
Debug.WriteLine("companyMiscObj object not found.")
End If
Debug.WriteLine("companyAddInformObj object not found.")
End If
Debug.WriteLine("reportObj object not found.")
End If
'End If
Dim companyIDObj As Chilkat.JsonObject = reportObj.ObjectOf("companyIdentification")
If (reportObj.LastMethodSuccess = True) And companyIDObj IsNot Nothing Then
@@ -594,13 +607,15 @@ Public Class cCreditSafeAPI
Public Property csShareholder As String
Public Property csCEO As String
Public Property csTurnover As String
Public Property language As String
Public Property csBank As String
Public Sub New(_language As String, _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, _sumEmployees As String, _businessPurpose As String, _shareholder As String, _ceo As String, _bank As String)
Public Sub New(_language As String, _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, _sumEmployees As String, _businessPurpose As String, _shareholder As String, _ceo As String, _bank As String, _csTurnover As String)
creditSafeId = _creditSafeId
name = _name
vatNo = _vatNo
@@ -616,6 +631,7 @@ Public Class cCreditSafeAPI
csCEO = _ceo
csBank = _bank
language = _language
csTurnover = _csTurnover
End Sub
Public Sub New()