From 07bcb40315ce0f039724c38f1d26e6ec94e2132c Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 10:23:33 +0000 Subject: [PATCH 1/4] Added state to User object to support UI showing whether the user is in or out. #47 --- DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs index 2fca02f..b9e3214 100644 --- a/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/User.cs @@ -21,5 +21,7 @@ namespace Interfaces } public List AssociatedIdentifiers { get; set; } + + public bool State { get; set; } } } \ No newline at end of file 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 2/4] 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); From e17568bdc584fe43c6e52ea22e0f17d8fd43c95d Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 10:25:31 +0000 Subject: [PATCH 3/4] update the html page to show the IN/OUT state as per the UI suggestion on the issue. Will conditionally show IN (green text)/OUT (red text) based on whether the system reports the user to be in or out. #47 --- .../WindowsDataCenter/www/index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html index 983b120..a421a7e 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html @@ -61,15 +61,24 @@ + - + From eb1cb7a1b4319fe1203ecf09e211c489664a78f6 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 14:54:21 +0000 Subject: [PATCH 4/4] change in/out formatting to make uniform width #47 --- .../WindowsDataCenter/WindowsDataCenter/www/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html index a421a7e..c1ce6b4 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html @@ -73,10 +73,10 @@
First Name Last Name Contractor +
+ + IN + + + OUT + +
- IN + IN - OUT + OUT