From 0c88194db4fd0c43c25f4e9d111dda0f8892d9c0 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 24 Feb 2017 22:13:44 +0000 Subject: [PATCH 01/17] add new property to TimeLogList object to contain the user details - UserInformation #46 --- DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLogList.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLogList.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLogList.cs index 58d5191..5f08129 100644 --- a/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLogList.cs +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLogList.cs @@ -19,5 +19,6 @@ namespace Interfaces get { return Math.Round(TimeLogs.Sum(x => x.DailyTotal), 2); } } public float HoursPerWeekMinutes { get; set; } + public User UserInformation { get; set; } } } \ No newline at end of file From 49235288d7130a38992c7f28a5da1454f040e813 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 24 Feb 2017 22:17:33 +0000 Subject: [PATCH 02/17] add implementation of the UserInformation property to populate it with the deftails for the given User #46 --- .../WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs index 6745187..c7b80b2 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs @@ -205,6 +205,7 @@ namespace SQLiteRepository _logger.Error(ex, "Error in GetUserContracterHours with Id: {0} and selected date: {1}, Exception: {2}", userId, selectedDate, ex); } + ret.UserInformation = GetUser(userId); return ret; } From 978744896f484201da437f079e207d952ab6e1a5 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 24 Feb 2017 22:20:58 +0000 Subject: [PATCH 03/17] add data binding and labels to display the user name on the TimeLog page. #46 --- .../WindowsDataCenter/www/index.html | 98 ++++++++++--------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html index 983b120..4139a90 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html @@ -186,53 +186,63 @@ -
- -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Day Of WeekInOutSub-Total
Weekly Total
+
+
+
+ +
+

+ Logs for: +

