From 20f0ccb2112bfa6ba68d22b1be29d727a1cf7ad3 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 08:03:32 +0100 Subject: [PATCH 01/30] fix null reference error when configuration setting specified by "keyName" parameter doesnt exist. #79 --- .../ConfigurationHandler/ConfigurationHandler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.cs b/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.cs index 0359e05..d10e35c 100644 --- a/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.cs +++ b/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.cs @@ -1,4 +1,5 @@ using System.Configuration; +using System.Linq; namespace ConfigurationHandler { @@ -7,7 +8,9 @@ namespace ConfigurationHandler public static string GetConfiguration(string keyName) { var appSettings = ConfigurationManager.OpenExeConfiguration(System.Reflection.Assembly.GetEntryAssembly().Location).AppSettings; - return appSettings.Settings[keyName].Value; + if(appSettings.Settings.AllKeys.Contains(keyName)) + return appSettings.Settings[keyName].Value; + return string.Empty; } } } From 5dbd7a7ded3cfd120d401f672a9f7063052cec9b Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 08:15:27 +0100 Subject: [PATCH 02/30] change card reader decision code to prevent null ref in main app. #79 --- .../CardReaderService/CardReaderService.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.cs b/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.cs index 9422698..6f6d5d8 100644 --- a/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.cs +++ b/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.cs @@ -52,15 +52,13 @@ namespace CardReaderService } var readerNameConfig = ConfigurationHandler.ConfigurationHandler.GetConfiguration("ReaderName"); - if (string.IsNullOrEmpty(readerNameConfig)) + if (string.IsNullOrEmpty(readerNameConfig) || (!readerNames.Contains(readerNameConfig))) { - if (!readerNames.Contains(readerNameConfig)) - { - _logger.Warn("No reader found with the name: {0}, defaulting to first available reader {1}", - readerNameConfig, readerNames.First()); + _logger.Warn("No reader found with the name: {0}, defaulting to first available reader {1}", + readerNameConfig, readerNames.First()); - readerNameConfig=readerNames.First(); - } + readerNameConfig = readerNames.First(); + } _logger.Trace("Choosing reader: {0}", readerNameConfig); _readerName = readerNameConfig; From 54c86b41ed51814a2e33f05f5d2746e9472be9f1 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 08:16:10 +0100 Subject: [PATCH 03/30] Add reference to ConfigurationHandler project. Add component tag for ConfigurationHandler dll #78 --- .../CardReaderServiceInstaller.wixproj | 8 ++++++++ .../CardReaderServiceInstaller/Common.wxs | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceInstaller.wixproj b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceInstaller.wixproj index a8847dc..c5bbea3 100644 --- a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceInstaller.wixproj +++ b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceInstaller.wixproj @@ -37,6 +37,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + ConfigurationHandler + {115250f6-f8c4-4f9b-a15f-251ea258d963} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + Interfaces {b7347b72-e208-423a-9d99-723b558ea3d7} diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Common.wxs b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Common.wxs index 9bb6fef..e8a39b4 100644 --- a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Common.wxs +++ b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Common.wxs @@ -8,6 +8,12 @@ KeyPath="yes" Source="$(var.Interfaces.TargetDir)Interfaces.dll" /> + + + From 06e3dbcdee2bccd95c6178fdba1cee2068cbc076 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 08:16:38 +0100 Subject: [PATCH 04/30] add missing knockout context menu css and js files. #78 --- .../WebApiServerHostInstaller/WebPages.wxs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/WebPages.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/WebPages.wxs index 294e388..0d47858 100644 --- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/WebPages.wxs +++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/WebPages.wxs @@ -93,6 +93,12 @@ KeyPath="yes" Checksum="yes"/> + + + @@ -177,6 +183,12 @@ KeyPath="yes" Checksum="yes"/> + + + From 4cab3932fa23dd14b375945a972cf4d01f6b53a8 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 09:19:26 +0100 Subject: [PATCH 05/30] added goToToday click handler for viewModel. this is to change the date on the picker control to todays date as the bootstrap datepicker control today button doesnt appear to be working. #83 --- .../WindowsDataCenter/www/spa.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js index b7629a1..ebdfd1a 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js @@ -52,6 +52,11 @@ } location.hash = url; }; + self.goToToday = function(a, b, c) { + self.goToTimeLogs(self.chosenTimeLogUserId, + null, + [{ key: "selectedDate", value: moment(new Date()).format("MM-DD-YYYY") }]); + }; self.assignErrorObject = function(errCode, errMessage, errorSource) { var errDat = { errorCode: errCode, @@ -176,9 +181,9 @@ } moment.locale("en", { week: { dow: 1 } }); $("#weeklyDatePicker").datetimepicker({ + //showTodayButton: true, format: "DD/MM/YYYY", inline: true, - showTodayButton: true, calendarWeeks: true, maxDate: "now", date: selectedDate @@ -369,12 +374,13 @@ ]); function editlog (data) { self.manualLog(data); - $('#manualLogDialog').modal("show"); - $('#datetimepicker1').datetimepicker({ + $("#manualLogDialog").modal("show"); + $("#datetimepicker1").datetimepicker({ format: "YYYY-DD-MM HH:mm:ss", date: new Date(data.EventTime), - minDate: moment(new Date(data.EventTime)).startOf('week'), - maxDate: moment(new Date(data.EventTime)).endOf('week') + sideBySide: true, + minDate: moment(new Date(data.EventTime)).startOf("week"), + maxDate: moment(new Date(data.EventTime)).endOf("week") }); self.assignUpdateHandler(); }; From 205d8e30dc73858521cccb0227633e2a8af703ec Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 09:20:56 +0100 Subject: [PATCH 06/30] refine the goToToday function. #83 --- .../WindowsDataCenter/WindowsDataCenter/www/spa.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js index ebdfd1a..fcd0081 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js @@ -52,10 +52,10 @@ } location.hash = url; }; - self.goToToday = function(a, b, c) { + self.goToToday = function() { self.goToTimeLogs(self.chosenTimeLogUserId, null, - [{ key: "selectedDate", value: moment(new Date()).format("MM-DD-YYYY") }]); + null); }; self.assignErrorObject = function(errCode, errMessage, errorSource) { var errDat = { From 67fc6a12aeafb6c5465334264b0bc21652af6cdb Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 21 Apr 2017 09:21:48 +0100 Subject: [PATCH 07/30] add js script types. add manual Today button, databound to the goToToday method in viewmodel. #83 --- .../WindowsDataCenter/www/index.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html index 0b8e067..5e2353b 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/index.html @@ -10,14 +10,14 @@ - + - - + + - +