From e4f987cc0bd1926895f6f91d32b18fce13f9b468 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 10:24:23 +0000 Subject: [PATCH] add GetUserState to decide whether the user is currently In or Out. #47 --- .../SQLiteRepository/SQLiteRepository.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs index 6745187..e767c0f 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs @@ -82,6 +82,8 @@ namespace SQLiteRepository Id = card.Id }); } + userObj.State = GetUserState(GetLogDirection(user.Id)); + ret.Users.Add(userObj); } if (pageNumber == -1 && pageSize == -1) @@ -98,6 +100,17 @@ namespace SQLiteRepository return ret; } + private bool GetUserState(LogDirectionDb logDirection) + { + switch (logDirection) + { + case LogDirectionDb.OUT: + return true; + default: + return false; + } + } + public UserList Search(string searchParam) { _logger.Trace("Searching SQLite database for the term: {0}", searchParam);