mirror of
https://git.battle-of-pip.de/root/vpr-mitarbeiterverwaltung.git
synced 2025-10-14 18:14:54 +02:00
added clockhistory and get command
This commit is contained in:
@@ -5,4 +5,17 @@ public enum EmployeeState
|
||||
OUT,
|
||||
IN,
|
||||
BREAK,
|
||||
}
|
||||
public static class EmployeeStateExtensions
|
||||
{
|
||||
public static string ToFriendlyString(this EmployeeState state)
|
||||
{
|
||||
return state switch
|
||||
{
|
||||
EmployeeState.OUT => "Clocked Out",
|
||||
EmployeeState.IN => "Clocked In",
|
||||
EmployeeState.BREAK => "On Break",
|
||||
_ => state.ToString()
|
||||
};
|
||||
}
|
||||
}
|
@@ -139,9 +139,9 @@ public class Server
|
||||
|
||||
// Implement logic to get a worker by ID or code
|
||||
if (id != null)
|
||||
commandResult = ExecuteCommandAsync("get worker byid " + id).Result;
|
||||
commandResult = ExecuteCommandAsync("get employee byid " + id).Result;
|
||||
else
|
||||
commandResult = ExecuteCommandAsync("get worker bycode " + id).Result;
|
||||
commandResult = ExecuteCommandAsync("get employee bycode " + code).Result;
|
||||
|
||||
// Deserialize the command result to an Employee object
|
||||
try
|
||||
@@ -233,4 +233,6 @@ public class Server
|
||||
return Task.FromException<string>(new Exception("Failed to clock break."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user