mirror of
https://git.battle-of-pip.de/root/vpr-mitarbeiterverwaltung.git
synced 2025-10-14 01:54:53 +02:00
fixed an error where get command cant serlialize employee
This commit is contained in:
@@ -146,7 +146,8 @@ public class Server
|
||||
// Deserialize the command result to an Employee object
|
||||
try
|
||||
{
|
||||
return Task.FromResult(Employee.FromJson(commandResult));
|
||||
var employee = Employee.FromJson(commandResult);
|
||||
return Task.FromResult(employee);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
@@ -233,6 +234,18 @@ public class Server
|
||||
return Task.FromException<string>(new Exception("Failed to clock break."));
|
||||
}
|
||||
}
|
||||
|
||||
public Task<string> ClockHistory(string employeeCode)
|
||||
{
|
||||
var commandResult = ExecuteCommandAsync("fullClockHistory " + employeeCode).Result;
|
||||
return Task.FromResult(commandResult);
|
||||
}
|
||||
|
||||
public Task<string> FullClockHistory(int limit = 50)
|
||||
{
|
||||
var commandResult = ExecuteCommandAsync("fullClockHistory " + limit).Result;
|
||||
return Task.FromResult(commandResult);
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user