kontobeühren (feature), etc.
This commit is contained in:
@@ -100,7 +100,7 @@ Public Class cTimasAPI
|
||||
|
||||
End Function
|
||||
|
||||
Public Function getTimeSaldo(maid As Integer, ByRef info As String, kindofbalance As String, ByRef Optional isEndpointRunning As Boolean = True, Optional datetimeformat As String = "seconds") As String
|
||||
Public Function getTimeSaldo(maid As Integer, ByRef info As String, kindofbalance As String, ByRef Optional isEndpointRunning As Boolean = True, Optional datetimeformat As String = "seconds", Optional getRawData As Boolean = False, Optional timeStamp_deadline As String = "") As String
|
||||
Try
|
||||
Dim returnText As String = ""
|
||||
Dim failureText As String = ""
|
||||
@@ -119,8 +119,13 @@ Public Class cTimasAPI
|
||||
Dim success As Boolean
|
||||
rest.ClearAllQueryParams()
|
||||
|
||||
rest.IdleTimeoutMs = 5000
|
||||
rest.IdleTimeoutMs = 30000
|
||||
rest.AddQueryParam("format", datetimeformat)
|
||||
|
||||
If timeStamp_deadline <> "" AndAlso IsDate(timeStamp_deadline) Then
|
||||
rest.AddQueryParam("stamp", CDate(timeStamp_deadline).ToString("yyyy-MM-dd"))
|
||||
End If
|
||||
|
||||
Dim responseJson As String = rest.FullRequestNoBody("GET", "/rest/web-api/employees/" & maid & "/balance")
|
||||
If (rest.LastMethodSuccess <> True) Then
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
@@ -157,6 +162,9 @@ Public Class cTimasAPI
|
||||
Case "seconds"
|
||||
saldoAsDouble = CDbl(saldo)
|
||||
saldoAsDouble = Math.Round(saldoAsDouble / 3600, 2)
|
||||
|
||||
If getRawData Then Return saldoAsDouble.ToString
|
||||
|
||||
infoBuilder.Append(saldoAsDouble)
|
||||
infoBuilder.Append(" h")
|
||||
info = infoBuilder.ToString()
|
||||
@@ -164,12 +172,18 @@ Public Class cTimasAPI
|
||||
Case "minutes"
|
||||
saldoAsDouble = CDbl(saldo)
|
||||
saldoAsDouble = Math.Round(saldoAsDouble / 60, 2)
|
||||
|
||||
If getRawData Then Return saldoAsDouble.ToString
|
||||
|
||||
infoBuilder.Append(saldoAsDouble)
|
||||
infoBuilder.Append(" min")
|
||||
info = infoBuilder.ToString()
|
||||
timesaldo = saldoAsDouble.ToString
|
||||
|
||||
Case "time"
|
||||
|
||||
If getRawData Then Return saldo.ToString
|
||||
|
||||
infoBuilder.Append(saldo)
|
||||
infoBuilder.Append(" h")
|
||||
info = infoBuilder.ToString()
|
||||
@@ -312,7 +326,7 @@ Public Class cTimasAPI
|
||||
success = json.UpdateString("lastname", mitarbeiter.mit_nname)
|
||||
success = json.UpdateString("gender", IIf(mitarbeiter.mit_geschlecht = "m", "male", "female"))
|
||||
success = json.UpdateInt("card", mitarbeiter.mit_terminalTimasId)
|
||||
success = json.UpdateString("info", mitarbeiter.mit_firma & " - " & mitarbeiter.mit_abteilung)
|
||||
success = json.UpdateString("info", ClientNr & " - " & mitarbeiter.mit_abteilung)
|
||||
If mitarbeiter.mit_gebdat <> "" And IsDate(mitarbeiter.mit_gebdat) Then
|
||||
success = json.UpdateString("birthday", CDate(mitarbeiter.mit_gebdat).ToString("yyyy-MM-dd"))
|
||||
End If
|
||||
@@ -992,7 +1006,7 @@ Public Class cTimasAPI
|
||||
|
||||
End Function
|
||||
|
||||
Public Function getEmployeeList(ByRef dt As DataTable) As String
|
||||
Public Function getEmployeeList(ByRef dt As DataTable, TimasMandant As String) As String
|
||||
|
||||
Dim failureText As String = ""
|
||||
|
||||
@@ -1003,6 +1017,10 @@ Public Class cTimasAPI
|
||||
|
||||
End If
|
||||
|
||||
If TimasMandant <> "" Then
|
||||
rest.AddQueryParam("employeemandants", TimasMandant)
|
||||
End If
|
||||
|
||||
Dim responseJson As String = rest.FullRequestNoBody("GET", "/rest/web-api/employees/")
|
||||
If (rest.LastMethodSuccess <> True) Then
|
||||
Debug.WriteLine(rest.LastErrorText)
|
||||
@@ -1039,7 +1057,7 @@ Public Class cTimasAPI
|
||||
dt.Columns.Add("Geschlecht", GetType(String))
|
||||
dt.Columns.Add("Ausweis-Nr", GetType(Integer))
|
||||
dt.Columns.Add("Info", GetType(String))
|
||||
'dt.Columns.Add("AVISO-ID", GetType(Integer))
|
||||
dt.Columns.Add("Mandant", GetType(String))
|
||||
End If
|
||||
dt.Clear()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user