add GetUserState to decide whether the user is currently In or Out.

#47
This commit is contained in:
Chris.Watts90@outlook.com 2017-02-27 10:24:23 +00:00
parent 07bcb40315
commit e4f987cc0b

View File

@ -82,6 +82,8 @@ namespace SQLiteRepository
Id = card.Id Id = card.Id
}); });
} }
userObj.State = GetUserState(GetLogDirection(user.Id));
ret.Users.Add(userObj); ret.Users.Add(userObj);
} }
if (pageNumber == -1 && pageSize == -1) if (pageNumber == -1 && pageSize == -1)
@ -98,6 +100,17 @@ namespace SQLiteRepository
return ret; return ret;
} }
private bool GetUserState(LogDirectionDb logDirection)
{
switch (logDirection)
{
case LogDirectionDb.OUT:
return true;
default:
return false;
}
}
public UserList Search(string searchParam) public UserList Search(string searchParam)
{ {
_logger.Trace("Searching SQLite database for the term: {0}", searchParam); _logger.Trace("Searching SQLite database for the term: {0}", searchParam);