API Einstellungen, Überstundenauszahlung, Sammelrechnungsdruck, etc
This commit is contained in:
@@ -352,15 +352,30 @@ End Class
|
||||
Public Class cDigicustAPI
|
||||
|
||||
'PROD
|
||||
Shared API_STRING As String = "https://api.digicust.com"
|
||||
Shared API_STRING As String
|
||||
Shared token As String = ""
|
||||
Shared api As New DataTable
|
||||
Shared refresh_token As String = ""
|
||||
Public dataTable As New DataTable()
|
||||
Dim sql As New SQL
|
||||
Shared apiSettingsloaded As Boolean = False
|
||||
|
||||
|
||||
Sub New(program As String)
|
||||
api = sql.loadDgvBySql("SELECT top(1) * FROM tblAPIEinstellungen WHERE api_program='" & program & "' and api_productive ='" & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "0", "1") & "'", "ADMIN")
|
||||
If api.Rows.Count = 0 Then
|
||||
MsgBox("keine gültigen API-Einstellungen für " & program & " gefunden!")
|
||||
Else
|
||||
apiSettingsloaded = True
|
||||
API_STRING = api.Rows(0).Item("api_url")
|
||||
End If
|
||||
API_STRING = api.Rows(0).Item("api_url")
|
||||
End Sub
|
||||
|
||||
Shared Function SendRequestAuthentificationToken(ByVal myuri As String, ByVal contentType As String, ByVal method As String, ByRef _token As String) As String
|
||||
|
||||
Try
|
||||
|
||||
Dim session = New cDigicustSessions()
|
||||
|
||||
If Not IsDBNull(session.token) AndAlso session.token IsNot Nothing Then
|
||||
@@ -371,6 +386,8 @@ Public Class cDigicustAPI
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cChilkat_Helper.UnlockCilkat()
|
||||
|
||||
If apiSettingsloaded = False Then Return "400"
|
||||
|
||||
Dim rest As New Chilkat.Rest
|
||||
Dim success As Boolean
|
||||
Dim bTls As Boolean = True
|
||||
@@ -385,8 +402,9 @@ Public Class cDigicustAPI
|
||||
End If
|
||||
|
||||
Dim json As New Chilkat.JsonObject
|
||||
success = json.UpdateString("username", "edv@verag.ag")
|
||||
success = json.UpdateString("password", "hbG&%RhpE6kjV@r")
|
||||
|
||||
success = json.UpdateString("username", api.Rows(0).Item("user"))
|
||||
success = json.UpdateString("password", api.Rows(0).Item("password"))
|
||||
|
||||
rest.AddHeader("Content-Type", contentType)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user