messenger, Ueberstunden, timas

This commit is contained in:
2024-03-07 16:46:16 +01:00
parent dee2b8af48
commit 72e3ca9442
5 changed files with 395 additions and 324 deletions

View File

@@ -385,7 +385,7 @@ Public Class cTimasAPI
End Try
End Sub
Public Function getEmployee(mitarbeiterID As String, ByRef datatableTimas As DataTable) As cTimasEmployee
Public Function getEmployee(mitarbeiterID As String) As cTimasEmployee
Try
@@ -469,13 +469,53 @@ Public Class cTimasAPI
i = i + 1
End While
Debug.WriteLine(json)
Return emp
Catch ex As WebException
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Function
Public Function getEmployeecustomFields(mitarbeiterID As String) As DataTable
Try
Dim dt As New DataTable
If Not checkConnectionTImas("") Then
Return Nothing
End If
Dim responseJson As String = rest.FullRequestNoBody("GET", "/rest/web-api/employees/" & mitarbeiterID)
If (rest.LastMethodSuccess <> True) Then
Debug.WriteLine(rest.LastErrorText)
Return Nothing
End If
If (rest.ResponseStatusCode <> 200) Then
Debug.WriteLine(rest.ResponseHeader)
MsgBox(rest.ResponseStatusCode & " " & rest.ResponseStatusText)
Return Nothing
End If
Debug.WriteLine(responseJson)
Dim json As New Chilkat.JsonObject
Dim success = json.Load(responseJson)
If (success <> True) Then
Debug.WriteLine(json.LastErrorText)
End If
Dim customFields As Chilkat.JsonArray = json.ArrayOf("customFields")
If (json.LastMethodSuccess = False) Then
Debug.WriteLine("customFields member not found.")
Else
Dim dt As New DataTable
dt.Columns.Add("value", GetType(String))
dt.Columns.Add("name", GetType(String))
dt.Columns.Add("type", GetType(String))
@@ -491,15 +531,12 @@ Public Class cTimasAPI
dt.Rows.Add(R)
j = j + 1
End While
If datatableTimas IsNot Nothing Then datatableTimas = dt
End If
Debug.WriteLine(json)
Return emp
Return dt
Catch ex As WebException
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)