diff --git a/.gitignore b/.gitignore
index 331e2c1..0930bf1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@
**/node_modules/*
**csproj.DotSettings
**.csproj.user
+*spa.min.*
+**spa.min.*
diff --git a/DataCenter_Windows/DBTestData/flexitimedb_12-Apr-2017.db b/DataCenter_Windows/DBTestData/flexitimedb_12-Apr-2017.db
new file mode 100644
index 0000000..7c27a46
Binary files /dev/null and b/DataCenter_Windows/DBTestData/flexitimedb_12-Apr-2017.db differ
diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.csproj b/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.csproj
index ffb3c89..2f275a1 100644
--- a/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/CardReaderService/CardReaderService.csproj
@@ -32,6 +32,26 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderService/Configuration.cs b/DataCenter_Windows/WindowsDataCenter/CardReaderService/Configuration.cs
index a045fde..508a4d1 100644
--- a/DataCenter_Windows/WindowsDataCenter/CardReaderService/Configuration.cs
+++ b/DataCenter_Windows/WindowsDataCenter/CardReaderService/Configuration.cs
@@ -1,5 +1,4 @@
using System;
-using System.Diagnostics;
using System.IO;
using System.Reflection;
using CardReaderService.DefaultComponents;
diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceHost/CardReaderServiceHost.csproj b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceHost/CardReaderServiceHost.csproj
index 5556dd0..3a3f061 100644
--- a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceHost/CardReaderServiceHost.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceHost/CardReaderServiceHost.csproj
@@ -32,6 +32,26 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
..\CardReaderService\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceComponents.wxs b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceComponents.wxs
index 1386663..9b96fdf 100644
--- a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceComponents.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/CardReaderServiceComponents.wxs
@@ -25,6 +25,7 @@
+
+
+
+
+
diff --git a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Properties.wxs b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Properties.wxs
index a7c1387..05c41f1 100644
--- a/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Properties.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/CardReaderServiceInstaller/Properties.wxs
@@ -2,5 +2,7 @@
+
+
diff --git a/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.csproj b/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.csproj
index 974cfe3..461434d 100644
--- a/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/ConfigurationHandler/ConfigurationHandler.csproj
@@ -29,6 +29,24 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
diff --git a/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/Bundle.wxs b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/Bundle.wxs
new file mode 100644
index 0000000..0d330d0
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/Bundle.wxs
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/FlexiTimeSystemInstaller.wixproj b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/FlexiTimeSystemInstaller.wixproj
new file mode 100644
index 0000000..859047b
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/FlexiTimeSystemInstaller.wixproj
@@ -0,0 +1,74 @@
+
+
+
+ Debug
+ x86
+ 3.10
+ d38e92db-48f9-40c3-9a6f-d76fbd07326e
+ 2.0
+ FlexiTimeSystemInstaller
+ Bundle
+ $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets
+ $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets
+
+
+ bin\$(Configuration)\
+ obj\$(Configuration)\
+ Debug
+
+
+ bin\$(Configuration)\
+ obj\$(Configuration)\
+
+
+
+
+
+
+ $(WixExtDir)\WixBalExtension.dll
+ WixBalExtension
+
+
+
+
+
+
+
+
+
+
+
+ CardReaderServiceInstaller
+ {119216de-fc7f-408a-9c2c-105874449e42}
+ True
+ True
+ Binaries;Content;Satellites
+ INSTALLFOLDER
+
+
+ SQLiteRepositoryInstaller
+ {41caf3c0-ddf9-4a65-a715-da07c4178cbf}
+ True
+ True
+ Binaries;Content;Satellites
+ INSTALLFOLDER
+
+
+ DataCenterHostInstaller
+ {c5a4cdc3-849c-4166-bdc3-56bdb307126d}
+ True
+ True
+ Binaries;Content;Satellites
+ INSTALLFOLDER
+
+
+
+
+
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/License.rtf b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/License.rtf
new file mode 100644
index 0000000..044a0b0
Binary files /dev/null and b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/License.rtf differ
diff --git a/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/Theme.xml b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/Theme.xml
new file mode 100644
index 0000000..bb92e5d
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/Theme.xml
@@ -0,0 +1,85 @@
+
+ #(loc.Caption)
+ Segoe UI
+ Segoe UI
+ Segoe UI
+ Segoe UI
+ Segoe UI
+
+
+ #(loc.Title)
+
+
+ #(loc.HelpHeader)
+ #(loc.HelpText)
+
+
+
+ Install Card Service
+
+ Install Data Centre
+
+ Data Centre IP Address
+
+ Data Centre Website Port
+
+ Database Type
+
+
+
+
+
+
+ #(loc.OptionsHeader)
+ #(loc.OptionsLocationLabel)
+
+
+
+
+
+
+ #(loc.FilesInUseHeader)
+ #(loc.FilesInUseLabel)
+
+
+
+
+
+
+
+
+
+ #(loc.ProgressHeader)
+ #(loc.ProgressLabel)
+ #(loc.OverallProgressPackageText)
+
+
+
+
+ #(loc.ModifyHeader)
+
+
+
+
+
+ #(loc.SuccessHeader)
+ #(loc.SuccessInstallHeader)
+ #(loc.SuccessRepairHeader)
+ #(loc.SuccessUninstallHeader)
+
+ #(loc.SuccessRestartText)
+
+
+
+
+ #(loc.FailureHeader)
+ #(loc.FailureInstallHeader)
+ #(loc.FailureUninstallHeader)
+ #(loc.FailureRepairHeader)
+ #(loc.FailureHyperlinkLogText)
+
+ #(loc.FailureRestartText)
+
+
+
+
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/ThemeLocalisation.wxl b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/ThemeLocalisation.wxl
new file mode 100644
index 0000000..027be42
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/FlexiTimeSystemInstaller/ThemeLocalisation.wxl
@@ -0,0 +1,63 @@
+
+
+
+
+
+ [WixBundleName] Setup
+ [WixBundleName]
+ Version [WixBundleVersion]
+ Are you sure you want to cancel?
+ Previous version
+
+
+ /install | /repair | /uninstall | /layout [directory] - installs, repairs, uninstalls or
+ creates a complete local copy of the bundle in directory. Install is the default.
+
+ /passive | /quiet - displays minimal UI with no prompts or displays no UI and
+ no prompts. By default UI and all prompts are displayed.
+
+ /norestart - suppress any attempts to restart. By default UI will prompt before restart.
+ /log log.txt - logs to a specific file. By default a log file is created in %TEMP%.
+
+ &Close
+ I &agree to the license terms and conditions
+ &Options
+ &Install
+ &Close
+
+ Install location:
+ &Browse
+ &OK
+ &Cancel
+
+ Processing:
+ Initializing...
+ &Cancel
+
+ &Repair
+ &Uninstall
+ &Close
+
+
+
+
+ &Launch
+ You must restart your computer before you can use the software.
+ &Restart
+ &Close
+
+
+
+
+ One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the <a href="#">log file</a>.
+ You must restart your computer to complete the rollback of the software.
+ &Restart
+ &Close
+
+ The following applications are using files that need to be updated:
+ Close the &applications and attempt to restart them.
+ &Do not close applications. A reboot will be required.
+ &OK
+ &Cancel
+ No action was taken as a system reboot is required.
+
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/EventLogResponse.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/EventLogResponse.cs
new file mode 100644
index 0000000..8331d70
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/EventLogResponse.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Interfaces
+{
+ public class LogEventResponse
+ {
+ public LogDirection Direction { get; set; }
+ public OperationResponse ProcessResponse { get; set; }
+ }
+}
diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/IRepository.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/IRepository.cs
index 6600e0f..30f8141 100644
--- a/DataCenter_Windows/WindowsDataCenter/Interfaces/IRepository.cs
+++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/IRepository.cs
@@ -95,12 +95,16 @@ namespace Interfaces
///
/// to indicate procedure status.
///
- OperationResponse LogEventTime(Identifier identifier, out int logId);
+ LogEventResponse LogEventTime(Identifier identifier, out int logId);
OperationResponse CreateGroup(Group group, out int groupId);
List GetGroups(int userId = -1);
Group GetGroup(int groupId);
OperationResponse UpdateGroup(Group group);
OperationResponse DeleteGroup(int groupId);
+
+ OperationResponse DeleteLog(TimeLog log);
+ OperationResponse CreateLog(TimeLog log);
+ OperationResponse UpdateLog(TimeLog log);
}
}
diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj b/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj
index efff1a9..2a53dee 100644
--- a/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/Interfaces.csproj
@@ -29,6 +29,24 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
@@ -42,6 +60,7 @@
+
diff --git a/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLog.cs b/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLog.cs
index 416fb4a..57cedae 100644
--- a/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLog.cs
+++ b/DataCenter_Windows/WindowsDataCenter/Interfaces/TimeLog.cs
@@ -11,6 +11,7 @@ namespace Interfaces
public DateTimeOffset EventTime { get; set; }
public int CalendarWeek { get; set; }
public int Year { get; set; }
+ public LogSource Source { get; set; }
}
public enum LogDirection
@@ -19,4 +20,12 @@ namespace Interfaces
IN = 1,
OUT = 2
}
+
+ public enum LogSource
+ {
+ UNKNOWN=0,
+ IDENTIFIER=1,
+ UI=2,
+ TRAYAPP=3
+ }
}
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/NLogLogger/NLogLogger.csproj b/DataCenter_Windows/WindowsDataCenter/NLogLogger/NLogLogger.csproj
index a87fe54..82362dc 100644
--- a/DataCenter_Windows/WindowsDataCenter/NLogLogger/NLogLogger.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/NLogLogger/NLogLogger.csproj
@@ -29,6 +29,24 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
..\packages\NLog.4.4.2\lib\net45\NLog.dll
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteProvider/Product.wxs b/DataCenter_Windows/WindowsDataCenter/SQLiteProvider/Product.wxs
new file mode 100644
index 0000000..7f006ab
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteProvider/Product.wxs
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteProvider/SQLiteRepositoryInstaller.wixproj b/DataCenter_Windows/WindowsDataCenter/SQLiteProvider/SQLiteRepositoryInstaller.wixproj
new file mode 100644
index 0000000..5315ae2
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteProvider/SQLiteRepositoryInstaller.wixproj
@@ -0,0 +1,52 @@
+
+
+
+ Debug
+ x86
+ 3.10
+ 41caf3c0-ddf9-4a65-a715-da07c4178cbf
+ 2.0
+ SQLiteRepository
+ Package
+ $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets
+ $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets
+ SQLiteRepositoryInstaller
+
+
+ bin\$(Configuration)\
+ obj\$(Configuration)\
+ Debug
+
+
+ bin\$(Configuration)\
+ obj\$(Configuration)\
+
+
+
+
+
+
+ SQLiteRepository
+ {b3510c81-f069-48a2-b826-ebe0ce7ab0b2}
+ True
+ True
+ Binaries;Content;Satellites
+ INSTALLFOLDER
+
+
+
+
+ $(WixExtDir)\WixUtilExtension.dll
+ WixUtilExtension
+
+
+
+
+
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/LogSourceDb.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/LogSourceDb.cs
new file mode 100644
index 0000000..8cf1ed5
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/LogSourceDb.cs
@@ -0,0 +1,10 @@
+namespace SQLiteRepository
+{
+ public enum LogSourceDb
+ {
+ UNKNOWN=0,
+ IDENTIFIER = 1,
+ UI = 2,
+ TRAYAPP = 3
+ }
+}
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs
index ac5e79c..b38588e 100644
--- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteProcedures.cs
@@ -18,6 +18,14 @@ namespace SQLiteRepository
"select * from " + nameof(UserIdentity) + " order by " + nameof(UserIdentity.LastName) + " collate nocase, " +
nameof(UserIdentity.FirstName) + " collate nocase limit ? offset ?";
+ public const string GET_ALL_USERS_BY_GROUP =
+ "select u." + nameof(UserIdentity.Id) + ", u." + nameof(UserIdentity.FirstName) + ", u." +
+ nameof(UserIdentity.LastName) + ", u." + nameof(UserIdentity.HoursPerWeek) + ", u." +
+ nameof(UserIdentity.IsContractor) + " from " + nameof(UserIdentity) + " u left join " +
+ nameof(UserGroupJoinDb) + " ugj on ugj." + nameof(UserGroupJoinDb.UserId_FK) + " = u." +
+ nameof(UserIdentity.Id) + " where ugj." + nameof(UserGroupJoinDb.GroupId_FK) + "=? order by u." +
+ nameof(UserIdentity.LastName) + " collate nocase, u." + nameof(UserIdentity.LastName) + " collate nocase";
+
public const string GET_USER_BY_ID =
"select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?";
@@ -38,6 +46,11 @@ namespace SQLiteRepository
"update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.LastUsed) + " = ? where " +
nameof(CardUniqueId.Id) + " = ?";
+ public const string UPDATE_USER_DETAILS =
+ "update " + nameof(UserIdentity) + " set " + nameof(UserIdentity.FirstName) + "=?, " +
+ nameof(UserIdentity.LastName) + "=?, " + nameof(UserIdentity.HoursPerWeek) + "=?," +
+ nameof(UserIdentity.IsContractor) + "=? where " + nameof(UserIdentity.Id) + "=?";
+
public const string SEARCH_USER_LIST =
"SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " +
nameof(UserIdentity.LastName) + " Like ?)";
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs
index ef49892..1d29754 100644
--- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.cs
@@ -50,7 +50,7 @@ namespace SQLiteRepository
{
users =
_connection.Query(
- "select u.Id, u.FirstName, u.LastName, u.HoursPerWeek, u.IsContractor from UserIdentity u left join UserGroupJoinDb ugj on ugj.UserId_FK = u.Id where ugj.GroupId_FK=?",
+ SQLiteProcedures.GET_ALL_USERS_BY_GROUP,
groupId);
userCount = users.Count;
}
@@ -87,7 +87,7 @@ namespace SQLiteRepository
}
if (pageNumber == -1 && pageSize == -1)
{
- ret.PageSize = 10;
+ ret.PageSize = 10;
ret.PageNumber = 1;
}
else
@@ -98,27 +98,7 @@ namespace SQLiteRepository
ret.TotalUserCount = userCount;
return ret;
}
-
- private DateTime GetLastLogDateTime(TimeLogDb timeLog)
- {
- if (timeLog != null)
- {
- return timeLog.SwipeEventDateTime.DateTime;
- }
- return DateTime.MinValue;
- }
-
- 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);
@@ -311,7 +291,7 @@ namespace SQLiteRepository
{
//edit..
_connection.Query(
- "update UserIdentity set FirstName=?, LastName=?, HoursPerWeek=?,IsContractor=? where Id=?",
+ SQLiteProcedures.UPDATE_USER_DETAILS,
user.FirstName,
user.LastName,
user.HoursPerWeek,
@@ -353,7 +333,7 @@ namespace SQLiteRepository
#region Update Group Associations
- SetUserGroups(userId, user.Groups.Where(x=>x.IsAssociatedToUser).ToList());
+ SetUserGroups(userId, user.Groups.Where(x => x.IsAssociatedToUser).ToList());
#endregion
@@ -361,8 +341,9 @@ namespace SQLiteRepository
return ret;
}
- public OperationResponse LogEventTime(Identifier identifier, out int logId)
+ public LogEventResponse LogEventTime(Identifier identifier, out int logId)
{
+ var ret = new LogEventResponse();
var cardIdQuery = _connection.Query(
SQLiteProcedures.GET_CARDS_BY_UNIQUE_ID,
identifier.UniqueId);
@@ -378,7 +359,9 @@ namespace SQLiteRepository
UpdateIdentifierLastUsed(DateTimeOffset.UtcNow, ident.Id);
logId = -1;
//dont try to log any timelogs against this card, as it is unassigned to a user.
- return OperationResponse.SUCCESS;
+ ret.ProcessResponse=OperationResponse.SUCCESS;
+ ret.Direction = LogDirection.UNKNOWN;
+ return ret;
}
else
{
@@ -392,7 +375,7 @@ namespace SQLiteRepository
#region Check the user hasnt registered an event in the last few minutes..
- if (ident.UserId_FK!=-1)
+ if (ident.UserId_FK != -1)
{ //only check log gap if the card is associated to a user
var hysteresisThresholdMinutes = Convert.ToInt32(ConfigurationHandler.ConfigurationHandler.GetConfiguration("SwipeTimeGap") ?? "3");
var threshold = DateTime.UtcNow.AddMinutes(0 - hysteresisThresholdMinutes);
@@ -404,8 +387,10 @@ namespace SQLiteRepository
{
_logger.Error("Not logging event for user id: {0}, logged event within TimeGap Threshold of {1}", ident.UserId_FK, threshold);
logId = -1;
- return OperationResponse.FAILED;
- }
+ ret.ProcessResponse = OperationResponse.FAILED;
+ ret.Direction = LogDirection.UNKNOWN;
+ return ret;
+ }
}
#endregion
@@ -415,7 +400,7 @@ namespace SQLiteRepository
var calendarWeek = GetIso8601CalendarWeek(logTime);
var year = logTime.Year;
#endregion
-
+
var timeLog = new TimeLogDb
{
SwipeEventDateTime = DateTime.UtcNow,
@@ -423,28 +408,30 @@ namespace SQLiteRepository
IdentifierId = ident.Id,
Direction = logDirection,
Year = year,
- CalendarWeek = calendarWeek
+ CalendarWeek = calendarWeek,
+ Source = LogSourceDb.IDENTIFIER
};
_connection.Insert(timeLog);
UpdateIdentifierLastUsed(timeLog.SwipeEventDateTime, timeLog.IdentifierId);
logId = timeLog.Id;
-
- return OperationResponse.SUCCESS;
+ ret.Direction = (LogDirection)(int)logDirection;
+ ret.ProcessResponse = OperationResponse.SUCCESS;
+ return ret;
}
/*Groups*/
//TODO: check group name can only be entered once.
public OperationResponse CreateGroup(Group group, out int groupId)
{
- var groupDb = new GroupDb { GroupName=group.Name};
+ var groupDb = new GroupDb { GroupName = group.Name };
var resp = _connection.Insert(groupDb);
groupId = groupDb.GroupId;
return OperationResponse.CREATED;
}
- public List GetGroups(int userId=-1)
+ public List GetGroups(int userId = -1)
{
var ret = new List();
List query;
@@ -459,13 +446,12 @@ namespace SQLiteRepository
}
else
{
- var t = new UserGroupJoinDb();
query =
_connection.Query(
- "select gdb.GroupId, gdb.GroupName, gdb.AssignedUserCount"+
- " from GroupDb gdb"+
- " left join UserGroupJoinDb ujdb"+
- " on gdb.GroupId = ujdb.GroupId_FK"+
+ "select gdb.GroupId, gdb.GroupName, gdb.AssignedUserCount" +
+ " from GroupDb gdb" +
+ " left join UserGroupJoinDb ujdb" +
+ " on gdb.GroupId = ujdb.GroupId_FK" +
" where ujdb.UserId_FK = ?",
userId);
}
@@ -473,9 +459,9 @@ namespace SQLiteRepository
{
ret.Add(new Group
{
- Id=group.GroupId,
+ Id = group.GroupId,
Name = group.GroupName,
- UserCount = int.Parse(group.AssignedUserCount??"0")
+ UserCount = int.Parse(group.AssignedUserCount ?? "0")
});
}
return ret;
@@ -500,11 +486,6 @@ namespace SQLiteRepository
public OperationResponse UpdateGroup(Group group)
{
//TODO: I would probably prefer to do this manually....
- var groupDb = new GroupDb
- {
- GroupId = group.Id,
- GroupName = group.Name
- };
var resp = _connection.Query("update GroupDb set GroupName=? where GroupId=?", group.Name, group.Id);
//var resp = _connection.Update(groupDb);
return OperationResponse.UPDATED;
@@ -516,9 +497,96 @@ namespace SQLiteRepository
return OperationResponse.DELETED;
}
+ public OperationResponse DeleteLog(TimeLog log)
+ {
+ var query = _connection.Query(
+ "select * from TimeLogDb where Id=?", log.Id);
+
+ if (!query.Any())
+ return OperationResponse.FAILED;
+
+ _connection.ExecuteScalar("delete from TimeLogDb where Id=?", log.Id);
+
+ return OperationResponse.DELETED;
+ }
+
+ public OperationResponse CreateLog(TimeLog log)
+ {
+ var calendarWeek = GetIso8601CalendarWeek(log.EventTime.UtcDateTime);
+ var year = log.EventTime.Year;
+ var dbLog = new TimeLogDb
+ {
+ SwipeEventDateTime = log.EventTime,
+ Direction = (LogDirectionDb)(int)log.Direction,
+ Year = year,
+ CalendarWeek = calendarWeek,
+ Source = (LogSourceDb)(int)log.Source,
+ UserId_FK = log.UserId,
+ IdentifierId = ConvertSourceToIdentifierId(log.Source),
+ };
+ _connection.Insert(dbLog);
+ return OperationResponse.CREATED;
+ }
+
+ public OperationResponse UpdateLog(TimeLog log)
+ {
+ var query = _connection.Query(
+ "select * from TimeLogDb where Id=?", log.Id);
+ if(!query.Any())
+ return OperationResponse.FAILED;
+
+ if (log.CalendarWeek > 52 || log.CalendarWeek < 1)
+ {
+ log.CalendarWeek = GetIso8601CalendarWeek(log.EventTime.UtcDateTime);
+ }
+ if (log.Year < 2017)
+ {
+ log.Year = log.EventTime.Year;
+ }
+ _connection.ExecuteScalar(
+ "update TimeLogDb set UserId_FK=?, Direction=?,SwipeEventDateTime=?,CalendarWeek=?,Year=?,Source=? where Id=?",
+ log.UserId, (LogDirectionDb) (int) log.Direction, log.EventTime, log.CalendarWeek, log.Year,
+ (LogSourceDb) (int) log.Source, log.Id);
+
+ return OperationResponse.UPDATED;
+ }
+
+ private DateTime GetLastLogDateTime(TimeLogDb timeLog)
+ {
+ if (timeLog != null)
+ {
+ return timeLog.SwipeEventDateTime.DateTime;
+ }
+ return DateTime.MinValue;
+ }
+
+ private bool GetUserState(LogDirectionDb logDirection)
+ {
+ switch (logDirection)
+ {
+ case LogDirectionDb.OUT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ private int ConvertSourceToIdentifierId(LogSource logSource)
+ {
+ switch (logSource)
+ {
+ case LogSource.UI:
+ return -100;
+ case LogSource.TRAYAPP:
+ return -200;
+ default:
+ return -10;
+ }
+ }
+
private bool SetUserGroups(int userId, List groups)
{
- var groupIds = GetGroupIds(groups.Select(x=>x.Name).ToList());
+ var groupIds = GetGroupIds(groups.Select(x => x.Name).ToList());
return SetUserGroups(userId, groupIds);
}
@@ -527,7 +595,7 @@ namespace SQLiteRepository
//remove the existing user>group associations
_connection.Query("delete from UserGroupJoinDb where UserId_FK = ?", userId);
//add the new group associations.
- _connection.InsertAll(groupIds.Select(x => new UserGroupJoinDb {GroupId_FK = x, UserId_FK = userId}));
+ _connection.InsertAll(groupIds.Select(x => new UserGroupJoinDb { GroupId_FK = x, UserId_FK = userId }));
return true;
}
@@ -560,7 +628,7 @@ namespace SQLiteRepository
EventTime = x.SwipeEventDateTime,
UserId = x.UserId_FK,
Year = x.Year
- }).ToList();
+ }).OrderBy(x=>x.EventTime.UtcDateTime).ToList();
var dict = new Dictionary();
var logList = new List();
@@ -572,7 +640,7 @@ namespace SQLiteRepository
}
//add the logs to the respective day of the week.
- foreach (var log in timeLogs)
+ foreach (var log in timeLogs.OrderBy(x=>x.EventTime))
{
dict[log.EventTime.DayOfWeek].Logs.Add(log);
}
@@ -592,7 +660,7 @@ namespace SQLiteRepository
foreach (DayOfWeek day in Enum.GetValues(typeof(DayOfWeek)))
{
if (logList.Any(x => x.Day == day)) continue;
- var dailyLog = new DailyLogs {Day = day, DayOfWeek = day.ToString()};
+ var dailyLog = new DailyLogs { Day = day, DayOfWeek = day.ToString() };
logList.Add(dailyLog);
}
@@ -601,13 +669,13 @@ namespace SQLiteRepository
dailyCollection.Value.DailyTotal = CalculateDailyTotal(dailyCollection.Value);
}
- return logList.OrderBy(x => ((int) x.Day + 6)%7).ToList();
+ return logList.OrderBy(x => ((int)x.Day + 6) % 7).ToList();
}
private double CalculateDailyTotal(DailyLogs dailyLogs)
{
var totalInTime = TimeSpan.FromSeconds(0);
- var logs = dailyLogs.Logs.OrderBy(x => x.Id).ToArray();
+ var logs = dailyLogs.Logs.OrderBy(x => x.EventTime.UtcDateTime).ToArray();
var totalCalcMax = IsOdd(logs.Length) ? logs.Length - 1 : logs.Length;
for (int i = 0; i < totalCalcMax; i += 2)
{
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.csproj b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.csproj
index 20ca85b..4ca4ebd 100644
--- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/SQLiteRepository.csproj
@@ -31,6 +31,24 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+
..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll
@@ -61,6 +79,7 @@
+
diff --git a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/TimeLogDb.cs b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/TimeLogDb.cs
index 7e13b4e..a59fcb2 100644
--- a/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/TimeLogDb.cs
+++ b/DataCenter_Windows/WindowsDataCenter/SQLiteRepository/TimeLogDb.cs
@@ -13,5 +13,6 @@ namespace SQLiteRepository
public DateTimeOffset SwipeEventDateTime { get; set; }
public int CalendarWeek { get; set; }
public int Year { get; set; }
+ public LogSourceDb Source { get; set; }
}
}
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterHostInstaller.wixproj b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterHostInstaller.wixproj
index 41d4af9..6ca1920 100644
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterHostInstaller.wixproj
+++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterHostInstaller.wixproj
@@ -31,10 +31,17 @@
-
+
+ ConfigurationHandler
+ {115250f6-f8c4-4f9b-a15f-251ea258d963}
+ True
+ True
+ Binaries;Content;Satellites
+ INSTALLFOLDER
+
Interfaces
{b7347b72-e208-423a-9d99-723b558ea3d7}
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterServiceComponents.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterServiceComponents.wxs
index 6d18551..f5a1056 100644
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterServiceComponents.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterServiceComponents.wxs
@@ -8,6 +8,7 @@
+
@@ -202,5 +203,15 @@
Checksum="yes"/>
+
+
+
+
-
+
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterURLACLConfiguration.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterURLACLConfiguration.wxs
index a55b324..0ec581d 100644
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterURLACLConfiguration.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DataCenterURLACLConfiguration.wxs
@@ -3,7 +3,7 @@
xmlns:http="http://schemas.microsoft.com/wix/HttpExtension">
-
+
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DirectoryStructure.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DirectoryStructure.wxs
index 417bcda..81910c4 100644
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DirectoryStructure.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/DirectoryStructure.wxs
@@ -3,7 +3,7 @@
-
+
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Product.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Product.wxs
index a03942d..9d69092 100644
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Product.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Product.wxs
@@ -29,7 +29,6 @@
-
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Properties.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Properties.wxs
index a7c1387..5fd31fe 100644
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Properties.wxs
+++ b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/Properties.wxs
@@ -2,5 +2,6 @@
+
diff --git a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/SQLiteRepository.wxs b/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/SQLiteRepository.wxs
deleted file mode 100644
index 61a4a38..0000000
--- a/DataCenter_Windows/WindowsDataCenter/WebApiServerHostInstaller/SQLiteRepository.wxs
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter.sln b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter.sln
index 8f6ddca..a9f2e89 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter.sln
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter.sln
@@ -30,90 +30,206 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installers", "Installers",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigurationHandler", "ConfigurationHandler\ConfigurationHandler.csproj", "{115250F6-F8C4-4F9B-A15F-251EA258D963}"
EndProject
+Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "FlexiTimeSystemInstaller", "FlexiTimeSystemInstaller\FlexiTimeSystemInstaller.wixproj", "{D38E92DB-48F9-40C3-9A6F-D76FBD07326E}"
+EndProject
+Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SQLiteRepositoryInstaller", "SQLiteProvider\SQLiteRepositoryInstaller.wixproj", "{41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
+ DebugInstallers|Any CPU = DebugInstallers|Any CPU
+ DebugInstallers|x86 = DebugInstallers|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
+ ReleaseInstallers|Any CPU = ReleaseInstallers|Any CPU
+ ReleaseInstallers|x86 = ReleaseInstallers|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Debug|x86.ActiveCfg = Debug|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Debug|x86.Build.0 = Debug|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Release|Any CPU.Build.0 = Release|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Release|x86.ActiveCfg = Release|Any CPU
{A5FEE048-17A6-4966-9B6B-BF073592A470}.Release|x86.Build.0 = Release|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {A5FEE048-17A6-4966-9B6B-BF073592A470}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Debug|x86.ActiveCfg = Debug|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Debug|x86.Build.0 = Debug|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Release|Any CPU.Build.0 = Release|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Release|x86.ActiveCfg = Release|Any CPU
{5A4E2CF2-FA51-413E-82C7-14A19A50766D}.Release|x86.Build.0 = Release|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {5A4E2CF2-FA51-413E-82C7-14A19A50766D}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Debug|x86.ActiveCfg = Debug|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Debug|x86.Build.0 = Debug|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Release|Any CPU.Build.0 = Release|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Release|x86.ActiveCfg = Release|Any CPU
{B7347B72-E208-423A-9D99-723B558EA3D7}.Release|x86.Build.0 = Release|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {B7347B72-E208-423A-9D99-723B558EA3D7}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Debug|x86.ActiveCfg = Debug|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Debug|x86.Build.0 = Debug|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Release|Any CPU.Build.0 = Release|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Release|x86.ActiveCfg = Release|Any CPU
{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.Release|x86.Build.0 = Release|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {B3510C81-F069-48A2-B826-EBE0CE7AB0B2}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Debug|x86.ActiveCfg = Debug|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Debug|x86.Build.0 = Debug|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Release|Any CPU.Build.0 = Release|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Release|x86.ActiveCfg = Release|Any CPU
{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.Release|x86.Build.0 = Release|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{C5A4CDC3-849C-4166-BDC3-56BDB307126D}.Debug|Any CPU.ActiveCfg = Debug|x86
{C5A4CDC3-849C-4166-BDC3-56BDB307126D}.Debug|x86.ActiveCfg = Debug|x86
{C5A4CDC3-849C-4166-BDC3-56BDB307126D}.Debug|x86.Build.0 = Debug|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.DebugInstallers|Any CPU.ActiveCfg = Debug|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.DebugInstallers|Any CPU.Build.0 = Debug|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.DebugInstallers|x86.ActiveCfg = Debug|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.DebugInstallers|x86.Build.0 = Debug|x86
{C5A4CDC3-849C-4166-BDC3-56BDB307126D}.Release|Any CPU.ActiveCfg = Release|x86
{C5A4CDC3-849C-4166-BDC3-56BDB307126D}.Release|x86.ActiveCfg = Release|x86
{C5A4CDC3-849C-4166-BDC3-56BDB307126D}.Release|x86.Build.0 = Release|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.ReleaseInstallers|Any CPU.ActiveCfg = Release|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.ReleaseInstallers|Any CPU.Build.0 = Release|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.ReleaseInstallers|x86.ActiveCfg = Release|x86
+ {C5A4CDC3-849C-4166-BDC3-56BDB307126D}.ReleaseInstallers|x86.Build.0 = Release|x86
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|x86.ActiveCfg = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|x86.Build.0 = Debug|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.Build.0 = Release|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|x86.ActiveCfg = Release|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|x86.Build.0 = Release|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Debug|x86.ActiveCfg = Debug|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Debug|x86.Build.0 = Debug|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|Any CPU.Build.0 = Release|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|x86.ActiveCfg = Release|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|x86.Build.0 = Release|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
{119216DE-FC7F-408A-9C2C-105874449E42}.Debug|Any CPU.ActiveCfg = Debug|x86
{119216DE-FC7F-408A-9C2C-105874449E42}.Debug|x86.ActiveCfg = Debug|x86
{119216DE-FC7F-408A-9C2C-105874449E42}.Debug|x86.Build.0 = Debug|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.DebugInstallers|Any CPU.ActiveCfg = Debug|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.DebugInstallers|Any CPU.Build.0 = Debug|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.DebugInstallers|x86.ActiveCfg = Debug|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.DebugInstallers|x86.Build.0 = Debug|x86
{119216DE-FC7F-408A-9C2C-105874449E42}.Release|Any CPU.ActiveCfg = Release|x86
{119216DE-FC7F-408A-9C2C-105874449E42}.Release|x86.ActiveCfg = Release|x86
{119216DE-FC7F-408A-9C2C-105874449E42}.Release|x86.Build.0 = Release|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.ReleaseInstallers|Any CPU.ActiveCfg = Release|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.ReleaseInstallers|Any CPU.Build.0 = Release|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.ReleaseInstallers|x86.ActiveCfg = Release|x86
+ {119216DE-FC7F-408A-9C2C-105874449E42}.ReleaseInstallers|x86.Build.0 = Release|x86
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Debug|Any CPU.Build.0 = Debug|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Debug|x86.ActiveCfg = Debug|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Debug|x86.Build.0 = Debug|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.DebugInstallers|Any CPU.ActiveCfg = DebugInstallers|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.DebugInstallers|Any CPU.Build.0 = DebugInstallers|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.DebugInstallers|x86.ActiveCfg = DebugInstallers|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.DebugInstallers|x86.Build.0 = DebugInstallers|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Release|Any CPU.ActiveCfg = Release|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Release|Any CPU.Build.0 = Release|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Release|x86.ActiveCfg = Release|Any CPU
{115250F6-F8C4-4F9B-A15F-251EA258D963}.Release|x86.Build.0 = Release|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.ReleaseInstallers|Any CPU.ActiveCfg = ReleaseInstallers|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.ReleaseInstallers|Any CPU.Build.0 = ReleaseInstallers|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.ReleaseInstallers|x86.ActiveCfg = ReleaseInstallers|Any CPU
+ {115250F6-F8C4-4F9B-A15F-251EA258D963}.ReleaseInstallers|x86.Build.0 = ReleaseInstallers|Any CPU
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.Debug|x86.ActiveCfg = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.Debug|x86.Build.0 = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.DebugInstallers|Any CPU.ActiveCfg = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.DebugInstallers|Any CPU.Build.0 = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.DebugInstallers|x86.ActiveCfg = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.DebugInstallers|x86.Build.0 = Debug|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.Release|Any CPU.ActiveCfg = Release|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.Release|x86.ActiveCfg = Release|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.Release|x86.Build.0 = Release|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.ReleaseInstallers|Any CPU.ActiveCfg = Release|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.ReleaseInstallers|Any CPU.Build.0 = Release|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.ReleaseInstallers|x86.ActiveCfg = Release|x86
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E}.ReleaseInstallers|x86.Build.0 = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.Debug|x86.ActiveCfg = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.Debug|x86.Build.0 = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.DebugInstallers|Any CPU.ActiveCfg = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.DebugInstallers|Any CPU.Build.0 = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.DebugInstallers|x86.ActiveCfg = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.DebugInstallers|x86.Build.0 = Debug|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.Release|Any CPU.ActiveCfg = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.Release|x86.ActiveCfg = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.Release|x86.Build.0 = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.ReleaseInstallers|Any CPU.ActiveCfg = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.ReleaseInstallers|Any CPU.Build.0 = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.ReleaseInstallers|x86.ActiveCfg = Release|x86
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF}.ReleaseInstallers|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -121,5 +237,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{C5A4CDC3-849C-4166-BDC3-56BDB307126D} = {10A7E78C-0D11-40DD-AEC3-27C2C507A926}
{119216DE-FC7F-408A-9C2C-105874449E42} = {10A7E78C-0D11-40DD-AEC3-27C2C507A926}
+ {D38E92DB-48F9-40C3-9A6F-D76FBD07326E} = {10A7E78C-0D11-40DD-AEC3-27C2C507A926}
+ {41CAF3C0-DDF9-4A65-A715-DA07C4178CBF} = {10A7E78C-0D11-40DD-AEC3-27C2C507A926}
EndGlobalSection
EndGlobal
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/App.config b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/App.config
index e54d778..7d38816 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/App.config
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/App.config
@@ -3,6 +3,7 @@
+
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/LogsController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/LogsController.cs
new file mode 100644
index 0000000..5a3d8b4
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/LogsController.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Web.Http;
+using WindowsDataCenter.Helpers;
+using Interfaces;
+
+namespace WindowsDataCenter
+{
+ [RoutePrefix("api/logs")]
+ public class LogsController:ApiController
+ {
+ private IRepository _repo;
+ private ILogger _logger;
+
+ public LogsController(IRepository repo, ILogger logger)
+ {
+ if (repo == null)
+ {
+ throw new ArgumentNullException(nameof(repo));
+ }
+ if (logger == null)
+ {
+ throw new ArgumentNullException(nameof(logger));
+ }
+ _repo = repo;
+ _logger = logger;
+ }
+
+ [HttpPost]
+ [Route("create")]
+ [CacheControl(MaxAge = 0)]
+ public IHttpActionResult CreateAndEditResultLog([FromBody] TimeLog log)
+ {
+ log.Source = LogSource.UI;
+ var resp = log.Id > 0 ? _repo.UpdateLog(log) : _repo.CreateLog(log);
+ return Ok(new {Id=log.Id, OperationResponse=resp});
+ }
+
+ [HttpDelete]
+ [Route("delete")]
+ [CacheControl(MaxAge = 0)]
+ public IHttpActionResult DeleteLog([FromBody] TimeLog log)
+ {
+ _logger.Info("Removing Log {0} for user id {1}", log.Id, log.UserId);
+ _repo.DeleteLog(log);
+ return Ok();
+ }
+ }
+}
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs
index d2e5d29..ed31a9f 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/SwipeDataController.cs
@@ -14,10 +14,12 @@ namespace WindowsDataCenter
{
private readonly IRepository _repo;
private readonly ILogger _logger;
+
///
///
///
///
+ ///
public SwipeDataController(IRepository repo, ILogger logger)
{
if(repo == null) throw new ArgumentNullException(nameof(repo));
@@ -36,24 +38,10 @@ namespace WindowsDataCenter
public IHttpActionResult PostData([FromBody] CardData cData)
{
int logId;
- _repo.LogEventTime(new Identifier {UniqueId = cData.CardUId}, out logId);
- _logger.Trace("Received new \"Swipe Event\" for UId: {0} at {1}", cData.CardUId, DateTime.UtcNow);
- return
- ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK)
- {
- Content = new StringContent(logId.ToString())
- });
- }
- ///
- ///
- ///
- ///
- ///
- [HttpPost]
- [Route("manual")]
- public IHttpActionResult ManuallyPostData([FromBody] ManualLog log)
- {
- throw new NotImplementedException();
+ var resp = _repo.LogEventTime(new Identifier {UniqueId = cData.CardUId}, out logId);
+ _logger.Trace("Received new \"Swipe Event\" for UId: {0} at {1}, direction is : {2}", cData.CardUId,
+ DateTime.UtcNow, resp.Direction);
+ return Ok(new {Id = logId, resp.Direction});
}
}
}
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/DataCenterService.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/DataCenterService.cs
index 8acb365..516e566 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/DataCenterService.cs
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/DataCenterService.cs
@@ -1,4 +1,7 @@
using System;
+using System.Configuration;
+using System.IO;
+using System.Reflection;
using System.ServiceProcess;
using System.Threading;
using Interfaces;
@@ -31,6 +34,12 @@ namespace WindowsDataCenter
protected override void OnStart(string[] args)
{
var configPath = string.Concat(System.Reflection.Assembly.GetEntryAssembly().Location, ".config");
+ //var configsDir = new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "configs")).LocalPath;
+ //var exeName = Assembly.GetEntryAssembly().ManifestModule.ScopeName;
+ //var appConfigPath = Path.Combine(configsDir, string.Format("{0}.config", exeName));
+ //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", appConfigPath);
+ //var val = ConfigurationManager.AppSettings["TEST"];
+
//Initialise the Ninject system.
var ninjectInstance = NinjectHelper.GetInstance();
_logger = NinjectHelper.GetInstance().Get();
@@ -40,12 +49,14 @@ namespace WindowsDataCenter
_mainWorkerThread = new Thread(MainWorkerThread)
{
IsBackground = false,
- Name = "OWIN SELF HOST MAIN THREAD"
+ Name = "DATACENTER SELF HOST MAIN THREAD"
};
- //TODO: use app.config for endpoint config.
+
+ var endpointPort = ConfigurationManager.AppSettings["WebsiteHttpPort"] ?? "8800";
try
{
- _webApp = WebApp.Start("http://*:8800");
+ var endpoint = string.Format("http://*:{0}", endpointPort);
+ _webApp = WebApp.Start(endpoint);
}
catch (Exception ex)
{
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Minifier/Minify.bat b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Minifier/Minify.bat
index 8675f9f..69bc5c4 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Minifier/Minify.bat
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Minifier/Minify.bat
@@ -5,7 +5,7 @@ echo "1 - %Directory%"
echo "1a - %SolutionDir%"
call :normalise "%Directory%"
-start /wait "" "%Directory%" -xml "%SolutionDir%WindowsDataCenter\Minifier\MinifierConfig.xml"
+start /wait /min "" "%Directory%" -xml "%SolutionDir%WindowsDataCenter\Minifier\MinifierConfig.xml"
GOTO :EOF
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj
index b86b216..4dee973 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/WindowsDataCenter.csproj
@@ -35,6 +35,27 @@
prompt
4
+
+ true
+ bin\DebugInstallers\
+ DEBUG;TRACE
+ bin\Debug\WindowsDataCenter.XML
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\ReleaseInstallers\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
..\packages\DalSoft.WebApi.HelpPage.0.0.7.0\lib\net451\DalSoft.WebApi.HelpPage.dll
@@ -151,6 +172,7 @@
+
@@ -199,6 +221,9 @@
PreserveNewest
+
+ Always
+
Always
@@ -220,6 +245,9 @@
PreserveNewest
+
+ Always
+
Always
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/Helpers.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/Helpers.js
index dd19e67..9f241b8 100644
--- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/Helpers.js
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/Helpers.js
@@ -3,7 +3,7 @@
/**
* Create a request URL - references apiEndpoints object to construct url with args, and optional callback url.
* @param {string} routePath
- * @param {Array