+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Day Of WeekInOutSub-Total
Weekly Total
+
+
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 04/17] 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 05/17] 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 06/17] 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 07/17] 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 @@ From 66def93ff10a32e0cf5087b6affab26209ea2974 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 15:15:54 +0000 Subject: [PATCH 08/17] added the order by arguments for GET_ALL_USERS_PAGINATE and GET_ALL_USERS procedures. this will now order the users by LastName, then FirstName in alphabetical order (startint with a). #52 --- .../SQLiteRepository/SQLiteProcedures.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs index 4873cb6..f90ea46 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs @@ -4,7 +4,6 @@ namespace SQLiteRepository { public const string GET_LOGS_IN_LAST_X_MINUTES= "select * from TimeLogDb where "+nameof(TimeLogDb.SwipeEventDateTime)+" > ? AND "+nameof(TimeLogDb.UserId_FK)+"=?"; public const string GET_TIMELOGS = "select * from "+nameof(TimeLogDb)+ " where (" + nameof(TimeLogDb.UserId_FK) + "=? AND " + nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)"; - public const string GET_ALL_USERS = "select * from " + nameof(UserIdentity); public const string GET_USER_BY_ID = "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?"; public const string GET_CARDS_BY_USER_ID = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?"; @@ -13,14 +12,19 @@ namespace SQLiteRepository public const string GET_USER_BY_FIRST_AND_LAST = "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.FirstName) + " = ? AND " + nameof(UserIdentity.LastName) + " = ?"; + public const string GET_ALL_USERS = + "select * from " + nameof(UserIdentity) + " order by " + nameof(UserIdentity.LastName) + " collate nocase, " + + nameof(UserIdentity.FirstName) + " collate nocase"; public const string UPDATE_CARD_USER_ID = "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " + nameof(CardUniqueId.Id) + "=?"; + public const string GET_ALL_USERS_PAGINATE = + "select * from " + nameof(UserIdentity) + " order by " + nameof(UserIdentity.LastName) + " collate nocase, " + + nameof(UserIdentity.FirstName) + " collate nocase limit ? offset ?"; public const string SEARCH_USER_LIST = "SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " + nameof(UserIdentity.LastName) + " Like ?)"; public const string GET_LAST_TIMELOG_DIRECTION = "SELECT * FROM " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.UserId_FK) + " = ? order by " + nameof(TimeLogDb.SwipeEventDateTime) + " desc LIMIT 1"; - public const string GET_ALL_USERS_PAGINATE = "select * from "+ nameof(UserIdentity)+" limit ? offset ?"; public const string GET_TOTAL_USER_COUNT = "select Max("+nameof(UserIdentity.Id)+") from " + nameof(UserIdentity); From e41f15eec843e45e35d4b46a0c634772771fc503 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 15:16:23 +0000 Subject: [PATCH 09/17] reformat/reorder SQLiteProcedures file. --- .../SQLiteRepository/SQLiteProcedures.cs | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs index f90ea46..a5488c3 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs @@ -2,32 +2,50 @@ namespace SQLiteRepository { internal static class SQLiteProcedures { - public const string GET_LOGS_IN_LAST_X_MINUTES= "select * from TimeLogDb where "+nameof(TimeLogDb.SwipeEventDateTime)+" > ? AND "+nameof(TimeLogDb.UserId_FK)+"=?"; - public const string GET_TIMELOGS = "select * from "+nameof(TimeLogDb)+ " where (" + nameof(TimeLogDb.UserId_FK) + "=? AND " + nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)"; - public const string GET_USER_BY_ID = "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?"; + public const string GET_LOGS_IN_LAST_X_MINUTES = + "select * from TimeLogDb where " + nameof(TimeLogDb.SwipeEventDateTime) + " > ? AND " + + nameof(TimeLogDb.UserId_FK) + "=?"; - public const string GET_CARDS_BY_USER_ID = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?"; - public const string GET_CARDS_BY_UNIQUE_ID = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.CardUId) + "=?"; - public const string GET_UNASSIGNED_CARD_LIST = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?"; + public const string GET_TIMELOGS = + "select * from " + nameof(TimeLogDb) + " where (" + nameof(TimeLogDb.UserId_FK) + "=? AND " + + nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)"; - public const string GET_USER_BY_FIRST_AND_LAST = - "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.FirstName) + " = ? AND " + nameof(UserIdentity.LastName) + " = ?"; public const string GET_ALL_USERS = "select * from " + nameof(UserIdentity) + " order by " + nameof(UserIdentity.LastName) + " collate nocase, " + nameof(UserIdentity.FirstName) + " collate nocase"; - public const string UPDATE_CARD_USER_ID = "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " + nameof(CardUniqueId.Id) + "=?"; public const string GET_ALL_USERS_PAGINATE = "select * from " + nameof(UserIdentity) + " order by " + nameof(UserIdentity.LastName) + " collate nocase, " + nameof(UserIdentity.FirstName) + " collate nocase limit ? offset ?"; - public const string SEARCH_USER_LIST = "SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " + nameof(UserIdentity.LastName) + " Like ?)"; + public const string GET_USER_BY_ID = + "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?"; - public const string GET_LAST_TIMELOG_DIRECTION = "SELECT * FROM " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.UserId_FK) + " = ? order by " + nameof(TimeLogDb.SwipeEventDateTime) + " desc LIMIT 1"; + public const string GET_CARDS_BY_USER_ID = + "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?"; + public const string GET_CARDS_BY_UNIQUE_ID = + "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.CardUId) + "=?"; - public const string GET_TOTAL_USER_COUNT = "select Max("+nameof(UserIdentity.Id)+") from " + nameof(UserIdentity); + public const string GET_UNASSIGNED_CARD_LIST = + "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?"; - public const string GET_USER_CONTRACTED_HOURS = "select "+nameof(UserIdentity.HoursPerWeek)+ " From UserIdentity where " + nameof(UserIdentity.Id) + "=?"; + public const string UPDATE_CARD_USER_ID = + "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " + + nameof(CardUniqueId.Id) + "=?"; + + public const string SEARCH_USER_LIST = + "SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " + + nameof(UserIdentity.LastName) + " Like ?)"; + + public const string GET_LAST_TIMELOG_DIRECTION = + "SELECT * FROM " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.UserId_FK) + " = ? order by " + + nameof(TimeLogDb.SwipeEventDateTime) + " desc LIMIT 1"; + + public const string GET_TOTAL_USER_COUNT = + "select Max(" + nameof(UserIdentity.Id) + ") from " + nameof(UserIdentity); + + public const string GET_USER_CONTRACTED_HOURS = + "select " + nameof(UserIdentity.HoursPerWeek) + " From UserIdentity where " + nameof(UserIdentity.Id) + "=?"; } } \ No newline at end of file From cb6c595c8cd85511449e6b178ba0ee55e9509cac Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 16:47:16 +0000 Subject: [PATCH 10/17] created AppDetails object #48 --- .../WindowsDataCenter/Interfaces/AppDetails.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 DataCenter_Windows/WindowsDataCenter/Interfaces/AppDetails.cs diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/AppDetails.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/AppDetails.cs new file mode 100644 index 0000000..c9195d9 --- /dev/null +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/AppDetails.cs @@ -0,0 +1,11 @@ +namespace Interfaces +{ + public class AppDetails + { + public string ApplicationName { get; set; } + public string Version { get; set; } + public string DataBaseProvider { get; set; } + public string LoggerProvider { get; set; } + public string ErrorEmailAddress { get; set; } + } +} From f4e8f0a76faca6b7aed150998f896d4b33fb9275 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 16:47:51 +0000 Subject: [PATCH 11/17] updated the AssemblyInfo properties to be the right version. --- .../WindowsDataCenter/Interfaces/Properties/AssemblyInfo.cs | 4 ++-- .../WindowsDataCenter/NLogLogger/Properties/AssemblyInfo.cs | 4 ++-- .../SQLiteRepository/Properties/AssemblyInfo.cs | 2 +- .../WindowsDataCenter/Properties/AssemblyInfo.cs | 4 ++-- .../WindowsDataServiceHost/Properties/AssemblyInfo.cs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/Properties/AssemblyInfo.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/Properties/AssemblyInfo.cs index b188278..9df079e 100644 --- a/DataCenter_Windows/WindowsDataCenter/Interfaces/Properties/AssemblyInfo.cs +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.2.0")] -[assembly: AssemblyFileVersion("0.1.2.0")] +[assembly: AssemblyVersion("0.1.4.0")] +[assembly: AssemblyFileVersion("0.1.4.0")] diff --git a/DataCenter_Windows/WindowsDataCenter/NLogLogger/Properties/AssemblyInfo.cs b/DataCenter_Windows/WindowsDataCenter/NLogLogger/Properties/AssemblyInfo.cs index b0b6e8c..03a903a 100644 --- a/DataCenter_Windows/WindowsDataCenter/NLogLogger/Properties/AssemblyInfo.cs +++ b/DataCenter_Windows/WindowsDataCenter/NLogLogger/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.2.0")] -[assembly: AssemblyFileVersion("0.1.2.0")] +[assembly: AssemblyVersion("0.1.4.0")] +[assembly: AssemblyFileVersion("0.1.4.0")] diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/Properties/AssemblyInfo.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/Properties/AssemblyInfo.cs index 13a4415..1a0a124 100644 --- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/Properties/AssemblyInfo.cs +++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.2.0")] +[assembly: AssemblyVersion("0.1.4.0")] [assembly: AssemblyFileVersion("0.1.2.0")] diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Properties/AssemblyInfo.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Properties/AssemblyInfo.cs index 970703e..59ba13e 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Properties/AssemblyInfo.cs +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.2.0")] -[assembly: AssemblyFileVersion("0.1.2.0")] +[assembly: AssemblyVersion("0.1.4.0")] +[assembly: AssemblyFileVersion("0.1.4.0")] diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataServiceHost/Properties/AssemblyInfo.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataServiceHost/Properties/AssemblyInfo.cs index 303630b..0103300 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataServiceHost/Properties/AssemblyInfo.cs +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataServiceHost/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.1.4.0")] +[assembly: AssemblyFileVersion("0.1.4.0")] From 6f3c5931f4eaa57c3c0f6078d1c1028ca9dd4f2b Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 16:48:44 +0000 Subject: [PATCH 12/17] created ApplicationController which returns an AppDetails object with the properties filled. #48 --- .../Interfaces/Interfaces.csproj | 1 + .../Controllers/ApplicationController.cs | 27 +++++++++++++++++++ .../WindowsDataCenter.csproj | 1 + 3 files changed, 29 insertions(+) create mode 100644 DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/ApplicationController.cs diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj b/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj index 5dec2a9..90c1283 100644 --- a/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj +++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj @@ -40,6 +40,7 @@ + diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/ApplicationController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/ApplicationController.cs new file mode 100644 index 0000000..e9835fd --- /dev/null +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/ApplicationController.cs @@ -0,0 +1,27 @@ +using System.Configuration; +using System.Reflection; +using System.Web.Http; +using Interfaces; + +namespace WindowsDataCenter +{ + [RoutePrefix("api/app")] + public class ApplicationController:ApiController + { + [Route("")] + public IHttpActionResult GetAppDetails() + { + var ninjectHelper = NinjectHelper.GetInstance(); + var appDetails = new AppDetails + { + ApplicationName = "Flexitime Tracker", + DataBaseProvider = ninjectHelper.Get().GetType().ToString(), + LoggerProvider = ninjectHelper.Get().GetType().ToString(), + Version = Assembly.GetEntryAssembly().GetName().Version.ToString(), + ErrorEmailAddress = ConfigurationManager.AppSettings["BugSubmissionEmailAddress"] ?? "NONE" + }; + + return Ok(appDetails); + } + } +} diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj index 03cfb28..518c4da 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj @@ -147,6 +147,7 @@ + From c8c915d4e676040478c904b617a57ccca254b44b Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 16:52:41 +0000 Subject: [PATCH 13/17] Added getAppDetails function to retrieve the application details object from the api. Added getAppDetails endpoint to apiEndpoints object. Set Homepage (users) to get the appdetails if the appDetails observable returns null. #48 --- .../WindowsDataCenter/www/spa.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js index 50911e8..69f8de8 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js @@ -3,6 +3,7 @@ var self = this; self.menuOptions = ["Home"]; self.chosenMenuItemId = ko.observable(); + self.appDetails = ko.observable(null); self.userList = ko.observable(null); self.chosenUserDetails = ko.observable(null); self.userTimeLogData = ko.observable(null); @@ -16,7 +17,8 @@ getUserDetails: "/api/users", editUser: "/api/users/edit", getTimeLogs: "/api/timelogs", - getUnassignedCards: "/api/cards/unassigned" + getUnassignedCards: "/api/cards/unassigned", + getAppDetails: "/api/app" }; self.uiPages = { users: "users", @@ -231,6 +233,16 @@ self.assignErrorObject(errObj.errorCode, errObj.errorMessage, "getUserList"); }); }; + self.getAppDetails = function() { + var url = self.createRequestUrl(self.apiEndpoints.getAppDetails, null, false, false); + $.getJSON(url, function (res) { + self.appDetails(res); + }).fail(function (response, status, error) { + console.log("error - getusers"); + var errObj = self.processRequestFailure(response, status, error); + self.assignErrorObject(errObj.errorCode, errObj.errorMessage, "getUserList"); + }); + }; self.searchUsers = function(query) { var url = self.createRequestUrl(self.apiEndpoints.getUserList, [{ key: "query", value: query }], false, false); @@ -308,6 +320,9 @@ self.chosenUserDetails(null); self.userList(null); self.userTimeLogData(null); + if (self.appDetails() === null) { + self.getAppDetails(); + } if (query) self.searchUsers(query); else From be6a529afb59473f8670484d0fe8646f98b2d2a4 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Mon, 27 Feb 2017 16:53:29 +0000 Subject: [PATCH 14/17] Add modal 'about' dialog, databind to appDetails observable. triggered off an about button in the navbar. #48 --- .../WindowsDataCenter/www/index.html | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html index ee92e71..a1ebee3 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html @@ -38,6 +38,7 @@ + @@ -125,6 +126,7 @@ +
@@ -252,7 +254,35 @@
- + +
First Name Last Name Contractor +
+ + IN + + + OUT + +
- IN + IN - OUT + OUT
+ + + + + + + + +
Version
Database Provider
+
+ Submit Error Report +
+ +
+
+
+