Merge branch 'Release0.2'

This commit is contained in:
chris.watts90@outlook.com 2020-02-25 15:14:36 +00:00
commit fe5bcd3256
92 changed files with 23644 additions and 22182 deletions

View File

@ -0,0 +1,5 @@
[program:CardReaderService]
command=mono-service CardReaderService.exe --no-daemon
directory=/DIRECTORYTOSET/CardReaderService
stdout_logfile=/DIRECTORYTOSET/CardReaderService/out.log
redirect_stderr=true

View File

@ -1,28 +1,41 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 14
VisualStudioVersion = 14.0.25420.1 VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderService", "CardReaderService.csproj", "{5F30E8E4-5107-4C99-ADFF-38D735DC113D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderService", "CardReaderService\CardReaderService.csproj", "{5F30E8E4-5107-4C99-ADFF-38D735DC113D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderServiceHost", "..\CardReaderServiceHost\CardReaderServiceHost.csproj", "{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderServiceHost", "CardReaderServiceHost\CardReaderServiceHost.csproj", "{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}"
EndProject EndProject
Global Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logger", "Logger\Logger.csproj", "{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}"
GlobalSection(SolutionConfigurationPlatforms) = preSolution EndProject
Debug|Any CPU = Debug|Any CPU Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux Conf", "Linux Conf", "{F9053F37-761D-45EE-9153-46776B083DBA}"
Release|Any CPU = Release|Any CPU ProjectSection(SolutionItems) = preProject
EndGlobalSection CardReaderService.conf = CardReaderService.conf
GlobalSection(ProjectConfigurationPlatforms) = postSolution install.sh = install.sh
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU uninstall.sh = uninstall.sh
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.Build.0 = Debug|Any CPU EndProjectSection
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.ActiveCfg = Release|Any CPU EndProject
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.Build.0 = Release|Any CPU Global
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU GlobalSection(SolutionConfigurationPlatforms) = preSolution
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Debug|Any CPU.Build.0 = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|Any CPU.ActiveCfg = Release|Any CPU Release|Any CPU = Release|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection
EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution
GlobalSection(SolutionProperties) = preSolution {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
HideSolutionNode = FALSE {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobal {5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.Build.0 = Release|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}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}.Release|Any CPU.Build.0 = Release|Any CPU
{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup> </startup>
<appSettings> <appSettings>
<add key="DataCenterServiceEndpoint" value="http://localhost:1234"/> <add key="DataCenterServiceEndpoint" value="http://localhost:1234"/>
</appSettings> </appSettings>
</configuration> </configuration>

View File

@ -0,0 +1,10 @@
using System;
namespace CardReaderService
{
public class CardDataPost
{
public DateTime UtcTimeStamp { get; set; }
public string CardUId { get; set; }
}
}

View File

@ -1,79 +1,90 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid> <ProjectGuid>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderService</RootNamespace> <RootNamespace>CardReaderService</RootNamespace>
<AssemblyName>CardReaderService</AssemblyName> <AssemblyName>CardReaderService</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup> <TargetFrameworkProfile />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> </PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>full</DebugType> <DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize> <DebugType>full</DebugType>
<OutputPath>bin\Debug\</OutputPath> <Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants> <OutputPath>bin\Debug\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> </PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize> <DebugType>pdbonly</DebugType>
<OutputPath>bin\Release\</OutputPath> <Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants> <OutputPath>bin\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<ItemGroup> </PropertyGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <ItemGroup>
<HintPath>packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="pcsc-sharp, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL"> </Reference>
<HintPath>packages\PCSC.3.6.0\lib\net40\pcsc-sharp.dll</HintPath> <Reference Include="PCSC, Version=4.2.0.0, Culture=neutral, PublicKeyToken=13b76e54a2ee80a7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\PCSC.4.2.0\lib\net40\PCSC.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="System" /> </Reference>
<Reference Include="System.Configuration" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Configuration" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Data" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.ServiceProcess" />
</ItemGroup> <Reference Include="System.Xml" />
<ItemGroup> </ItemGroup>
<Compile Include="ConfigureService.cs" /> <ItemGroup>
<Compile Include="DataCenterHelper.cs" /> <Compile Include="CardDataPost.cs" />
<Compile Include="Service1.cs"> <Compile Include="ConfigurationManager.cs" />
<SubType>Component</SubType> <Compile Include="ConfigurationProperty.cs" />
</Compile> <Compile Include="ConfigurationType.cs" />
<Compile Include="Service1.Designer.cs"> <Compile Include="ConfigureService.cs" />
<DependentUpon>Service1.cs</DependentUpon> <Compile Include="DataCenterHelper.cs" />
</Compile> <Compile Include="Service1.cs">
<Compile Include="Program.cs" /> <SubType>Component</SubType>
<Compile Include="Properties\AssemblyInfo.cs" /> </Compile>
</ItemGroup> <Compile Include="Service1.Designer.cs">
<ItemGroup> <DependentUpon>Service1.cs</DependentUpon>
<None Include="App.config" /> </Compile>
<None Include="packages.config" /> <Compile Include="Program.cs" />
</ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <ItemGroup>
Other similar extension points exist, see Microsoft.Common.targets. <None Include="App.config" />
<Target Name="BeforeBuild"> <None Include="packages.config" />
</Target> </ItemGroup>
<Target Name="AfterBuild"> <ItemGroup>
</Target> <ProjectReference Include="..\Logger\Logger.csproj">
--> <Project>{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}</Project>
<Name>Logger</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

View File

@ -0,0 +1,38 @@
using System;
using System.Configuration;
using System.Linq;
using System.Reflection;
namespace CardReaderService
{
public class ConfigurationManager
{
public ConfigurationProperty GetConfiguration(string configName)
{
var cfgManager = GetConfigManager();
if (cfgManager.AppSettings.Settings.AllKeys.Contains(configName))
{
var cfg = cfgManager.AppSettings.Settings[configName];
return new ConfigurationProperty
{
Group=string.Empty,
Id="NOTIMPLEMENTED",
Name = cfg.Key,
Value = cfg.Value,
ReadOnly = false,
Source = "CardReaderService",
Type = ConfigurationType.STRING
};
}
return null;
}
private Configuration GetConfigManager()
{
return System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigFilePath);
}
public string ConfigFilePath => new Uri(Assembly.GetEntryAssembly().CodeBase).LocalPath;
}
}

View File

@ -0,0 +1,55 @@
namespace CardReaderService
{
/// <summary>
/// An object used to detail an element that can be configured in the system.
/// </summary>
public class ConfigurationProperty
{
/// <summary>
/// Unique Id for the configuration property.
/// </summary>
public string Id { get; set; }
/// <summary>
/// The display name of the configuration
/// </summary>
public string Name { get; set; }
/// <summary>
/// The group under which this configuration falls (e.g.: TCP Settings - "TCP" or similar.)
/// </summary>
/// <remarks>Application Specific grouping.</remarks>
public string Group { get; set; }
/// <summary>
/// The actual value of the Configuration property
/// </summary>
public string Value { get; set; }
/// <summary>
/// The source of the configuration properties.
/// </summary>
/// <remarks>
/// Using this property allows aggregation of configuration settings
/// by any configuration managers
/// </remarks>
/// <example>{TYPE}.getType().Name (or other suitably unique identifier)</example>
public string Source { get; set; }
/// <summary>
/// The type of the configuration
/// </summary>
/// <remarks>
/// This can be used for UI proofing/validation to ensure a user
/// enters expected format (e.g.: enters a date time for a datetime type)
/// </remarks>
public ConfigurationType Type { get; set; }
/// <summary>
/// Specifies whether the configuration setting can be set by user or is readonly
/// </summary>
public bool ReadOnly { get; set; }
//TODO: in future, add access level, could go read level/edit level
//public UserAccessLevel UserLevel {get;set;}
}
}

View File

@ -0,0 +1,33 @@
namespace CardReaderService
{
/// <summary>
/// The type of the configuration.
/// </summary>
public enum ConfigurationType
{
/// <summary>
/// No Type - shouldnt be used, but default for enum
/// </summary>
NONE,
/// <summary>
/// a string type configuration (could also be used for complex objects, e.g.: a json string/object).
/// </summary>
STRING,
/// <summary>
/// A whole number configuration
/// </summary>
INT,
/// <summary>
/// A number config with a decimal component
/// </summary>
DECIMAL,
/// <summary>
/// A Date Time Configuration
/// </summary>
DATETIME,
/// <summary>
/// A Boolean/TrueFalse configuration property (e.g.: On Off)
/// </summary>
BOOL
}
}

View File

@ -1,36 +1,40 @@
using System; using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Logger;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace CardReaderService namespace CardReaderService
{ {
static class DataCenterHelper static class DataCenterHelper
{ {
static DataCenterHelper()
{
}
public static void Post(CardDataPost postObject, string url) public static void Post(CardDataPost postObject, string url)
{ {
var endpointConfig = ConfigurationManager.AppSettings["DataCenterServiceEndpoint"] ?? var cfgMgr = new ConfigurationManager();
"http://localhost:8800"; //using ConfigurationManager means we can change the value at runtime without having to restart the service.
var endpointConfig = cfgMgr.GetConfiguration("DataCenterServiceEndpoint")?.Value?? "http://localhost:8800";
MessageLogger.Log("Targeting Endpoint: " + endpointConfig);
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
var jsonObject = JsonConvert.SerializeObject(postObject); var jsonObject = JsonConvert.SerializeObject(postObject);
var content = new StringContent(jsonObject, Encoding.UTF8, "application/json"); var content = new StringContent(jsonObject, Encoding.UTF8, "application/json");
try try
{ {
Console.WriteLine("Writing"); MessageLogger.Log("Writing uid: "+ postObject.CardUId + " to the server.");
var fullUrl = endpointConfig + url; var fullUrl = endpointConfig + url;
MessageLogger.Log("Writing to URL: " + fullUrl);
var response = client.PostAsync(fullUrl, content).Result; var response = client.PostAsync(fullUrl, content).Result;
Console.WriteLine("Written"); MessageLogger.Log("Successfully written to server");
} }
catch (Exception) catch (Exception)
{ {
Console.WriteLine("exceptioning"); MessageLogger.Log("Failed to send log to server.");
//ignore
} }
} }
} }
@ -40,9 +44,4 @@ namespace CardReaderService
return Task.Run(() => Post(postObject, url)); return Task.Run(() => Post(postObject, url));
} }
} }
public class CardDataPost
{
public string CardUId { get; set; }
}
} }

View File

@ -1,10 +1,13 @@
using PCSC; using PCSC;
using System; using System;
using System.CodeDom;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.ServiceProcess; using System.ServiceProcess;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using Logger;
using PCSC.Monitoring;
namespace CardReaderService namespace CardReaderService
{ {
@ -12,14 +15,15 @@ namespace CardReaderService
{ {
private Thread _mainWorkThread; private Thread _mainWorkThread;
private bool _stopMainWorkerThread; private bool _stopMainWorkerThread;
private AutoResetEvent _mainWorkerTerminationSignal; private readonly ManualResetEvent _mre;
private string _readerName = "";
private string _readerName = string.Empty;
private SCardMonitor _cardMonitor; private SCardMonitor _cardMonitor;
private bool _initialised=false;
public Service1() public Service1()
{ {
InitializeComponent(); InitializeComponent();
_mre = new ManualResetEvent(false);
} }
public void Start() public void Start()
@ -27,44 +31,54 @@ namespace CardReaderService
OnStart(new string[] { }); OnStart(new string[] { });
} }
protected override void OnStart(string[] args) public new void Stop()
{
StartWorkerThread();
}
private bool WeHaveValidCardReader()
{
if (_cardMonitor == null)
{
return false;
}
Console.WriteLine(_cardMonitor.GetCurrentState(0));
if (_cardMonitor.GetCurrentState(0) == SCRState.Unknown
|| _cardMonitor.GetCurrentState(0) == SCRState.Unavailable
|| _cardMonitor.GetCurrentState(0) == (SCRState.Ignore | SCRState.Unavailable)
//|| _cardMonitor.GetCurrentState(0) == SCRState.Unaware //if we say this is an invalid state, we cause a memory leak where we create a duplicate card monitor, subscribe and overwrite.
)
{
return false;
}
return true;
}
public void Stop()
{ {
OnStop(); OnStop();
base.Stop();
}
protected override void OnStart(string[] args)
{
MessageLogger.Log("Starting.. ");
var ctxFactory = ContextFactory.Instance;
using (var context = ctxFactory.Establish(SCardScope.System))
{
MessageLogger.Log("Getting Card Readers");
var readerNames = context.GetReaders();
if (NoReaderAvailable(readerNames))
{
MessageLogger.Log("No Card Reader available, Exiting..");
}
else
{
MessageLogger.Log("Choosing first available reader: " + readerNames.First());
_readerName = readerNames.First();
_cardMonitor = new SCardMonitor(ctxFactory, SCardScope.System);
_cardMonitor.CardInserted += CardMonitor_CardInserted;
_cardMonitor.StatusChanged += CardMonitorOnStatusChanged;
_cardMonitor.Start(_readerName);
}
StartWorkerThread();
}
} }
protected override void OnStop() protected override void OnStop()
{ {
MessageLogger.Log("Stopping..");
_stopMainWorkerThread = true; _stopMainWorkerThread = true;
_mainWorkerTerminationSignal.Set(); _mre.Set();
if (_mainWorkThread != null && _mainWorkThread.IsAlive) if (_mainWorkThread != null && _mainWorkThread.IsAlive)
{ {
_mainWorkThread.Interrupt(); _mainWorkThread.Join(3000);
if (_mainWorkThread.IsAlive)
{
_mainWorkThread.Interrupt();
}
} }
if (_cardMonitor != null) if (_cardMonitor != null)
{ {
_cardMonitor.CardInserted -= CardMonitor_CardInserted;
_cardMonitor.StatusChanged -= CardMonitorOnStatusChanged;
_cardMonitor.Cancel(); _cardMonitor.Cancel();
_cardMonitor.Dispose(); _cardMonitor.Dispose();
_cardMonitor = null; _cardMonitor = null;
@ -79,96 +93,110 @@ namespace CardReaderService
Name = "CardServiceMainThread", Name = "CardServiceMainThread",
IsBackground = false IsBackground = false
}; };
_mainWorkerTerminationSignal = new AutoResetEvent(false);
_mainWorkThread.Start(); _mainWorkThread.Start();
} }
private void _cardMonitor_CardInserted(object sender, CardStatusEventArgs e) private void CardMonitor_CardInserted(object sender, CardStatusEventArgs e)
{ {
var ctxFac = ContextFactory.Instance; try
using (var ctx = ctxFac.Establish(SCardScope.System))
{ {
var reader = new SCardReader(ctx); var ctxFac = ContextFactory.Instance;
var pioSendPci = new IntPtr(); using (var ctx = ctxFac.Establish(SCardScope.System))
byte[] rcvBuffer = new byte[256];
if (_readerName == string.Empty)
{ {
Console.WriteLine("Reader name is somehow empty... WTF!"); var reader = new SCardReader(ctx);
_stopMainWorkerThread = true; byte[] rcvBuffer = new byte[256];
return;
}
var err = reader.Connect(_readerName, SCardShareMode.Shared, SCardProtocol.T0 | SCardProtocol.T1); if (_readerName == string.Empty)
{
MessageLogger.Log("Reader name is somehow empty... WTF!");
_stopMainWorkerThread = true;
return;
}
if (err == SCardError.Success) var err = reader.Connect(_readerName, SCardShareMode.Shared, SCardProtocol.Any);
{
var uIdcmd = new byte[] { 0xFF, 0xCA, 0x00, 0x00, 0x00 };
err = reader.Transmit(pioSendPci, uIdcmd, ref rcvBuffer);
if (err == SCardError.Success) if (err == SCardError.Success)
{ {
var uid = ConvertByteUIDToString(rcvBuffer); var pci = SCardPCI.GetPci(reader.ActiveProtocol);
var atrString = ConvertByteUIDToString(e.Atr);
Console.WriteLine("Card Inserted, ATR: " + atrString + ", and UID is: " + uid);
CardDataPost postObj = new CardDataPost { CardUId = uid }; err = reader.Transmit(pci, CardCommands.GetUid, ref rcvBuffer);
DataCenterHelper.PostAsync(postObj, "/api/swipedata");
Console.WriteLine("Posted to Server"); if (err == SCardError.Success)
{
var uid = ConvertByteUIDToString(rcvBuffer);
var atrString = ConvertByteUIDToString(e.Atr);
MessageLogger.Log("Card Inserted, ATR: " + atrString + ", and UID is: " + uid);
CardDataPost postObj = new CardDataPost { CardUId = uid, UtcTimeStamp = DateTime.UtcNow };
DataCenterHelper.PostAsync(postObj, "/api/swipedata");
MessageLogger.Log("Posted to Server");
}
else
{
MessageLogger.Log("Failed to Read UID, Error: " + err);
}
}
else
{
MessageLogger.Log("Reader failed to connect, error: " + Enum.GetName(typeof(SCardError), err));
} }
} }
else }
{ catch (Exception ex)
Console.WriteLine("Reader failed to connect, error: " + Enum.GetName(typeof(SCardError), err)); {
} MessageLogger.Log("Exception has occurred in Card Inserted Event handler. Exception: "+ ex);
throw;
} }
} }
private void MainWorkerThread() private void MainWorkerThread()
{ {
var minimumLoopTimemS = 5000;
while (!_stopMainWorkerThread) while (!_stopMainWorkerThread)
{ {
if (!WeHaveValidCardReader()) if (_cardMonitor == null)
{ //only do this if we don't have a valid card reader {
if (_initialised)
{
//card reader no longer available, tidy up.
_cardMonitor.Cancel();
_cardMonitor.CardInserted -= _cardMonitor_CardInserted;
_cardMonitor.Dispose();
_cardMonitor = null;
_initialised = false;
}
Console.WriteLine("Starting.. Getting available readers");
var ctxFactory = ContextFactory.Instance; var ctxFactory = ContextFactory.Instance;
using (var context = ctxFactory.Establish(SCardScope.System)) using (var context = ctxFactory.Establish(SCardScope.System))
{ {
var readerNames = context.GetReaders(); var readerNames = context.GetReaders();
if (!NoReaderAvailable(readerNames)) if (NoReaderAvailable(readerNames))
{ {
//we have a reader available, so initialise! MessageLogger.Log("No Card Reader available, Waiting..");
Console.WriteLine("Choosing first available reader: " + readerNames.First());
_readerName = readerNames.First();
_cardMonitor = new SCardMonitor(ctxFactory, SCardScope.System);
_cardMonitor.CardInserted += _cardMonitor_CardInserted;
_cardMonitor.Start(_readerName);
_initialised = true;
} }
else else
{ {
Console.WriteLine("No Card Reader is available.."); MessageLogger.Log("Choosing first available reader: " + readerNames.First());
_readerName = readerNames.First();
_cardMonitor = new SCardMonitor(ctxFactory, SCardScope.System);
_cardMonitor.CardInserted += CardMonitor_CardInserted;
_cardMonitor.StatusChanged += CardMonitorOnStatusChanged;
_cardMonitor.Start(_readerName);
} }
} }
} }
_mainWorkerTerminationSignal.WaitOne(3000); //dont actually need to do anything.. but cannot exit right away?
_mre.WaitOne(minimumLoopTimemS);
}
}
private void CardMonitorOnStatusChanged(object sender, StatusChangeEventArgs e)
{
if ((e.NewState & SCRState.Unavailable) == SCRState.Unavailable && (e.NewState & SCRState.Ignore) == SCRState.Ignore)
{
Console.WriteLine("Card Reader Disconnected");
_cardMonitor.CardInserted -= CardMonitor_CardInserted;
_cardMonitor.Cancel();
_cardMonitor.Dispose();
_cardMonitor = null;
_readerName = string.Empty;
} }
} }
private string ConvertByteUIDToString(byte[] uid) private string ConvertByteUIDToString(byte[] uid)
{ {
var sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
foreach (var b in uid) foreach (var b in uid)
{ {
@ -183,4 +211,9 @@ namespace CardReaderService
return readerNames == null || readerNames.Count < 1; return readerNames == null || readerNames.Count < 1;
} }
} }
internal class CardCommands
{
public static readonly byte[] GetUid = {0xFF, 0xCA, 0x00, 0x00, 0x08};
}
} }

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
<package id="PCSC" version="3.6.0" targetFramework="net452" /> <package id="PCSC" version="4.2.0" targetFramework="net45" />
</packages> </packages>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup> </startup>
</configuration> </configuration>

View File

@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderServiceHost</RootNamespace> <RootNamespace>CardReaderServiceHost</RootNamespace>
<AssemblyName>CardReaderServiceHost</AssemblyName> <AssemblyName>CardReaderServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -33,8 +34,8 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\CardReaderService\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@ -52,6 +53,18 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\CardReaderService.conf">
<Link>CardReaderService.conf</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\install.sh">
<Link>install.sh</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\uninstall.sh">
<Link>uninstall.sh</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="App.config" /> <None Include="App.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>

View File

@ -9,7 +9,7 @@ namespace CardReaderServiceHost
{ {
Service1 service1 = new Service1(); Service1 service1 = new Service1();
service1.Start(); service1.Start();
Console.WriteLine("Service Running..."); Console.WriteLine("Service Running... Enter To Stop");
Console.ReadLine(); Console.ReadLine();
service1.Stop(); service1.Stop();
} }

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
</packages> </packages>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Logger</RootNamespace>
<AssemblyName>Logger</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MessageLogger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Logger
{
public class MessageLogger
{
private static string _logPath = "log.txt";
public static void Log(string message)
{
Console.WriteLine(message);
File.AppendAllText(_logPath, string.Format("{0} | {1}{2}", DateTime.Now, message, Environment.NewLine));
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Logger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Logger")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("42efe386-dc2e-455a-ba81-5fc9cee45d02")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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")]

View File

@ -0,0 +1,7 @@
install:
- pcscd
- supervisor
- mono-complete
copy CardReaderService.conf to /home/osboxes/CardReaderService

View File

@ -0,0 +1,25 @@
#!/bin/sh
if [ -z "$1" ]
then
echo "No arguments supplied, supply the base path"
fi
echo "Installing dependencies"
apt-get install mono-complete pcscd supervisor -y
echo "Modifying supervisor conf file"
sed -i "s|/DIRECTORYTOSET|$1|g" CardReaderService.conf
echo "Installing service configuration file"
cp CardReaderService.conf /etc/supervisor/conf.d/
echo "Installing applicaton"
mkdir $1/CardReaderService
cp ./*.* $1/CardReaderService
cd $1/CardReaderService
rm *.pdb
rm *.vshost.exe
rm *.vshost.exe.config
rm *.vshost.exe.manifest
echo "Starting application........."
service supervisor restart

View File

@ -0,0 +1,12 @@
#!/bin/sh
if [ -z "$1" ]
then
echo "No arguments supplied, supply the base path"
fi
echo "Stopping service...."
service supervisor stop
rm -f /etc/supervisor/conf.d/CardReaderService.conf
echo "Removing Application.."
rm -r -f $1/CardReaderService
echo "Removing application dependencies.."
apt-get remove pcscd supervisor mono-complete -y

View File

@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
<appSettings> <appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml"/> <add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DataCenterServiceEndpoint" value="http://localhost:8800"/> <add key="DataCenterServiceEndpoint" value="http://localhost:8800" />
</appSettings> </appSettings>
</configuration> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -1,125 +1,127 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid> <ProjectGuid>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderService</RootNamespace> <RootNamespace>CardReaderService</RootNamespace>
<AssemblyName>CardReaderService</AssemblyName> <AssemblyName>CardReaderService</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup> <TargetFrameworkProfile />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> </PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>full</DebugType> <DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize> <DebugType>full</DebugType>
<OutputPath>bin\Debug\</OutputPath> <Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants> <OutputPath>bin\Debug\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> </PropertyGroup>
<PlatformTarget>AnyCPU</PlatformTarget> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget>
<Optimize>true</Optimize> <DebugType>pdbonly</DebugType>
<OutputPath>bin\Release\</OutputPath> <Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants> <OutputPath>bin\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> </PropertyGroup>
<DebugSymbols>true</DebugSymbols> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<OutputPath>bin\DebugInstallers\</OutputPath> <DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants> <OutputPath>bin\DebugInstallers\</OutputPath>
<DebugType>full</DebugType> <DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>AnyCPU</PlatformTarget> <DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> <Prefer32Bit>true</Prefer32Bit>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> </PropertyGroup>
<OutputPath>bin\ReleaseInstallers\</OutputPath> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<DefineConstants>TRACE</DefineConstants> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<Optimize>true</Optimize> <DefineConstants>TRACE</DefineConstants>
<DebugType>pdbonly</DebugType> <Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> <Prefer32Bit>true</Prefer32Bit>
<ItemGroup> </PropertyGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <ItemGroup>
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath> <Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Extensions.Xml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Extensions.Xml.3.2.0.0\lib\net45-full\Ninject.Extensions.Xml.dll</HintPath> <Reference Include="Ninject.Extensions.Xml, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Extensions.Xml.3.3.0\lib\net45\Ninject.Extensions.Xml.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="pcsc-sharp, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\PCSC.3.6.0\lib\net40\pcsc-sharp.dll</HintPath> <Reference Include="pcsc-sharp, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\PCSC.3.6.0\lib\net40\pcsc-sharp.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="System" /> </Reference>
<Reference Include="System.Configuration" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Configuration" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Data" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.ServiceProcess" />
</ItemGroup> <Reference Include="System.Xml" />
<ItemGroup> </ItemGroup>
<Compile Include="Configuration.cs" /> <ItemGroup>
<Compile Include="ConfigureService.cs" /> <Compile Include="Configuration.cs" />
<Compile Include="DataCenterHelper.cs" /> <Compile Include="ConfigureService.cs" />
<Compile Include="DefaultComponents\DefaultLogger.cs" /> <Compile Include="DataCenterHelper.cs" />
<Compile Include="NinjectHelper.cs" /> <Compile Include="DefaultComponents\DefaultLogger.cs" />
<Compile Include="CardReaderService.cs"> <Compile Include="DefaultComponents\LogFileLogger.cs" />
<SubType>Component</SubType> <Compile Include="NinjectHelper.cs" />
</Compile> <Compile Include="CardReaderService.cs">
<Compile Include="CardReaderService.Designer.cs"> <SubType>Component</SubType>
<DependentUpon>CardReaderService.cs</DependentUpon> </Compile>
</Compile> <Compile Include="CardReaderService.Designer.cs">
<Compile Include="Program.cs" /> <DependentUpon>CardReaderService.cs</DependentUpon>
<Compile Include="Properties\AssemblyInfo.cs" /> </Compile>
</ItemGroup> <Compile Include="Program.cs" />
<ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" />
<None Include="App.config" /> </ItemGroup>
<None Include="packages.config" /> <ItemGroup>
</ItemGroup> <None Include="App.config" />
<ItemGroup> <None Include="packages.config" />
<ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj"> </ItemGroup>
<Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project> <ItemGroup>
<Name>ConfigurationHandler</Name> <ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj">
</ProjectReference> <Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project>
<ProjectReference Include="..\Interfaces\Interfaces.csproj"> <Name>ConfigurationHandler</Name>
<Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project> </ProjectReference>
<Name>Interfaces</Name> <ProjectReference Include="..\Interfaces\Interfaces.csproj">
</ProjectReference> <Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project>
</ItemGroup> <Name>Interfaces</Name>
<ItemGroup> </ProjectReference>
<Content Include="NinjectConfig.xml"> </ItemGroup>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <ItemGroup>
</Content> <Content Include="NinjectConfig.xml">
</ItemGroup> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Interfaces;
namespace CardReaderService.DefaultComponents
{
class LogFileLogger: ILogger
{
public bool IsDebugEnabled => true;
public bool IsErrorEnabled => true;
public bool IsFatalEnabled => true;
public bool IsInfoEnabled => true;
public bool IsTraceEnabled => true;
public bool IsWarnEnabled => true;
public void Debug(Exception exception)
{
Log(exception.ToString());
}
public void Debug(string format, params object[] args)
{
Log(string.Format(format, args));
}
public void Debug(Exception exception, string format, params object[] args)
{
Log(exception.ToString());
Log(string.Format(format, args));
}
public void Error(Exception exception)
{
Log(exception.ToString());
}
public void Error(string format, params object[] args)
{
Log(string.Format(format, args));
}
public void Error(Exception exception, string format, params object[] args)
{
Log(exception.ToString());
Log(string.Format(format, args));
}
public void Fatal(Exception exception)
{
Log(exception.ToString());
}
public void Fatal(string format, params object[] args)
{
Log(string.Format(format, args));
}
public void Fatal(Exception exception, string format, params object[] args)
{
Log(exception.ToString());
Log(string.Format(format, args));
}
public void Info(Exception exception)
{
Log(exception.ToString());
}
public void Info(string format, params object[] args)
{
Log(string.Format(format, args));
}
public void Info(Exception exception, string format, params object[] args)
{
Log(exception.ToString());
Log(string.Format(format, args));
}
public void Trace(Exception exception)
{
Log(exception.ToString());
}
public void Trace(string format, params object[] args)
{
Log(string.Format(format, args));
}
public void Trace(Exception exception, string format, params object[] args)
{
Log(exception.ToString());
Log(string.Format(format, args));
}
public void Warn(Exception exception)
{
Log(exception.ToString());
}
public void Warn(string format, params object[] args)
{
Log(string.Format(format, args));
}
public void Warn(Exception exception, string format, params object[] args)
{
Log(exception.ToString());
Log(string.Format(format, args));
}
private static string _logPath = "log.txt";
public static void Log(string message)
{
System.IO.File.WriteAllText(_logPath, string.Format("{0} | {1}", DateTime.Now, message));
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<module name="NinjectAssemblies"> <module name="NinjectAssemblies">
<bind service="Interfaces.ILogger, Interfaces" <bind service="Interfaces.ILogger, Interfaces"
to="NLogLogger.NLogger, NLogLogger" scope="singleton" /> to="CardReaderService.DefaultComponents.LogFileLogger, CardReaderService" scope="singleton" />
</module> </module>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="Ninject" version="3.2.2.0" targetFramework="net452" /> <package id="Ninject" version="3.3.4" targetFramework="net45" />
<package id="Ninject.Extensions.Xml" version="3.2.0.0" targetFramework="net452" /> <package id="Ninject.Extensions.Xml" version="3.3.0" targetFramework="net45" />
<package id="PCSC" version="3.6.0" targetFramework="net452" /> <package id="PCSC" version="3.6.0" targetFramework="net45" />
</packages> </packages>

View File

@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
<appSettings> <appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml"/> <add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DataCenterServiceEndpoint" value="http://localhost:1234"/> <add key="DataCenterServiceEndpoint" value="http://localhost:1234" />
</appSettings> </appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>

View File

@ -1,101 +1,101 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}</ProjectGuid> <ProjectGuid>{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderServiceHost</RootNamespace> <RootNamespace>CardReaderServiceHost</RootNamespace>
<AssemblyName>CardReaderServiceHost</AssemblyName> <AssemblyName>CardReaderServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath> <OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\CardReaderService\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CardReaderService\CardReaderService.csproj"> <ProjectReference Include="..\CardReaderService\CardReaderService.csproj">
<Project>{5f30e8e4-5107-4c99-adff-38d735dc113d}</Project> <Project>{5f30e8e4-5107-4c99-adff-38d735dc113d}</Project>
<Name>CardReaderService</Name> <Name>CardReaderService</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>mkdir "$(TargetDir)Configs" <PostBuildEvent>mkdir "$(TargetDir)Configs"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)" copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)" copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)" copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\" copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"</PostBuildEvent> copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
</packages> </packages>

View File

@ -30,8 +30,18 @@
<Component Id="SmartCardServiceConfig" Guid="{73D2E31D-F256-457C-AFD5-EC456CDAD7E8}" KeyPath="yes"> <Component Id="SmartCardServiceConfig" Guid="{73D2E31D-F256-457C-AFD5-EC456CDAD7E8}" KeyPath="yes">
<ServiceControl Id="SmartCardServiceStarter" <ServiceControl Id="SmartCardServiceStarter"
Start="install" Start="install"
Stop="install"
Name="SCardSvr" Name="SCardSvr"
Wait="yes" /> Wait="yes" />
<ServiceConfig Id="SmartCardServiceSetToAuto"
DelayedAutoStart="0" OnInstall="yes" ServiceName="SCardSvr"/>
</Component>
<Component Id="SCardAutoStart" Permanent="yes" KeyPath="yes" Guid="{75582D3C-C985-4BC9-A0A8-621A52C7E95E}">
<RegistryKey Root="HKLM"
Key="SYSTEM\CurrentControlSet\Services\SCardSvr"
Action="create">
<RegistryValue Type="integer" Name="Start" Value="2"/>
</RegistryKey>
</Component> </Component>
<Component Id="CardReaderServiceExe" Guid="{24C9D834-21E2-476D-8302-EF35730D0BA8}"> <Component Id="CardReaderServiceExe" Guid="{24C9D834-21E2-476D-8302-EF35730D0BA8}">
<File Id="CardReaderService.exe" <File Id="CardReaderService.exe"
@ -61,6 +71,7 @@
ThirdFailureActionType="restart" ThirdFailureActionType="restart"
ResetPeriodInDays="1" ResetPeriodInDays="1"
RestartServiceDelayInSeconds="10" /> RestartServiceDelayInSeconds="10" />
<ServiceDependency Id="SCardSvr" Group="no"/>
</ServiceInstall> </ServiceInstall>
</Component> </Component>
<Component Id="CardReaderServiceExeConfig" Guid="{E20D23BC-C8E7-49F8-962C-DE856A84258E}"> <Component Id="CardReaderServiceExeConfig" Guid="{E20D23BC-C8E7-49F8-962C-DE856A84258E}">

View File

@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConfigurationHandler</RootNamespace> <RootNamespace>ConfigurationHandler</RootNamespace>
<AssemblyName>ConfigurationHandler</AssemblyName> <AssemblyName>ConfigurationHandler</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>

View File

@ -1,114 +1,120 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace Interfaces namespace Interfaces
{ {
public interface IRepository public interface IRepository
{ {
/// <summary> /// <summary>
/// Get a list of Users /// Get a list of Users
/// </summary> /// </summary>
/// <returns> /// <returns>
/// Returns <see cref="UserList"/> with full list of users, /// Returns <see cref="UserList"/> with full list of users,
/// plus a total user count. Pagination options are supported. /// plus a total user count. Pagination options are supported.
/// </returns> /// </returns>
UserList GetUsers(int pageNumber = -1, int pageSize = -1, int groupId = -1); UserList GetUsers(int pageNumber = -1, int pageSize = -1, int groupId = -1, SortOptions sort = SortOptions.None);
/// <summary> /// <summary>
/// Search the user list for the following string /// Search the user list for the following string
/// </summary> /// </summary>
/// <param name="searchParam">string to search the user store for.</param> /// <param name="searchParam">string to search the user store for.</param>
/// <returns> /// <returns>
/// Returns <see cref="UserList"/> with full list of users, /// Returns <see cref="UserList"/> with full list of users,
/// plus a total user count. Pagination options are supported. /// plus a total user count. Pagination options are supported.
/// </returns> /// </returns>
UserList Search(string searchParam); UserList Search(string searchParam);
/// <summary> /// <summary>
/// Get details about a single user in the system base on their Id /// Get details about a single user in the system base on their Id
/// </summary> /// </summary>
/// <param name="id"> /// <param name="id">
/// integer data type, the Id of the User to get details about.</param> /// integer data type, the Id of the User to get details about.</param>
/// <returns> /// <returns>
/// <see cref="User"/> object with full details, /// <see cref="User"/> object with full details,
/// including full <see cref="Identifier"/> /// including full <see cref="Identifier"/>
/// </returns> /// </returns>
User GetUser(int id); User GetUser(int id);
/// <summary> /// <summary>
/// Get a list of the timelogs available for the specified user /// Get a list of the timelogs available for the specified user
/// for the current Calendar Week /// for the current Calendar Week
/// </summary> /// </summary>
/// <param name="userId"> /// <param name="userId">
/// integer data type, the Id of the user to get time logs for /// integer data type, the Id of the user to get time logs for
/// </param> /// </param>
/// <returns> /// <returns>
/// <see cref="TimeLogList"/> with nested <see cref="TimeLog"/> objects /// <see cref="TimeLogList"/> with nested <see cref="TimeLog"/> objects
/// for the current calendar week /// for the current calendar week
/// </returns> /// </returns>
TimeLogList GetTimeLogs(int userId); TimeLogList GetTimeLogs(int userId);
/// <summary> /// <summary>
/// Get a list of the timelogs available for the specified user /// Get a list of the timelogs available for the specified user
/// for the specified calendar week /// for the specified calendar week
/// </summary> /// </summary>
/// <param name="userId"> /// <param name="userId">
/// integer data type, the Id of the user to get time logs for /// integer data type, the Id of the user to get time logs for
/// </param> /// </param>
/// <param name="selectedDate"> /// <param name="selectedDate">
/// datetime data type, the date to receive time logs for (will scope out to calendar week). /// datetime data type, the date to receive time logs for (will scope out to calendar week).
/// </param> /// </param>
/// <returns> /// <returns>
/// <see cref="TimeLogList"/> with nested <see cref="TimeLog"/> objects /// <see cref="TimeLogList"/> with nested <see cref="TimeLog"/> objects
/// for the current calendar week /// for the current calendar week
/// </returns> /// </returns>
TimeLogList GetTimeLogs(int userId, DateTime selectedDate); TimeLogList GetTimeLogs(int userId, DateTime selectedDate);
/// <summary> /// <summary>
/// Get a full list of Identifiers which are not associated to a user. /// Get a full list of Identifiers which are not associated to a user.
/// </summary> /// </summary>
/// <returns> /// <returns>
/// <see cref="IdentifierList"/> with nested <see cref="Identifier"/> list /// <see cref="IdentifierList"/> with nested <see cref="Identifier"/> list
/// </returns> /// </returns>
IdentifierList GetUnassignedIdentifierList(); IdentifierList GetUnassignedIdentifierList();
/// <summary> /// <summary>
/// Remove all unassigned identifiers from the system. /// Remove all unassigned identifiers from the system.
/// </summary> /// </summary>
void ClearUnassignedIdentifiers(); void ClearUnassignedIdentifiers();
/// <summary> /// <summary>
/// Update a user in the system with the new values. /// Update a user in the system with the new values.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// If the user object passed does not exist, it will be created. /// If the user object passed does not exist, it will be created.
/// </remarks> /// </remarks>
/// <param name="user"> /// <param name="user">
/// <see cref="User"/> object detailing the new properties to assign to the user. /// <see cref="User"/> object detailing the new properties to assign to the user.
/// The Id Field should not be changed, or should be -1 for new users. /// The Id Field should not be changed, or should be -1 for new users.
/// </param> /// </param>
/// <param name="userId"> /// <param name="userId">
/// int - ref param, value will be the UserId of the inserted or updated user /// int - ref param, value will be the UserId of the inserted or updated user
/// </param> /// </param>
/// <returns> /// <returns>
/// <see cref="OperationResponse"/> to indicate procedure status. /// <see cref="OperationResponse"/> to indicate procedure status.
/// </returns> /// </returns>
OperationResponse UpdateUser(User user, out int userId); OperationResponse UpdateUser(User user, out int userId);
/// <summary> /// <summary>
/// Create a new TimeLog Event in the repository. /// Create a new TimeLog Event in the repository.
/// </summary> /// </summary>
/// <param name="identifier"> /// <param name="identifier">
/// <see cref="Identifier"/> object with the Unique Id triggering the event /// <see cref="Identifier"/> object with the Unique Id triggering the event
/// </param> /// </param>
/// <param name="logId">The resultant Id of the inserted TimeLog</param> /// <param name="logId">The resultant Id of the inserted TimeLog</param>
/// <returns> /// <param name="logTime">Optional - To set the log time of the swipe.
/// <see cref="OperationResponse"/> to indicate procedure status. /// <remarks>Particularly useful for buffering logs in nodes if they cannot contact server for whatever reason to minimise data loss</remarks></param>
/// </returns> /// <returns>
LogEventResponse LogEventTime(Identifier identifier, out int logId); /// <see cref="OperationResponse"/> to indicate procedure status.
/// </returns>
OperationResponse CreateGroup(Group group, out int groupId); LogEventResponse LogEventTime(Identifier identifier, out int logId, DateTime logTime = default(DateTime));
List<Group> GetGroups(int userId = -1);
Group GetGroup(int groupId); OperationResponse CreateGroup(Group group, out int groupId);
OperationResponse UpdateGroup(Group group); List<Group> GetGroups(int userId = -1);
OperationResponse DeleteGroup(int groupId); Group GetGroup(int groupId);
OperationResponse UpdateGroup(Group group);
OperationResponse DeleteLog(TimeLog log); OperationResponse DeleteGroup(int groupId);
OperationResponse CreateLog(TimeLog log);
OperationResponse UpdateLog(TimeLog log); OperationResponse DeleteLog(TimeLog log);
} OperationResponse CreateLog(TimeLog log);
} OperationResponse UpdateLog(TimeLog log);
Policy GetPolicy();
void SavePolicy(Policy policy);
}
}

View File

@ -1,86 +1,89 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B7347B72-E208-423A-9D99-723B558EA3D7}</ProjectGuid> <ProjectGuid>{B7347B72-E208-423A-9D99-723B558EA3D7}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Interfaces</RootNamespace> <RootNamespace>Interfaces</RootNamespace>
<AssemblyName>Interfaces</AssemblyName> <AssemblyName>Interfaces</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> <TargetFrameworkProfile />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> </PropertyGroup>
<DebugSymbols>true</DebugSymbols> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType> <DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize> <DebugType>full</DebugType>
<OutputPath>bin\Debug\</OutputPath> <Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants> <OutputPath>bin\Debug\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> </PropertyGroup>
<DebugType>pdbonly</DebugType> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize> <DebugType>pdbonly</DebugType>
<OutputPath>bin\Release\</OutputPath> <Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants> <OutputPath>bin\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport> <DefineConstants>TRACE</DefineConstants>
<WarningLevel>4</WarningLevel> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <WarningLevel>4</WarningLevel>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> </PropertyGroup>
<DebugSymbols>true</DebugSymbols> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<OutputPath>bin\DebugInstallers\</OutputPath> <DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants> <OutputPath>bin\DebugInstallers\</OutputPath>
<DebugType>full</DebugType> <DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>AnyCPU</PlatformTarget> <DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> </PropertyGroup>
<OutputPath>bin\ReleaseInstallers\</OutputPath> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<DefineConstants>TRACE</DefineConstants> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<Optimize>true</Optimize> <DefineConstants>TRACE</DefineConstants>
<DebugType>pdbonly</DebugType> <Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType>
<ErrorReport>prompt</ErrorReport> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<ItemGroup> </PropertyGroup>
<Reference Include="System" /> <ItemGroup>
<Reference Include="System.Core" /> <Reference Include="System" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Net.Http" />
</ItemGroup> <Reference Include="System.Xml" />
<ItemGroup> </ItemGroup>
<Compile Include="AppDetails.cs" /> <ItemGroup>
<Compile Include="DailyLogs.cs" /> <Compile Include="AppDetails.cs" />
<Compile Include="EventLogResponse.cs" /> <Compile Include="DailyLogs.cs" />
<Compile Include="Group.cs" /> <Compile Include="EventLogResponse.cs" />
<Compile Include="GroupList.cs" /> <Compile Include="Group.cs" />
<Compile Include="ILogger.cs" /> <Compile Include="GroupList.cs" />
<Compile Include="IRepository.cs" /> <Compile Include="ILogger.cs" />
<Compile Include="Identifier.cs" /> <Compile Include="IRepository.cs" />
<Compile Include="IdentifierList.cs" /> <Compile Include="Identifier.cs" />
<Compile Include="ManualLog.cs" /> <Compile Include="IdentifierList.cs" />
<Compile Include="OperationResponse.cs" /> <Compile Include="ManualLog.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="OperationResponse.cs" />
<Compile Include="TimeLog.cs" /> <Compile Include="Policy.cs" />
<Compile Include="TimeLogList.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="User.cs" /> <Compile Include="SortOptions.cs" />
<Compile Include="UserList.cs" /> <Compile Include="TimeLog.cs" />
</ItemGroup> <Compile Include="TimeLogList.cs" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Compile Include="User.cs" />
<Compile Include="UserList.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Interfaces
{
public class Policy
{
public DateTime ChangeDate { get; set; }
public string ChangeDescription { get; set; }
public string ChangeAuthor { get; set; }
public string Version { get; set; }
public string Markdown { get; set; }
public string Html { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Interfaces
{
public enum SortOptions
{
None,
FirstNameAscending,
FirstNameDescending,
LastNameAscending,
LastNameDescending,
}
}

View File

@ -1,30 +1,33 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
namespace Interfaces
{ namespace Interfaces
public class UserList {
{ public class UserList
public UserList() {
{ public UserList()
Users = new List<User>(); {
PageSize = 10; Users = new List<User>();
} PageSize = 10;
public string Query { get; set; } }
public int UserCount { get { return Users.Count; } } public string Query { get; set; }
public int TotalUserCount { get; set; } public int UserCount { get { return Users.Count; } }
public List<User> Users { get; set; } public int TotalUserCount { get; set; }
public List<User> Users { get; set; }
public int PageCount
{ public SortOptions SelectedSortOption { get; set; }
get
{ public int PageCount
if (TotalUserCount < PageSize) {
return 1; get
return (TotalUserCount / PageSize); {
} if (TotalUserCount < PageSize)
} return 1;
public Group GroupFilter { get; set; } return (int)Math.Ceiling(Convert.ToDouble(TotalUserCount) / Convert.ToDouble(PageSize));
public int PageSize { get; set; } }
public int PageNumber { get; set; } }
} public Group GroupFilter { get; set; }
public int PageSize { get; set; }
public int PageNumber { get; set; }
}
} }

View File

@ -1,96 +1,96 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}</ProjectGuid> <ProjectGuid>{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NLogLogger</RootNamespace> <RootNamespace>NLogLogger</RootNamespace>
<AssemblyName>NLogLogger</AssemblyName> <AssemblyName>NLogLogger</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath> <OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.2\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.4.2\lib\net45\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="NLogger.cs" /> <Compile Include="NLogger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj"> <ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj">
<Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project> <Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project>
<Name>ConfigurationHandler</Name> <Name>ConfigurationHandler</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Interfaces\Interfaces.csproj"> <ProjectReference Include="..\Interfaces\Interfaces.csproj">
<Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project> <Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project>
<Name>Interfaces</Name> <Name>Interfaces</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="NLogConfig.xml"> <Content Include="NLogConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.4.2" targetFramework="net452" /> <package id="NLog" version="4.4.2" targetFramework="net452" />
</packages> </packages>

View File

@ -0,0 +1,29 @@
using Interfaces;
namespace SQLiteRepository.Converters
{
static class IdentifierConverter
{
public static Identifier ConvertToIdentifierDto(CardUniqueId ident)
{
return new Identifier
{
Id = ident.Id,
UniqueId = ident.CardUId,
IsAssociatedToUser = ident.UserId_FK != Constants.UNASSIGNED_CARD_USER_ID,
LastUsed = ident.LastUsed.DateTime
};
}
public static CardUniqueId ConvertFromIdentifierDto(Identifier ident, int userId)
{
return new CardUniqueId
{
CardUId = ident.UniqueId,
Id = ident.Id,
UserId_FK = userId,
LastUsed = ident.LastUsed
};
}
}
}

View File

@ -0,0 +1,51 @@
using Interfaces;
namespace SQLiteRepository.Converters
{
static class LogDirectionConverter
{
public static LogDirection ConvertToLogDirectionDto(LogDirectionDb direction)
{
switch (direction)
{
case LogDirectionDb.IN:
return LogDirection.IN;
case LogDirectionDb.OUT:
return LogDirection.OUT;
default:
return LogDirection.UNKNOWN;
}
}
public static LogDirectionDb ConvertFromLogDirectionDto(LogDirection direction)
{
switch (direction)
{
case LogDirection.IN:
return LogDirectionDb.IN;
case LogDirection.OUT:
return LogDirectionDb.OUT;
default:
return LogDirectionDb.UNKNOWN;
}
}
public static LogDirectionDb InvertLogDirectionDb(LogDirectionDb direction)
{
return (LogDirectionDb)(int)InvertLogDirection((LogDirection)(int)direction);
}
public static LogDirection InvertLogDirection(LogDirection direction)
{
switch (direction)
{
case LogDirection.IN:
return LogDirection.OUT;
case LogDirection.OUT:
return LogDirection.IN;
default:
return LogDirection.UNKNOWN;
}
}
}
}

View File

@ -0,0 +1,37 @@
using Interfaces;
namespace SQLiteRepository.Converters
{
static class LogSourceConverter
{
public static LogSource ConvertToLogSourceDto(LogSourceDb source)
{
switch (source)
{
case LogSourceDb.IDENTIFIER:
return LogSource.IDENTIFIER;
case LogSourceDb.TRAYAPP:
return LogSource.TRAYAPP;
case LogSourceDb.UI:
return LogSource.UI;
default:
return LogSource.UNKNOWN;
}
}
public static LogSourceDb ConvertFromLogSourceDto(LogSource source)
{
switch (source)
{
case LogSource.IDENTIFIER:
return LogSourceDb.IDENTIFIER;
case LogSource.TRAYAPP:
return LogSourceDb.TRAYAPP;
case LogSource.UI:
return LogSourceDb.UI;
default:
return LogSourceDb.UNKNOWN;
}
}
}
}

View File

@ -0,0 +1,35 @@
using Interfaces;
namespace SQLiteRepository.Converters
{
static class PolicyConverter
{
public static Policy ConvertToPolicyDto(PolicyDb policyDb)
{
if (policyDb == null) return null;
return new Policy
{
ChangeDescription = policyDb.ChangeDescription,
ChangeDate = policyDb.ChangeDate.UtcDateTime,
Html = policyDb.Html,
Version = policyDb.Version,
ChangeAuthor = policyDb.ChangeAuthor,
Markdown = policyDb.Markdown
};
}
public static PolicyDb ConvertFromPolicyDto(Policy policy)
{
if (policy == null) return null;
return new PolicyDb
{
ChangeDescription = policy.ChangeDescription,
ChangeDate = policy.ChangeDate,
Html = policy.Html,
Version = policy.Version,
ChangeAuthor = policy.ChangeAuthor,
Markdown = policy.Markdown
};
}
}
}

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Interfaces;
namespace SQLiteRepository.Converters
{
static class TimeLogConverter
{
public static TimeLog ConvertToTimeLogDto(TimeLogDb log)
{
return new TimeLog
{
CalendarWeek = log.CalendarWeek,
Direction = LogDirectionConverter.ConvertToLogDirectionDto(log.Direction),
EventTime = log.SwipeEventDateTime,
Id = log.Id,
IdentifierId = log.IdentifierId,
UserId = log.UserId_FK,
Source = LogSourceConverter.ConvertToLogSourceDto(log.Source),
Year = log.Year
};
}
public static TimeLogDb ConvertFromTimeLogDto(TimeLog log)
{
return new TimeLogDb
{
CalendarWeek = log.CalendarWeek,
Year = log.Year,
UserId_FK = log.UserId,
IdentifierId = log.IdentifierId,
Direction = LogDirectionConverter.ConvertFromLogDirectionDto(log.Direction),
Id = log.Id,
Source = LogSourceConverter.ConvertFromLogSourceDto(log.Source),
SwipeEventDateTime = log.EventTime
};
}
}
}

View File

@ -0,0 +1,32 @@
using System;
using Interfaces;
namespace SQLiteRepository.Converters
{
static class UserConverter
{
public static User ConvertToUserDto(UserIdentity user)
{
return new User
{
UserId = user.Id,
FirstName = user.FirstName,
LastName = user.LastName,
IsContractor = user.IsContractor,
HoursPerWeek = user.HoursPerWeek,
};
}
public static UserIdentity ConvertFromUserDto(User user)
{
return new UserIdentity
{
Id = user.UserId,
FirstName = user.FirstName,
LastName = user.LastName,
HoursPerWeek = user.HoursPerWeek,
IsContractor = user.IsContractor
};
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SQLiteRepository.Extensions
{
public static class EnumerableExtensions
{
public static IEnumerable<TSource> Exclude<TSource, TKey>(this IEnumerable<TSource> source,
IEnumerable<TSource> exclude, Func<TSource, TKey> keySelector)
{
var excludedSet = new HashSet<TKey>(exclude.Select(keySelector));
return source.Where(item => !excludedSet.Contains(keySelector(item)));
}
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SQLite.Net.Attributes;
namespace SQLiteRepository
{
internal class PolicyDb
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public DateTimeOffset ChangeDate { get; set; }
public string ChangeDescription { get; set; }
public string ChangeAuthor { get; set; }
public string Version { get; set; }
public string Markdown { get; set; }
public string Html { get; set; }
}
}

View File

@ -1,9 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
namespace SQLiteRepository namespace SQLiteRepository
{ {
internal static class SQLiteProcedures internal static class SQLiteProcedures
{ {
public const string GET_LOGS_IN_LAST_X_MINUTES = public const string GET_LOGS_IN_LAST_X_MINUTES =
"select * from TimeLogDb where " + nameof(TimeLogDb.SwipeEventDateTime) + " > ? AND " + "select * from " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.SwipeEventDateTime) + " > ? AND " +
nameof(TimeLogDb.UserId_FK) + "=?"; nameof(TimeLogDb.UserId_FK) + "=?";
public const string GET_TIMELOGS = public const string GET_TIMELOGS =
@ -11,20 +16,18 @@ namespace SQLiteRepository
nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)"; nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)";
public const string GET_ALL_USERS = public const string GET_ALL_USERS =
"select * from " + nameof(UserIdentity) + " ut " "select * from " + nameof(UserIdentity) + " ut "
+ "where " + "where "
+ "EXISTS( select " + nameof(GroupDb.GroupId) + "EXISTS( select " + nameof(GroupDb.GroupId)
+ " from " + nameof(GroupDb) + " from " + nameof(GroupDb)
+ " where " + nameof(GroupDb.GroupName) + " = 'Archived') AND " + " where " + nameof(GroupDb.GroupName) + " = 'Archived') AND "
+ "NOT EXISTS( select * from " + nameof(UserGroupJoinDb) + " ugp where " + "NOT EXISTS( select * from " + nameof(UserGroupJoinDb) + " ugp where "
+ nameof(UserGroupJoinDb.UserId_FK) + " = ut.Id" + nameof(UserGroupJoinDb.UserId_FK) + " = ut.Id"
+ " and " + nameof(UserGroupJoinDb.GroupId_FK) + " = ( " + " and " + nameof(UserGroupJoinDb.GroupId_FK) + " = ( "
+ "select " + nameof(GroupDb.GroupId) + "select " + nameof(GroupDb.GroupId)
+ " from " + nameof(GroupDb) + " from " + nameof(GroupDb)
+ " where " + nameof(GroupDb.GroupName) + " = 'Archived') )" + " where " + nameof(GroupDb.GroupName) + " = 'Archived') )"
+ "order by " + "order by ? collate nocase ?, ? collate nocase ?";
+ nameof(UserIdentity.LastName) + " collate nocase, "
+ nameof(UserIdentity.FirstName) + " collate nocase";
public const string GET_ALL_USERS_PAGINATE = public const string GET_ALL_USERS_PAGINATE =
"select * from " + nameof(UserIdentity) + " ut " "select * from " + nameof(UserIdentity) + " ut "
@ -38,18 +41,18 @@ namespace SQLiteRepository
+ "select " + nameof(GroupDb.GroupId) + "select " + nameof(GroupDb.GroupId)
+ " from " + nameof(GroupDb) + " from " + nameof(GroupDb)
+ " where " + nameof(GroupDb.GroupName) + " = 'Archived') )" + " where " + nameof(GroupDb.GroupName) + " = 'Archived') )"
+ "order by " + " order by "
+ nameof(UserIdentity.LastName) + " collate nocase, " + "{0} collate nocase {1}, "
+ nameof(UserIdentity.FirstName) + " collate nocase " + "{2} collate nocase {3} "
+ "limit ? offset ?"; + "limit {4} offset {5}";
public const string GET_ALL_USERS_BY_GROUP = public const string GET_ALL_USERS_BY_GROUP =
"select u." + nameof(UserIdentity.Id) + ", u." + nameof(UserIdentity.FirstName) + ", u." + "select u." + nameof(UserIdentity.Id) + ", u." + nameof(UserIdentity.FirstName) + ", u." +
nameof(UserIdentity.LastName) + ", u." + nameof(UserIdentity.HoursPerWeek) + ", u." + nameof(UserIdentity.LastName) + ", u." + nameof(UserIdentity.HoursPerWeek) + ", u." +
nameof(UserIdentity.IsContractor) + " from " + nameof(UserIdentity) + " u left join " + nameof(UserIdentity.IsContractor) + " from " + nameof(UserIdentity) + " u left join " +
nameof(UserGroupJoinDb) + " ugj on ugj." + nameof(UserGroupJoinDb.UserId_FK) + " = u." + nameof(UserGroupJoinDb) + " ugj on ugj." + nameof(UserGroupJoinDb.UserId_FK) + " = u." +
nameof(UserIdentity.Id) + " where ugj." + nameof(UserGroupJoinDb.GroupId_FK) + "=? order by u." + nameof(UserIdentity.Id) + " where ugj." + nameof(UserGroupJoinDb.GroupId_FK) + "= {0} " +
nameof(UserIdentity.LastName) + " collate nocase, u." + nameof(UserIdentity.LastName) + " collate nocase"; "order by u.{1} collate nocase {2}, u.{3} collate nocase {4}";
public const string GET_USER_BY_ID = public const string GET_USER_BY_ID =
"select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?"; "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?";
@ -60,6 +63,9 @@ namespace SQLiteRepository
public const string GET_CARDS_BY_UNIQUE_ID = public const string GET_CARDS_BY_UNIQUE_ID =
"select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.CardUId) + "=?"; "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.CardUId) + "=?";
public const string GET_CARDS_BY_UNIQUE_ID_LIST =
"select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.CardUId) + " in (#IN#)";
public const string GET_UNASSIGNED_CARD_LIST = public const string GET_UNASSIGNED_CARD_LIST =
"select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?"; "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?";
@ -88,9 +94,82 @@ namespace SQLiteRepository
nameof(TimeLogDb.SwipeEventDateTime) + " desc LIMIT 1"; nameof(TimeLogDb.SwipeEventDateTime) + " desc LIMIT 1";
public const string GET_TOTAL_USER_COUNT = public const string GET_TOTAL_USER_COUNT =
"select Max(" + nameof(UserIdentity.Id) + ") from " + nameof(UserIdentity); "select count(1) from " + nameof(UserIdentity) + " ut "
+ "where "
+ "EXISTS( select " + nameof(GroupDb.GroupId)
+ " from " + nameof(GroupDb)
+ " where " + nameof(GroupDb.GroupName) + " = 'Archived') "
+ "AND NOT EXISTS( select * from " + nameof(UserGroupJoinDb) + " ugp where "
+ nameof(UserGroupJoinDb.UserId_FK) + " = ut.Id"
+ " and " + nameof(UserGroupJoinDb.GroupId_FK) + " = ( "
+ "select " + nameof(GroupDb.GroupId)
+ " from " + nameof(GroupDb)
+ " where " + nameof(GroupDb.GroupName) + " = 'Archived') )";
//"select Max(" + nameof(UserIdentity.Id) + ") from " + nameof(UserIdentity);
public const string GET_USER_CONTRACTED_HOURS = public const string GET_USER_CONTRACTED_HOURS =
"select " + nameof(UserIdentity.HoursPerWeek) + " From UserIdentity where " + nameof(UserIdentity.Id) + "=?"; "select " + nameof(UserIdentity.HoursPerWeek) + " From UserIdentity where " + nameof(UserIdentity.Id) + "=?";
public const string GET_GROUPS = "select gp."+ nameof(GroupDb.GroupId)+ ", gp."+nameof(GroupDb.GroupName)+", " +
"sum(case when gp." + nameof(GroupDb.GroupId) + " = ujdb." + nameof(UserGroupJoinDb.GroupId_FK) + " then 1 else 0 end) as " + nameof(GroupDb.AssignedUserCount) +
" from " + nameof(GroupDb) + " gp" +
" left join " + nameof(UserGroupJoinDb) + " ujdb " +
"on ujdb." + nameof(UserGroupJoinDb.GroupId_FK) + " = gp." + nameof(GroupDb.GroupId) +
" group by gp." + nameof(GroupDb.GroupId);
public const string GET_GROUPS_FOR_USER = "select gdb." + nameof(GroupDb.GroupId) + ", gdb." + nameof(GroupDb.GroupName) + ", gdb." + nameof(GroupDb.AssignedUserCount) + "" +
" from " + nameof(GroupDb) + " gdb" +
" left join " + nameof(UserGroupJoinDb) + " ujdb" +
" on gdb." + nameof(GroupDb.GroupId) + " = ujdb." + nameof(UserGroupJoinDb.GroupId_FK) +
" where ujdb." + nameof(UserGroupJoinDb.UserId_FK) + " = ?";
public const string GET_GROUP_BY_ID =
"select * from " + nameof(GroupDb) + " where " + nameof(GroupDb.GroupId) + " =?";
public const string UPDATE_GROUP = "update " + nameof(GroupDb) + " set " + nameof(GroupDb.GroupName) +
"=? where " + nameof(GroupDb.GroupId) + "=?";
public const string GET_GROUP_BY_NAME =
"select 1 from " + nameof(GroupDb)+" where "+nameof(GroupDb.GroupName)+"= ?";
public const string GET_TIMELOG_ENTRY =
"select * from " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.Id) + "=?";
public const string DELETE_TIMELOG_ENTRY =
"delete from " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.Id) + "=?";
public const string DELETE_TIMELOG_ENTRIES =
"delete from " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.Id) + "in (#IN#)";
public const string UPDATE_TIMELOG_ENTRY = "update " + nameof(TimeLogDb)
+ " set " + nameof(TimeLogDb.UserId_FK) + "=?, "
+ nameof(TimeLogDb.Direction) + "=?,"
+ nameof(TimeLogDb.SwipeEventDateTime) + "=?,"
+ nameof(TimeLogDb.CalendarWeek) + "=?,"
+ nameof(TimeLogDb.Year) + "=?,"
+ nameof(TimeLogDb.Source) + "=? "
+ "where " + nameof(TimeLogDb.Id) + "=?";
public const string GET_DB_VERSION = "select * from " + nameof(DbVersion);
/// <summary>
/// This works on the tokenisation of the query string.
/// where the list of params is to be inserted, the query should have #IN#
/// </summary>
/// <param name="query">the query to add the list of parameters to</param>
/// <param name="args">the parameters to add to the query.</param>
/// <returns></returns>
public static string FormatInQuery(string query, List<string> args)
{
if (!query.Contains("#IN#"))
{
throw new ArgumentException("query doesnt contain any #IN# tokenisation");
}
//Convert to a comma separated list e.g.: val1,val2,val3
//but we need to use string.. so.. enclose in single quotes 'val1','val2'..etc
var argsFormatted = string.Join(",", args.Select(x=>$"'{x}'"));
return query.Replace("#IN#", argsFormatted);
}
} }
} }

View File

@ -1,124 +1,132 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}</ProjectGuid> <ProjectGuid>{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SQLiteRepository</RootNamespace> <RootNamespace>SQLiteRepository</RootNamespace>
<AssemblyName>SQLiteRepository</AssemblyName> <AssemblyName>SQLiteRepository</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath> <OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SQLite.Net, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath> <HintPath>..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLite.Net.Platform.Generic, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SQLite.Net.Platform.Generic, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll</HintPath> <HintPath>..\packages\SQLite.Net-PCL.3.1.1\lib\net40\SQLite.Net.Platform.Generic.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="SQLite.Net.Platform.Win32, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="SQLite.Net.Platform.Win32, Version=3.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SQLite.Net-PCL.3.1.1\lib\net4\SQLite.Net.Platform.Win32.dll</HintPath> <HintPath>..\packages\SQLite.Net-PCL.3.1.1\lib\net4\SQLite.Net.Platform.Win32.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net451\System.Data.SQLite.dll</HintPath> <HintPath>..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net451\System.Data.SQLite.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CardUniqueId.cs" /> <Compile Include="CardUniqueId.cs" />
<Compile Include="DBVersion.cs" /> <Compile Include="Converters\IdentifierConverter.cs" />
<Compile Include="GroupDb.cs" /> <Compile Include="Converters\LogDirectionConverter.cs" />
<Compile Include="LogSourceDb.cs" /> <Compile Include="Converters\LogSourceConverter.cs" />
<Compile Include="SQLiteRepository.cs" /> <Compile Include="Converters\PolicyConverter.cs" />
<Compile Include="Constants.cs" /> <Compile Include="Converters\TimeLogConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Converters\UserConverter.cs" />
<Compile Include="SQLiteProcedures.cs" /> <Compile Include="DBVersion.cs" />
<Compile Include="LogDirectionDb.cs" /> <Compile Include="Extensions\Extensions.cs" />
<Compile Include="TimeLogDb.cs" /> <Compile Include="GroupDb.cs" />
<Compile Include="UserGroupJoinDb.cs" /> <Compile Include="LogSourceDb.cs" />
<Compile Include="UserIdentity.cs" /> <Compile Include="PolicyDb.cs" />
</ItemGroup> <Compile Include="SQLiteRepository.cs" />
<ItemGroup> <Compile Include="Constants.cs" />
<ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj"> <Compile Include="Properties\AssemblyInfo.cs" />
<Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project> <Compile Include="SQLiteProcedures.cs" />
<Name>ConfigurationHandler</Name> <Compile Include="LogDirectionDb.cs" />
</ProjectReference> <Compile Include="TimeLogDb.cs" />
<ProjectReference Include="..\Interfaces\Interfaces.csproj"> <Compile Include="UserGroupJoinDb.cs" />
<Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project> <Compile Include="UserIdentity.cs" />
<Name>Interfaces</Name> </ItemGroup>
</ProjectReference> <ItemGroup>
</ItemGroup> <ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj">
<ItemGroup> <Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project>
<None Include="packages.config" /> <Name>ConfigurationHandler</Name>
</ItemGroup> </ProjectReference>
<ItemGroup> <ProjectReference Include="..\Interfaces\Interfaces.csproj">
<EmbeddedResource Include="UpgradeScripts\0.2.sql" /> <Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project>
</ItemGroup> <Name>Interfaces</Name>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </ProjectReference>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" /> </ItemGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <ItemGroup>
<PropertyGroup> <EmbeddedResource Include="UpgradeScripts\0.2.sql" />
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </ItemGroup>
</PropertyGroup> <ItemGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets'))" /> <None Include="packages.config" />
</Target> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -1 +1,3 @@
insert into GroupDb values ((select max(groupId) from GroupDb)+1,'Archived',0) insert into GroupDb(GroupId, GroupName, AssignedUserCount)
select (select max(GroupId) from GroupDb)+1, 'Archived', 0
WHERE NOT EXISTS(select * from GroupDb where GroupName='Archived');

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net452" /> <package id="SQLite.Net.Core-PCL" version="3.1.1" targetFramework="net452" />
<package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net452" /> <package id="SQLite.Net-PCL" version="3.1.1" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net452" /> <package id="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net452" />
</packages> </packages>

View File

@ -1,41 +1,53 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<appSettings> <appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" /> <add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DefaultPageSize" value="20" /> <add key="DefaultPageSize" value="20" />
<add key="WebsiteHttpPort" value="8800"/> <add key="WebsiteHttpPort" value="8800" />
<add key="SwipeTimeGap" value="3" /> <add key="SwipeTimeGap" value="3" />
<add key="BugSubmissionEmailAddress" value="incoming+WattsC/FlexiTimeTrackerTool@incoming.gitlab.com"/> <add key="BugSubmissionEmailAddress" value="incoming+WattsC/FlexiTimeTrackerTool+24qrefn8e1urhl4iqct7we2jl@gitlab.com" />
</appSettings> </appSettings>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="RazorEngine" publicKeyToken="9ee697374c7e744a" culture="neutral" /> <assemblyIdentity name="RazorEngine" publicKeyToken="9ee697374c7e744a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.7.2.0" newVersion="3.7.2.0" /> <bindingRedirect oldVersion="0.0.0.0-3.7.2.0" newVersion="3.7.2.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> <dependentAssembly>
</runtime> <assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.Common" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.Common.OwinHost" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>

View File

@ -0,0 +1,66 @@
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(WindowsDataCenter.App_Start.NinjectWebCommon), "Start")]
[assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(WindowsDataCenter.App_Start.NinjectWebCommon), "Stop")]
namespace WindowsDataCenter.App_Start
{
using System;
using System.Web;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;
using Ninject;
using Ninject.Web.Common;
using Ninject.Web.Common.WebHost;
public static class NinjectWebCommon
{
private static readonly Bootstrapper bootstrapper = new Bootstrapper();
/// <summary>
/// Starts the application
/// </summary>
public static void Start()
{
DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
bootstrapper.Initialize(CreateKernel);
}
/// <summary>
/// Stops the application.
/// </summary>
public static void Stop()
{
bootstrapper.ShutDown();
}
/// <summary>
/// Creates the kernel that will manage your application.
/// </summary>
/// <returns>The created kernel.</returns>
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
try
{
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
RegisterServices(kernel);
return kernel;
}
catch
{
kernel.Dispose();
throw;
}
}
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
}
}
}

View File

@ -1,7 +1,10 @@
namespace WindowsDataCenter using System;
{
public class CardData namespace WindowsDataCenter
{ {
public string CardUId { get; set; } public class CardData
} {
public DateTime? UtcTimeStamp { get; set; }
public string CardUId { get; set; }
}
} }

View File

@ -1,26 +1,51 @@
using System.Reflection; using System.Reflection;
using System.Web.Http; using System.Web.Http;
using Interfaces; using WindowsDataCenter.Helpers;
using Interfaces;
namespace WindowsDataCenter
{ namespace WindowsDataCenter
[RoutePrefix("api/app")] {
public class ApplicationController:ApiController [RoutePrefix("api/app")]
{ public class ApplicationController:ApiController
[Route("")] {
public IHttpActionResult GetAppDetails() private IRepository _repo;
{ public ApplicationController(IRepository repo)
var ninjectHelper = NinjectHelper.GetInstance(); {
var appDetails = new AppDetails _repo = repo;
{ }
ApplicationName = "Flexitime Tracker",
DataBaseProvider = ninjectHelper.Get<IRepository>().GetType().ToString(), [Route("")]
LoggerProvider = ninjectHelper.Get<ILogger>().GetType().ToString(), public IHttpActionResult GetAppDetails()
Version = Assembly.GetEntryAssembly().GetName().Version.ToString(), {
ErrorEmailAddress = ConfigurationHandler.ConfigurationHandler.GetConfiguration("BugSubmissionEmailAddress") ?? "NONE" var ninjectHelper = NinjectHelper.GetInstance();
}; var appDetails = new AppDetails
{
return Ok(appDetails); ApplicationName = "Flexitime Tracker",
} DataBaseProvider = ninjectHelper.Get<IRepository>().GetType().ToString(),
} LoggerProvider = ninjectHelper.Get<ILogger>().GetType().ToString(),
} Version = Assembly.GetEntryAssembly().GetName().Version.ToString(),
ErrorEmailAddress = ConfigurationHandler.ConfigurationHandler.GetConfiguration("BugSubmissionEmailAddress") ?? "NONE"
};
return Ok(appDetails);
}
[Route("policy")]
[HttpGet]
[CacheControl(MaxAge = 0)]
public IHttpActionResult GetPolicy()
{
Policy policy = _repo.GetPolicy();
return Json(policy);
}
[Route("policy")]
[HttpPost]
[CacheControl(MaxAge = 0)]
public IHttpActionResult SavePolicy(Policy policy)
{
_repo.SavePolicy(policy);
return Ok(new {}); //empty to ensure ajax triggers Success..
}
}
}

View File

@ -1,47 +1,53 @@
using System; using System;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Web.Http; using System.Web.Http;
using Interfaces; using Interfaces;
namespace WindowsDataCenter namespace WindowsDataCenter
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[RoutePrefix("api/swipedata")] [RoutePrefix("api/swipedata")]
public class SwipeDataController : ApiController public class SwipeDataController : ApiController
{ {
private readonly IRepository _repo; private readonly IRepository _repo;
private readonly ILogger _logger; private readonly ILogger _logger;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="repo"></param> /// <param name="repo"></param>
/// <param name="logger"></param> /// <param name="logger"></param>
public SwipeDataController(IRepository repo, ILogger logger) public SwipeDataController(IRepository repo, ILogger logger)
{ {
if(repo == null) throw new ArgumentNullException(nameof(repo)); if(repo == null) throw new ArgumentNullException(nameof(repo));
_repo = repo; _repo = repo;
if(logger == null) throw new ArgumentNullException(nameof(logger)); if(logger == null) throw new ArgumentNullException(nameof(logger));
_logger = logger; _logger = logger;
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="cData"></param> /// <param name="cData"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("")] [Route("")]
public IHttpActionResult PostData([FromBody] CardData cData) public IHttpActionResult PostData([FromBody] CardData cData)
{ {
int logId; int logId;
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, var id = new Identifier {UniqueId = cData.CardUId};
DateTime.UtcNow, resp.Direction);
return Ok(new {Id = logId, resp.Direction}); var resp = cData.UtcTimeStamp.HasValue
} ? _repo.LogEventTime(id, out logId, cData.UtcTimeStamp.Value)
} : _repo.LogEventTime(id, 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});
}
}
} }

View File

@ -30,17 +30,18 @@ namespace WindowsDataCenter
public IHttpActionResult GetUsers([FromUri] string query = "" public IHttpActionResult GetUsers([FromUri] string query = ""
, [FromUri] int pageSize = -1 , [FromUri] int pageSize = -1
, [FromUri] int pageNumber = -1 , [FromUri] int pageNumber = -1
, [FromUri] int groupId = -1) , [FromUri] int groupId = -1
, [FromUri] SortOptions sort = SortOptions.None)
{ {
_logger.Trace("GetUsers called with arguments >> query: {0}, pageSize: {1}, pageNumber: {2}, groupFilter: {3}", query, pageSize, pageNumber, groupId); _logger.Trace("GetUsers called with arguments >> query: {0}, pageSize: {1}, pageNumber: {2}, groupFilter: {3}, sort: {4}", query, pageSize, pageNumber, groupId, sort);
pageNumber = pageNumber == -1 ? 1 : pageNumber; pageNumber = pageNumber == -1 ? 1 : pageNumber;
pageSize = GetPageSize(pageSize); pageSize = GetPageSize(pageSize);
var userList = query != string.Empty var userList = query != string.Empty
? _repo.Search(query) ? _repo.Search(query)
: groupId != -1 : groupId != -1
? _repo.GetUsers(groupId: groupId) ? _repo.GetUsers(groupId: groupId, sort:sort)
: _repo.GetUsers(pageNumber, pageSize); : _repo.GetUsers(pageNumber, pageSize, sort:sort);
_logger.Trace("Got UserList from Repository, UserCount: {0}", userList.UserCount); _logger.Trace("Got UserList from Repository, UserCount: {0}", userList.UserCount);
if (query != string.Empty) if (query != string.Empty)
{ {
@ -57,6 +58,7 @@ namespace WindowsDataCenter
userList.PageNumber = pageNumber; userList.PageNumber = pageNumber;
userList.PageSize = pageSize; userList.PageSize = pageSize;
userList.SelectedSortOption = sort;
_logger.Trace("Returning UserList from GetUsers."); _logger.Trace("Returning UserList from GetUsers.");
var msg = Request.CreateResponse(HttpStatusCode.OK, userList); var msg = Request.CreateResponse(HttpStatusCode.OK, userList);
@ -93,8 +95,7 @@ namespace WindowsDataCenter
{ {
int userId; int userId;
_repo.UpdateUser(user, out userId); _repo.UpdateUser(user, out userId);
//TODO return ID. return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent(userId.ToString())});
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent("unknownIdTODO")});
} }
[HttpPost] [HttpPost]

View File

@ -1,28 +1,28 @@
@using System.Web.Http.Description @using System.Web.Http.Description
@using DalSoft.WebApi.HelpPage @using DalSoft.WebApi.HelpPage
@model IGrouping<string, ApiDescription> @model IGrouping<string, ApiDescription>
<h2 id="@Model.Key">@Model.Key</h2> <h2 id="@Model.Key">@Model.Key</h2>
<table class="help-page-table"> <table class="help-page-table">
<thead> <thead>
<tr><th>API</th><th>Description</th></tr> <tr><th>API</th><th>Description</th></tr>
</thead> </thead>
<tbody> <tbody>
@foreach (var api in Model) @foreach (var api in Model)
{ {
<tr> <tr>
<td class="api-name"><a href="@ViewBag.HelpRoute/api?apiId=@api.GetFriendlyId()">@api.HttpMethod.Method @api.RelativePath</a></td> <td class="api-name"><a href="@ViewBag.HelpRoute/api?apiId=@api.GetFriendlyId()">@api.HttpMethod.Method @api.RelativePath</a></td>
<td class="api-documentation"> <td class="api-documentation">
@if (api.Documentation !=null) @if (api.Documentation !=null)
{ {
<p>@api.Documentation</p> <p>@api.Documentation</p>
} }
else else
{ {
<p>No documentation available.</p> <p>No documentation available.</p>
} }
</td> </td>
</tr> </tr>
} }
</tbody> </tbody>
</table> </table>

View File

@ -1,49 +1,49 @@
@using System.Collections.Generic @using System.Collections.Generic
@using System.Net.Http.Headers @using System.Net.Http.Headers
@using DalSoft.WebApi.HelpPage.Models @using DalSoft.WebApi.HelpPage.Models
@model HelpPageApiModel @model HelpPageApiModel
@{ @{
var description = Model.ApiDescription; var description = Model.ApiDescription;
var hasParameters = description.ParameterDescriptions.Count > 0; var hasParameters = description.ParameterDescriptions.Count > 0;
var hasRequestSamples = Model.SampleRequests.Count > 0; var hasRequestSamples = Model.SampleRequests.Count > 0;
var hasResponseSamples = Model.SampleResponses.Count > 0; var hasResponseSamples = Model.SampleResponses.Count > 0;
} }
<h1>@description.HttpMethod.Method @description.RelativePath</h1> <h1>@description.HttpMethod.Method @description.RelativePath</h1>
<div> <div>
@{ @{
if (description.Documentation != null) if (description.Documentation != null)
{ {
<p>@description.Documentation</p> <p>@description.Documentation</p>
} }
else else
{ {
<p>No documentation available.</p> <p>No documentation available.</p>
} }
if (hasParameters || hasRequestSamples) if (hasParameters || hasRequestSamples)
{ {
<h2>Request Information</h2> <h2>Request Information</h2>
if (hasParameters) if (hasParameters)
{ {
<h3>Parameters</h3> <h3>Parameters</h3>
@Include("Parameters.cshtml", Model, typeof(HelpPageApiModel)) @Include("Parameters.cshtml", Model, typeof(HelpPageApiModel))
} }
if (hasRequestSamples) if (hasRequestSamples)
{ {
<h3>Request body formats</h3> <h3>Request body formats</h3>
var ModelSamples = Model.SampleRequests; var ModelSamples = Model.SampleRequests;
@Include("Samples.cshtml", ModelSamples, typeof(IDictionary<MediaTypeHeaderValue, object>)) @Include("Samples.cshtml", ModelSamples, typeof(IDictionary<MediaTypeHeaderValue, object>))
} }
} }
if (hasResponseSamples) if (hasResponseSamples)
{ {
<h2>Response Information</h2> <h2>Response Information</h2>
<h3>Response body formats</h3> <h3>Response body formats</h3>
var ModelSamples = Model.SampleResponses; var ModelSamples = Model.SampleResponses;
@Include("Samples.cshtml", ModelSamples, typeof(IDictionary<MediaTypeHeaderValue, object>)) @Include("Samples.cshtml", ModelSamples, typeof(IDictionary<MediaTypeHeaderValue, object>))
} }
} }
</div> </div>

View File

@ -1,55 +1,55 @@
@using System.Collections.ObjectModel @using System.Collections.ObjectModel
@using System.Threading @using System.Threading
@using System.Web.Http.Description @using System.Web.Http.Description
@{ Collection<ApiParameterDescription> parameters = Model.ApiDescription.ParameterDescriptions; } @{ Collection<ApiParameterDescription> parameters = Model.ApiDescription.ParameterDescriptions; }
@if (parameters.Count > 0) @if (parameters.Count > 0)
{ {
<table class="help-page-table"> <table class="help-page-table">
<thead> <thead>
<tr><th>Name</th><th>Description</th><th>Additional information</th></tr> <tr><th>Name</th><th>Description</th><th>Additional information</th></tr>
</thead> </thead>
<tbody> <tbody>
@{ @{
foreach (ApiParameterDescription parameter in parameters) foreach (ApiParameterDescription parameter in parameters)
{ {
var parameterDocumentation = parameter.Documentation ?? "No documentation available."; var parameterDocumentation = parameter.Documentation ?? "No documentation available.";
// Don't show CancellationToken because it's a special parameter // Don't show CancellationToken because it's a special parameter
if (!typeof (CancellationToken).IsAssignableFrom(parameter.ParameterDescriptor.ParameterType)) if (!typeof (CancellationToken).IsAssignableFrom(parameter.ParameterDescriptor.ParameterType))
{ {
<tr> <tr>
<td class="parameter-name">@parameter.Name</td> <td class="parameter-name">@parameter.Name</td>
<td class="parameter-documentation"> <td class="parameter-documentation">
<p>@parameterDocumentation</p> <p>@parameterDocumentation</p>
</td> </td>
<td class="parameter-type"> <td class="parameter-type">
@{ @{
switch (parameter.Source) switch (parameter.Source)
{ {
case ApiParameterSource.FromBody: case ApiParameterSource.FromBody:
<p>Define this parameter in the request <b>body</b>. <p>Define this parameter in the request <b>body</b>.
</p> </p>
break; break;
case ApiParameterSource.FromUri: case ApiParameterSource.FromUri:
<p>Define this parameter in the request <b>URI</b>. <p>Define this parameter in the request <b>URI</b>.
</p> </p>
break; break;
case ApiParameterSource.Unknown: case ApiParameterSource.Unknown:
default: default:
<p>None.</p> <p>None.</p>
break; break;
} }
} }
</td> </td>
</tr> </tr>
} }
} }
} }
</tbody> </tbody>
</table> </table>
} }
else else
{ {
<p>None.</p> <p>None.</p>
} }

View File

@ -1,37 +1,37 @@
@using System.Net.Http.Headers @using System.Net.Http.Headers
@using DalSoft.WebApi.HelpPage.SampleGeneration @using DalSoft.WebApi.HelpPage.SampleGeneration
@model IDictionary<MediaTypeHeaderValue, object> @model IDictionary<MediaTypeHeaderValue, object>
@{ @{
// Group the samples into a single tab if they are the same. // Group the samples into a single tab if they are the same.
var samples = Model.GroupBy(x => x.Value).ToDictionary(x => string.Join(", ", x.Select(m => m.Key.ToString()).ToArray()), x => x.Key); var samples = Model.GroupBy(x => x.Value).ToDictionary(x => string.Join(", ", x.Select(m => m.Key.ToString()).ToArray()), x => x.Key);
var mediaTypes = samples.Keys; var mediaTypes = samples.Keys;
} }
<div> <div>
@{ @{
foreach (var mediaType in mediaTypes) foreach (var mediaType in mediaTypes)
{ {
<h4 class="sample-header">@mediaType</h4> <h4 class="sample-header">@mediaType</h4>
<div class="sample-content"> <div class="sample-content">
<span><b>Sample:</b></span> <span><b>Sample:</b></span>
@{ var sample = samples[mediaType]; } @{ var sample = samples[mediaType]; }
@if (sample == null) @if (sample == null)
{ {
<p>Sample not available.</p> <p>Sample not available.</p>
} }
else if (sample is TextSample) else if (sample is TextSample)
{ {
<pre class="wrapped">@(((TextSample)sample).Text)</pre> <pre class="wrapped">@(((TextSample)sample).Text)</pre>
} }
else if (sample is ImageSample) else if (sample is ImageSample)
{ {
<img src="@(((ImageSample)sample).Src)"/> <img src="@(((ImageSample)sample).Src)"/>
} }
else if (sample is InvalidSample) else if (sample is InvalidSample)
{ {
<div class="warning-message-container">@(((InvalidSample)sample).ErrorMessage)</div> <div class="warning-message-container">@(((InvalidSample)sample).ErrorMessage)</div>
} }
</div> </div>
} }
} }
</div> </div>

View File

@ -1,134 +1,134 @@
.help-page h1, .help-page h1,
.help-page .h1, .help-page .h1,
.help-page h2, .help-page h2,
.help-page .h2, .help-page .h2,
.help-page h3, .help-page h3,
.help-page .h3, .help-page .h3,
#body.help-page, #body.help-page,
.help-page-table th, .help-page-table th,
.help-page-table pre, .help-page-table pre,
.help-page-table p { .help-page-table p {
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
} }
.help-page pre.wrapped { .help-page pre.wrapped {
white-space: -moz-pre-wrap; white-space: -moz-pre-wrap;
white-space: -pre-wrap; white-space: -pre-wrap;
white-space: -o-pre-wrap; white-space: -o-pre-wrap;
white-space: pre-wrap; white-space: pre-wrap;
} }
.help-page .warning-message-container { .help-page .warning-message-container {
margin-top: 20px; margin-top: 20px;
padding: 0 10px; padding: 0 10px;
color: #525252; color: #525252;
background: #EFDCA9; background: #EFDCA9;
border: 1px solid #CCCCCC; border: 1px solid #CCCCCC;
} }
.help-page-table { .help-page-table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
text-align: left; text-align: left;
margin: 0px 0px 20px 0px; margin: 0px 0px 20px 0px;
border-top: 1px solid #D4D4D4; border-top: 1px solid #D4D4D4;
} }
.help-page-table th { .help-page-table th {
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
border-bottom: 1px solid #D4D4D4; border-bottom: 1px solid #D4D4D4;
padding: 5px 6px 5px 6px; padding: 5px 6px 5px 6px;
} }
.help-page-table td { .help-page-table td {
border-bottom: 1px solid #D4D4D4; border-bottom: 1px solid #D4D4D4;
padding: 10px 8px 10px 8px; padding: 10px 8px 10px 8px;
vertical-align: top; vertical-align: top;
} }
.help-page-table pre, .help-page-table pre,
.help-page-table p { .help-page-table p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
font-family: inherit; font-family: inherit;
font-size: 100%; font-size: 100%;
} }
.help-page-table tbody tr:hover td { .help-page-table tbody tr:hover td {
background-color: #F3F3F3; background-color: #F3F3F3;
} }
.help-page a:hover { .help-page a:hover {
background-color: transparent; background-color: transparent;
} }
.help-page .sample-header { .help-page .sample-header {
border: 2px solid #D4D4D4; border: 2px solid #D4D4D4;
background: #00497E; background: #00497E;
color: #FFFFFF; color: #FFFFFF;
padding: 8px 15px; padding: 8px 15px;
border-bottom: none; border-bottom: none;
display: inline-block; display: inline-block;
margin: 10px 0px 0px 0px; margin: 10px 0px 0px 0px;
} }
.help-page .sample-content { .help-page .sample-content {
display: block; display: block;
border-width: 0; border-width: 0;
padding: 15px 20px; padding: 15px 20px;
background: #FFFFFF; background: #FFFFFF;
border: 2px solid #D4D4D4; border: 2px solid #D4D4D4;
margin: 0px 0px 10px 0px; margin: 0px 0px 10px 0px;
} }
.help-page .api-name { .help-page .api-name {
width: 40%; width: 40%;
} }
.help-page .api-documentation { .help-page .api-documentation {
width: 60%; width: 60%;
} }
.help-page .parameter-name { .help-page .parameter-name {
width: 20%; width: 20%;
} }
.help-page .parameter-documentation { .help-page .parameter-documentation {
width: 40%; width: 40%;
} }
.help-page .parameter-type { .help-page .parameter-type {
width: 20%; width: 20%;
} }
.help-page .parameter-annotations { .help-page .parameter-annotations {
width: 20%; width: 20%;
} }
.help-page h1, .help-page h1,
.help-page .h1 { .help-page .h1 {
font-size: 36px; font-size: 36px;
line-height: normal; line-height: normal;
} }
.help-page h2, .help-page h2,
.help-page .h2 { .help-page .h2 {
font-size: 24px; font-size: 24px;
} }
.help-page h3, .help-page h3,
.help-page .h3 { .help-page .h3 {
font-size: 20px; font-size: 20px;
} }
#body.help-page { #body.help-page {
font-size: 14px; font-size: 14px;
line-height: 143%; line-height: 143%;
color: #333; color: #333;
} }
.help-page a { .help-page a {
color: #0000EE; color: #0000EE;
text-decoration: none; text-decoration: none;
} }

View File

@ -1,28 +1,28 @@
@using DalSoft.WebApi.HelpPage.Models @using DalSoft.WebApi.HelpPage.Models
@model HelpPageApiModel @model HelpPageApiModel
@{ @{
var description = Model.ApiDescription; var description = Model.ApiDescription;
var title = description.HttpMethod.Method + " " + description.RelativePath; var title = description.HttpMethod.Method + " " + description.RelativePath;
} }
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>@title</title> <title>@title</title>
<link type="text/css" href="@ViewBag.HelpRoute/HelpPage_css" rel="stylesheet" /> <link type="text/css" href="@ViewBag.HelpRoute/HelpPage_css" rel="stylesheet" />
</head> </head>
<body> <body>
<div id="body" class="help-page"> <div id="body" class="help-page">
<section class="featured"> <section class="featured">
<div class="content-wrapper"> <div class="content-wrapper">
<p> <p>
<a href="/@ViewBag.HelpRoute">Help Page Home</a> <a href="/@ViewBag.HelpRoute">Help Page Home</a>
</p> </p>
</div> </div>
</section> </section>
<section class="content-wrapper main-content clear-fix"> <section class="content-wrapper main-content clear-fix">
@Include("HelpPageApiModel.cshtml", Model, typeof(HelpPageApiModel)) @Include("HelpPageApiModel.cshtml", Model, typeof(HelpPageApiModel))
</section> </section>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,43 +1,43 @@
@using System.Web.Http.Description @using System.Web.Http.Description
@using System.Collections.ObjectModel @using System.Collections.ObjectModel
@using System.Linq @using System.Linq
@model Collection<ApiDescription> @model Collection<ApiDescription>
@{ @{
ViewBag.Title = "ASP.NET Web API Help Page"; ViewBag.Title = "ASP.NET Web API Help Page";
// Group APIs by controller // Group APIs by controller
ILookup<string, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor.ControllerName); ILookup<string, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor.ControllerName);
} }
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>@ViewBag.Title</title> <title>@ViewBag.Title</title>
<link type="text/css" href="@ViewBag.HelpRoute/HelpPage_css" rel="stylesheet" /> <link type="text/css" href="@ViewBag.HelpRoute/HelpPage_css" rel="stylesheet" />
</head> </head>
<body> <body>
<header class="help-page"> <header class="help-page">
<div class="content-wrapper"> <div class="content-wrapper">
<div class="float-left"> <div class="float-left">
<h1>@ViewBag.Title</h1> <h1>@ViewBag.Title</h1>
</div> </div>
</div> </div>
</header> </header>
<div id="body" class="help-page"> <div id="body" class="help-page">
<section class="featured"> <section class="featured">
<div class="content-wrapper"> <div class="content-wrapper">
<h2>Introduction</h2> <h2>Introduction</h2>
<p> <p>
Provide a general description of your APIs here. Provide a general description of your APIs here.
</p> </p>
</div> </div>
</section> </section>
<section class="content-wrapper main-content clear-fix"> <section class="content-wrapper main-content clear-fix">
@foreach (IGrouping<string, ApiDescription> controllerGroup in apiGroups) @foreach (IGrouping<string, ApiDescription> controllerGroup in apiGroups)
{ {
@Include("ApiGroup.cshtml", controllerGroup, typeof (IGrouping<string, ApiDescription>)) @Include("ApiGroup.cshtml", controllerGroup, typeof (IGrouping<string, ApiDescription>))
} }
</section> </section>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,350 +1,389 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5FEE048-17A6-4966-9B6B-BF073592A470}</ProjectGuid> <ProjectGuid>{A5FEE048-17A6-4966-9B6B-BF073592A470}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsDataCenter</RootNamespace> <RootNamespace>WindowsDataCenter</RootNamespace>
<AssemblyName>WindowsDataCenter</AssemblyName> <AssemblyName>WindowsDataCenter</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile> <DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath> <OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile> <DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> <DocumentationFile>bin\ReleaseInstallers\WindowsDataCenter.XML</DocumentationFile>
<ItemGroup> </PropertyGroup>
<Reference Include="DalSoft.WebApi.HelpPage, Version=0.0.7.0, Culture=neutral, processorArchitecture=MSIL"> <ItemGroup>
<HintPath>..\packages\DalSoft.WebApi.HelpPage.0.0.7.0\lib\net451\DalSoft.WebApi.HelpPage.dll</HintPath> <Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Castle.Core.4.2.0\lib\net45\Castle.Core.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath> <Reference Include="DalSoft.WebApi.HelpPage, Version=0.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\DalSoft.WebApi.HelpPage.0.0.7.0\lib\net451\DalSoft.WebApi.HelpPage.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Microsoft.Owin.FileSystems, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath> <Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Microsoft.Owin.Host.HttpListener, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath> <Reference Include="Microsoft.Owin.FileSystems, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Microsoft.Owin.Hosting, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath> <Reference Include="Microsoft.Owin.Host.HttpListener, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Microsoft.Owin.StaticFiles, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll</HintPath> <Reference Include="Microsoft.Owin.Hosting, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath> <Reference Include="Microsoft.Owin.StaticFiles, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Extensions.ContextPreservation, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Extensions.ContextPreservation.3.2.0.0\lib\net45-full\Ninject.Extensions.ContextPreservation.dll</HintPath> <Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Extensions.NamedScope, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Extensions.NamedScope.3.2.0.0\lib\net45-full\Ninject.Extensions.NamedScope.dll</HintPath> <Reference Include="Ninject.Extensions.ContextPreservation, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Extensions.ContextPreservation.3.3.1\lib\net45\Ninject.Extensions.ContextPreservation.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Extensions.Xml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Extensions.Xml.3.2.0.0\lib\net45-full\Ninject.Extensions.Xml.dll</HintPath> <Reference Include="Ninject.Extensions.Factory, Version=3.3.2.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Web.Common, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Web.Common.3.2.3.0\lib\net45-full\Ninject.Web.Common.dll</HintPath> <Reference Include="Ninject.Extensions.NamedScope, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Extensions.NamedScope.3.3.0\lib\net45\Ninject.Extensions.NamedScope.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Web.Common.OwinHost, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Web.Common.OwinHost.3.2.3.0\lib\net45-full\Ninject.Web.Common.OwinHost.dll</HintPath> <Reference Include="Ninject.Extensions.Xml, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Extensions.Xml.3.3.0\lib\net45\Ninject.Extensions.Xml.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Web.WebApi, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Web.WebApi.3.2.4.0\lib\net45-full\Ninject.Web.WebApi.dll</HintPath> <Reference Include="Ninject.Web.Common, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Web.Common.3.3.1\lib\net45\Ninject.Web.Common.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Ninject.Web.WebApi.OwinHost, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Ninject.Web.WebApi.OwinHost.3.2.4.0\lib\net45-full\Ninject.Web.WebApi.OwinHost.dll</HintPath> <Reference Include="Ninject.Web.Common.OwinHost, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Web.Common.OwinHost.3.3.1\lib\net45\Ninject.Web.Common.OwinHost.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <Reference Include="Ninject.Web.Common.WebHost, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Web.Common.WebHost.3.3.1\lib\net45\Ninject.Web.Common.WebHost.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="RazorEngine, Version=3.7.2.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\RazorEngine.3.7.2\lib\net45\RazorEngine.dll</HintPath> <Reference Include="Ninject.Web.WebApi, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Ninject.Web.WebApi.3.3.0\lib\net45\Ninject.Web.WebApi.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="System" /> </Reference>
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="Ninject.Web.WebApi.OwinHost, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Reference Include="System.Configuration" /> <HintPath>..\packages\Ninject.Web.WebApi.OwinHost.3.3.0\lib\net45\Ninject.Web.WebApi.OwinHost.dll</HintPath>
<Reference Include="System.Core" /> <Private>True</Private>
<Reference Include="System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net451\System.Data.SQLite.dll</HintPath> <Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> </Reference>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath> <Reference Include="RazorEngine, Version=3.7.2.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL">
<Private>True</Private> <HintPath>..\packages\RazorEngine.3.7.2\lib\net45\RazorEngine.dll</HintPath>
</Reference> <Private>True</Private>
<Reference Include="System.Web" /> </Reference>
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System" />
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath> <Reference Include="System.ComponentModel.DataAnnotations" />
<Private>True</Private> <Reference Include="System.Configuration" />
</Reference> <Reference Include="System.Core" />
<Reference Include="System.Web.Http.Owin, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll</HintPath> <HintPath>..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net451\System.Data.SQLite.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.0.0\lib\net45\System.Web.Http.WebHost.dll</HintPath> <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Web" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.CSharp" /> <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Reference Include="System.Data" /> <Private>True</Private>
<Reference Include="System.Net.Http" /> </Reference>
<Reference Include="System.ServiceProcess" /> <Reference Include="System.Web.Http.Owin, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Xml" /> <HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll</HintPath>
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL"> <Private>True</Private>
<HintPath>..\packages\WebActivatorEx.2.0\lib\net40\WebActivatorEx.dll</HintPath> </Reference>
<Private>True</Private> <Reference Include="System.Web.Http.WebHost, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
</Reference> <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.0.0\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</ItemGroup> <Private>True</Private>
<ItemGroup> </Reference>
<Compile Include="CardData.cs" /> <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Compile Include="Controllers\ApplicationController.cs" /> <HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
<Compile Include="Controllers\CardsController.cs" /> <Private>True</Private>
<Compile Include="Configuration.cs" /> </Reference>
<Compile Include="Controllers\GroupController.cs" /> <Reference Include="System.Xml.Linq" />
<Compile Include="Controllers\LogsController.cs" /> <Reference Include="System.Data.DataSetExtensions" />
<Compile Include="Controllers\TimelogController.cs" /> <Reference Include="Microsoft.CSharp" />
<Compile Include="DefaultComponents\DefaultLogger.cs" /> <Reference Include="System.Data" />
<Compile Include="Helpers\CacheControlAttribute.cs" /> <Reference Include="System.Net.Http" />
<Compile Include="JsonpFormatter.cs" /> <Reference Include="System.ServiceProcess" />
<Compile Include="NinjectDependencyResolver.cs" /> <Reference Include="System.Xml" />
<Compile Include="NinjectDependencyScope.cs" /> <Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<Compile Include="NinjectHelper.cs" /> <HintPath>..\packages\WebActivatorEx.2.2.0\lib\net40\WebActivatorEx.dll</HintPath>
<Compile Include="RestService_Get.cs" /> <Private>True</Private>
<Compile Include="RestService_Post.cs" /> </Reference>
<Compile Include="DataCenterService.cs"> </ItemGroup>
<SubType>Component</SubType> <ItemGroup>
</Compile> <Compile Include="App_Start\Ninject.Web.Common.cs" />
<Compile Include="DataCenterService.Designer.cs"> <Compile Include="CardData.cs" />
<DependentUpon>DataCenterService.cs</DependentUpon> <Compile Include="Controllers\ApplicationController.cs" />
</Compile> <Compile Include="Controllers\CardsController.cs" />
<Compile Include="Program.cs" /> <Compile Include="Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Controllers\GroupController.cs" />
<Compile Include="StartOwin.cs" /> <Compile Include="Controllers\LogsController.cs" />
<Compile Include="Controllers\SwipeDataController.cs" /> <Compile Include="Controllers\TimelogController.cs" />
<Compile Include="Controllers\UsersController.cs" /> <Compile Include="DefaultComponents\DefaultLogger.cs" />
<Compile Include="Controllers\ValuesController.cs" /> <Compile Include="Helpers\CacheControlAttribute.cs" />
</ItemGroup> <Compile Include="JsonpFormatter.cs" />
<ItemGroup> <Compile Include="NinjectDependencyResolver.cs" />
<Content Include="Minifier\MinifierConfig.xml" /> <Compile Include="NinjectDependencyScope.cs" />
<Content Include="NinjectConfig.xml"> <Compile Include="NinjectHelper.cs" />
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <Compile Include="RestService_Get.cs" />
</Content> <Compile Include="RestService_Post.cs" />
<Content Include="www\Admin.html"> <Compile Include="DataCenterService.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <SubType>Component</SubType>
</Content> </Compile>
<Content Include="www\admin.js"> <Compile Include="DataCenterService.Designer.cs">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <DependentUpon>DataCenterService.cs</DependentUpon>
</Content> </Compile>
<Content Include="www\admin.min.js"> <Compile Include="Program.cs" />
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <Compile Include="Properties\AssemblyInfo.cs" />
</Content> <Compile Include="StartOwin.cs" />
<Content Include="www\css\bootstrap-theme.css"> <Compile Include="Controllers\SwipeDataController.cs" />
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Compile Include="Controllers\UsersController.cs" />
</Content> <Compile Include="Controllers\ValuesController.cs" />
<Content Include="www\css\bootstrap-theme.min.css"> </ItemGroup>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <ItemGroup>
</Content> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\HelpPage.css">
<Content Include="www\css\bootstrap.css"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content>
</Content> <Content Include="Minifier\MinifierConfig.xml" />
<Content Include="www\css\bootstrap.min.css"> <Content Include="NinjectConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\css\knockout.contextmenu.css"> <Content Include="www\Admin.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\favicon.ico"> <Content Include="www\admin.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\fonts\glyphicons-halflings-regular.svg"> <Content Include="www\admin.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\Helpers.js"> <Content Include="www\css\bootstrap-theme.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\Helpers.min.js"> <Content Include="www\css\bootstrap-theme.min.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\index.html"> <Content Include="www\css\bootstrap.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\js\bootstrap.js"> <Content Include="www\css\bootstrap.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\js\bootstrap.min.js"> <Content Include="www\css\highlightjs.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\js\knockout.contextmenu.js"> <Content Include="www\css\knockout.contextmenu.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\spa.css"> <Content Include="www\favicon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\spa.js"> <Content Include="www\fonts\glyphicons-halflings-regular.svg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\spa.min.css"> <Content Include="www\Helpers.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="www\spa.min.js"> <Content Include="www\Helpers.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<None Include="App.config"> <Content Include="www\index.html">
<SubType>Designer</SubType> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\api.cshtml"> <Content Include="www\js\bootstrap.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\ApiGroup.cshtml"> <Content Include="www\js\bootstrap.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\HelpPageApiModel.cshtml"> <Content Include="www\css\easymde.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Parameters.cshtml"> <Content Include="www\js\easymde.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Samples.cshtml"> <Content Include="www\js\highlightjs.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\index.cshtml"> <Content Include="www\js\htmlparser.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="Minifier\Minify.bat" /> <Content Include="www\js\knockout.contextmenu.js">
<None Include="packages.config" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="www\css\bootstrap-theme.css.map"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="www\js\marked.min.js">
</None> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<None Include="www\css\bootstrap-theme.min.css.map"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="www\js\PolicyObject.js">
</None> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="www\css\bootstrap.css.map"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="www\spa.css">
</None> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="www\css\bootstrap.min.css.map"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="www\spa.js">
</None> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="www\fonts\glyphicons-halflings-regular.eot"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="www\spa.min.css">
</None> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="www\fonts\glyphicons-halflings-regular.ttf"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="www\spa.min.js">
</None> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<None Include="www\fonts\glyphicons-halflings-regular.woff"> </Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <None Include="App.config">
</None> <SubType>Designer</SubType>
<None Include="www\fonts\glyphicons-halflings-regular.woff2"> </None>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\api.cshtml">
</None> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</ItemGroup> </Content>
<ItemGroup> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\ApiGroup.cshtml">
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\HelpPage.css"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content>
</Content> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\HelpPageApiModel.cshtml">
<Content Include="sqlite3.def" /> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Content Include="sqlite3.dll" /> </Content>
</ItemGroup> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Parameters.cshtml">
<ItemGroup> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj"> </Content>
<Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Samples.cshtml">
<Name>ConfigurationHandler</Name> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</ProjectReference> </Content>
<ProjectReference Include="..\Interfaces\Interfaces.csproj"> <Content Include="Help\DalSoft.WebApi.HelpPage.Views\index.cshtml">
<Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Name>Interfaces</Name> </Content>
</ProjectReference> <None Include="Minifier\Minify.bat" />
<ProjectReference Include="..\SQLiteRepository\SQLiteRepository.csproj"> <None Include="packages.config" />
<Project>{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}</Project> <None Include="www\css\bootstrap-theme.css.map">
<Name>SQLiteRepository</Name> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</ProjectReference> </None>
</ItemGroup> <None Include="www\css\bootstrap-theme.min.css.map">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" /> </None>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <None Include="www\css\bootstrap.css.map">
<PropertyGroup> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </None>
</PropertyGroup> <None Include="www\css\bootstrap.min.css.map">
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets'))" /> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Target> </None>
<PropertyGroup> <None Include="www\fonts\glyphicons-halflings-regular.eot">
<PreBuildEvent>call "$(ProjectDir)Minifier\Minify.bat" "$(SolutionDir)"</PreBuildEvent> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</PropertyGroup> </None>
<None Include="www\fonts\glyphicons-halflings-regular.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\fonts\glyphicons-halflings-regular.woff">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\fonts\glyphicons-halflings-regular.woff2">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="sqlite3.def" />
<Content Include="sqlite3.dll" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ConfigurationHandler\ConfigurationHandler.csproj">
<Project>{115250F6-F8C4-4F9B-A15F-251EA258D963}</Project>
<Name>ConfigurationHandler</Name>
</ProjectReference>
<ProjectReference Include="..\Interfaces\Interfaces.csproj">
<Project>{B7347B72-E208-423A-9D99-723B558EA3D7}</Project>
<Name>Interfaces</Name>
</ProjectReference>
<ProjectReference Include="..\SQLiteRepository\SQLiteRepository.csproj">
<Project>{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}</Project>
<Name>SQLiteRepository</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>call "$(ProjectDir)Minifier\Minify.bat" "$(SolutionDir)"</PreBuildEvent>
</PropertyGroup>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.104.0\build\net451\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ProjectFiles</ProjectView> <ProjectView>ProjectFiles</ProjectView>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,30 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DalSoft.WebApi.HelpPage" version="0.0.7.0" targetFramework="net452" /> <package id="Castle.Core" version="4.2.0" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net452" /> <package id="DalSoft.WebApi.HelpPage" version="0.0.7.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net452" /> <package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.3" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net452" />
<package id="Microsoft.Owin.FileSystems" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin" version="3.1.0" targetFramework="net452" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.FileSystems" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.StaticFiles" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" /> <package id="Microsoft.Owin.StaticFiles" version="3.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Ninject" version="3.2.2.0" targetFramework="net452" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Ninject.Extensions.ContextPreservation" version="3.2.0.0" targetFramework="net452" /> <package id="Ninject" version="3.3.4" targetFramework="net452" />
<package id="Ninject.Extensions.NamedScope" version="3.2.0.0" targetFramework="net452" /> <package id="Ninject.Extensions.ContextPreservation" version="3.3.1" targetFramework="net452" />
<package id="Ninject.Extensions.Xml" version="3.2.0.0" targetFramework="net452" /> <package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net452" />
<package id="Ninject.Web.Common" version="3.2.3.0" targetFramework="net452" /> <package id="Ninject.Extensions.NamedScope" version="3.3.0" targetFramework="net452" />
<package id="Ninject.Web.Common.OwinHost" version="3.2.3.0" targetFramework="net452" /> <package id="Ninject.Extensions.Xml" version="3.3.0" targetFramework="net452" />
<package id="Ninject.Web.WebApi" version="3.2.4.0" targetFramework="net452" /> <package id="Ninject.Web.Common" version="3.3.1" targetFramework="net452" />
<package id="Ninject.Web.WebApi.OwinHost" version="3.2.4.0" targetFramework="net452" /> <package id="Ninject.Web.Common.OwinHost" version="3.3.1" targetFramework="net452" />
<package id="Owin" version="1.0" targetFramework="net452" /> <package id="Ninject.Web.Common.WebHost" version="3.3.1" targetFramework="net452" />
<package id="RazorEngine" version="3.7.2" targetFramework="net452" /> <package id="Ninject.Web.WebApi" version="3.3.0" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net452" /> <package id="Ninject.Web.WebApi.OwinHost" version="3.3.0" targetFramework="net452" />
<package id="WebActivatorEx" version="2.0" targetFramework="net452" /> <package id="Owin" version="1.0" targetFramework="net452" />
<package id="RazorEngine" version="3.7.2" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net452" />
<package id="WebActivatorEx" version="2.2.0" targetFramework="net452" />
</packages> </packages>

View File

@ -1,109 +1,171 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Flexitime Admin page</title> <title>Flexitime Admin page</title>
<link rel="stylesheet preload" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet preload" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="spa.min.css" rel="stylesheet" /> <link href="spa.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.0.0/knockout-min.js" type="text/javascript"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.0.0/knockout-min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sammy.js/0.7.6/sammy.js" type="text/javascript"></script> <script src="https://cdn.jsdelivr.net/momentjs/2.10.6/moment.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/sammy.js/0.7.6/sammy.js" type="text/javascript"></script>
</head> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<body> <link rel="stylesheet" href="css/easymde.min.css" />
<nav class="navbar navbar-default"> <link rel="stylesheet" href="css/highlightjs.min.css" />
<div class="container-fluid"> </head>
<!-- Brand and toggle get grouped for better mobile display --> <body>
<div class="navbar-header"> <nav class="navbar navbar-default">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <div class="container-fluid">
<span class="sr-only">Toggle navigation</span> <!-- Brand and toggle get grouped for better mobile display -->
<span class="icon-bar"></span> <div class="navbar-header">
<span class="icon-bar"></span> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="icon-bar"></span> <span class="sr-only">Toggle navigation</span>
</button> <span class="icon-bar"></span>
<a class="navbar-brand" href="#">Big Brother</a> <span class="icon-bar"></span>
</div> <span class="icon-bar"></span>
</button>
<!-- Collect the nav links, forms, and other content for toggling --> <a class="navbar-brand" href="#">Big Brother</a>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> </div>
<ul class="nav navbar-nav">
<li><a class="indent-nav-xs" href="index.html">Home</a></li> <!-- Collect the nav links, forms, and other content for toggling -->
<li class="hidden-xs"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<a data-toggle="modal" data-target="#aboutDialog">About</a> <ul class="nav navbar-nav">
</li> <li><a class="indent-nav-xs" href="index.html">Home</a></li>
</ul> <li class="hidden-xs">
</div> <a data-toggle="modal" data-target="#aboutDialog">About</a>
</div> </li>
</nav> </ul>
<div id="GroupAdminPage" class="container"> </div>
<div class="row"> </div>
<h2 class="col-md-4">Groups</h2> </nav>
<button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.newGroupForm"> <div id="GroupAdminPage" class="container">
<span class="glyphicon glyphicon-plus"></span> <div class="row">
</button> <h2 class="col-md-4">Groups</h2>
</div> <button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.newGroupForm">
<hr/> <span class="glyphicon glyphicon-plus"></span>
<div class="row"> </button>
<div data-bind="with: groupsList, css:{'col-md-8': !$root.groupFormHidden(), 'col-md-12':$root.groupFormHidden()}"> </div>
<table class="table table-striped"> <hr />
<thead> <div class="row">
<tr> <div data-bind="with: groupsList, css:{'col-md-8': !$root.groupFormHidden(), 'col-md-12':$root.groupFormHidden()}">
<th>Name</th> <table class="table table-striped">
<th class="col-md-3">User Count</th> <thead>
<th class="col-md-1"></th> <tr>
</tr> <th>Name</th>
</thead> <th class="col-md-3">User Count</th>
<tbody data-bind="foreach: Groups"> <th class="col-md-1"></th>
<tr data-bind="click: $root.editGroupClick"> </tr>
<td class="valign" data-bind="text: Name"></td> </thead>
<td class="valign" data-bind="text: UserCount"></td> <tbody data-bind="foreach: Groups">
<td><button class="btn btn-link" data-bind="enable: UserCount=='0', click: function(data, event){$root.deleteGroup(Id);}" type="button">Delete</button></td> <tr data-bind="click: $root.editGroupClick">
</tr> <td class="valign" data-bind="text: Name"></td>
</tbody> <td class="valign" data-bind="text: UserCount"></td>
</table> <td><button class="btn btn-link" data-bind="enable: UserCount=='0', click: function(data, event){$root.deleteGroup(Id);}" type="button">Delete</button></td>
</div> </tr>
<form method="post" action="#editgroup" data-bind="with: $root.groupEditItem(), css:{'col-md-4':!$root.groupFormHidden()}"> </tbody>
<input type="hidden" name="id" data-bind="value: Id"> </table>
<div class="form-group"> </div>
<label for="groupNameEdit">Group Name</label> <form method="post" action="#editgroup" data-bind="with: $root.groupEditItem(), css:{'col-md-4':!$root.groupFormHidden()}">
<input for="Name" type="text" class="form-control" id="groupNameEdit" placeholder="Group Name" data-bind="value: Name"/> <input type="hidden" name="id" data-bind="value: Id">
</div> <div class="form-group">
<button pageDestination="Users" class="btn btn-secondary" type="button" <label for="groupNameEdit">Group Name</label>
data-bind="click: $root.hideGroupForm">Cancel</button> <input for="Name" type="text" class="form-control" id="groupNameEdit" placeholder="Group Name" data-bind="value: Name" />
</div>
<button type="submit" class="btn btn-primary">Submit</button> <button pageDestination="Users" class="btn btn-secondary" type="button"
</form> data-bind="click: $root.hideGroupForm">
</div> Cancel
</div> </button>
<div id="CardManagement" class="container">
<div class="row"> <button type="submit" class="btn btn-primary">Submit</button>
<h2 class="col-md-4">Unassigned Cards</h2> </form>
<button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.clearUnassignedCards"> </div>
<span class="glyphicon glyphicon-trash"></span> </div>
</button> <div id="CardManagement" class="container">
</div> <div class="row">
<div class="row"> <h2 class="col-md-4">Unassigned Cards</h2>
<div data-bind="with: unassignedCardList"> <button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.clearUnassignedCards">
<table class="table table-striped"> <span class="glyphicon glyphicon-trash"></span>
<thead> </button>
<tr> </div>
<th>Card Unique Id</th> <div class="row">
<th>Last Used Date</th> <div data-bind="with: unassignedCardList">
</tr> <table class="table table-striped">
</thead> <thead>
<tbody data-bind="foreach: data"> <tr>
<tr> <th>Card Unique Id</th>
<td data-bind="text: UniqueId"></td> <th>Last Used Date</th>
<td data-bind="text: $root.convertToDisplayDateTime(LastUsed)"></td> </tr>
</tr> </thead>
</tbody> <tbody data-bind="foreach: data">
</table> <tr>
</div> <td data-bind="text: UniqueId"></td>
</div> <td data-bind="text: $root.convertToDisplayDateTime(LastUsed)"></td>
</div> </tr>
<script src="Helpers.min.js" type="text/javascript"></script> </tbody>
<script src="admin.js" type="text/javascript"></script> </table>
</body> </div>
</div>
</div>
<div id="PolicyManagement" class="container">
<div id="row">
<ul class="nav nav-tabs">
<li class="active"><a href="#edit" data-toggle="tab">Edit</a></li>
<li><a href="#preview" data-toggle="tab">Preview</a></li>
</ul>
<div class="tab-content" style="max-height: 500px; min-height: 400px;overflow-y: auto">
<div id="edit" class="tab-pane fade in active">
<textarea id="policyEditor"></textarea>
</div>
<div id="preview" class="tab-pane fade in">
<div data-bind="html: policyData.html" class="well-lg"></div>
</div>
</div>
<button class="btn btn-primary pull-right" data-toggle="modal" data-target="#saveDialog">Save</button><!--data-bind="click: $root.policySave"-->
<button class="btn btn-secondary pull-right" data-bind="click: $root.policyReload">Cancel</button>
</div>
</div>
<div id="saveDialog" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4>Change Details</h4>
</div>
<div class="modal-body">
<table class="table">
<tr>
<th>Change Author</th>
<td><input class="form-control" id="changeAuthorInput" type="text" data-bind="value: policyData.ChangeAuthor" /></td>
</tr>
<tr>
<th>Change Date</th>
<td><input class="form-control" id="changeDatePicker" type="datetime-local" data-bind="value: policyData.ChangeDate" /></td>
</tr>
<tr>
<th>Version</th>
<td><input class="form-control" id="versionInput" type="text" data-bind="value: policyData.Version" readonly /></td>
</tr>
<tr>
<th>Change Description</th>
<td><input class="form-control" id="changeDescription" type="text" data-bind="value: policyData.ChangeDescription" /></td>
</tr>
</table>
</div>
<div class="modal-footer">
<button class="btn btn-primary pull-right" data-bind="click: $root.policySave">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="js/PolicyObject.js" type="text/javascript"></script>
<script src="Helpers.min.js" type="text/javascript"></script>
<script src="js/easymde.min.js" type="text/javascript"></script>
<script src="js/highlightjs.min.js" type="text/javascript"></script>
<script src="js/htmlparser.min.js" type="text/javascript"></script>
<script src="js/marked.min.js"></script>
<script src="admin.js" type="text/javascript"></script>
</body>
</html> </html>

View File

@ -1,126 +1,221 @@
function AdminVM() { function AdminVM() {
var self = this; var self = this;
self.groupsList = ko.observable(null); self.groupsList = ko.observable(null);
self.groupEditItem = ko.observable(null); self.groupEditItem = ko.observable(null);
self.unassignedCardList = ko.observable(null); self.unassignedCardList = ko.observable(null);
self.helpers = new Helpers(); self.helpers = new Helpers();
self.uiPages = { self.policyMarkdown = "";
overview: "overview", self.policyData = new policy();
group: "groups", self.renderer = new marked.Renderer();
home: function () { return this.overview; } self.renderer.blockquote = function(quote) {
}; return "<blockquote class=\"blockquote\">" + quote + "</blockquote>";
self.apiEndpoints = { };
deleteGroups:"/api/groups/delete", self.renderer.heading = function (text, level) {
getGroups: "/api/groups",
editGroup: "/api/groups/edit", var parserHandler = new Tautologistics.NodeHtmlParser.DefaultHandler(function (error) {
getUnassignedCards: "/api/cards/unassigned", if (error)
clearUnassignedCards: "/api/cards/unassigned" throw new Error("Cannot parse \"" + text + "\" in markdown file.");
}; });
self.clearGroupForm = function () { var parser = new Tautologistics.NodeHtmlParser.Parser(parserHandler);
self.helpers.goToMenuOption(self.uiPages.group);
self.groupEditItem(null); parser.parseComplete(text);
}; var escaped = "unknown";
self.hideGroupForm = function () {
self.groupEditItem(null); if (parserHandler.dom.length > 0) {
}; escaped = parserHandler.dom[0].raw.toLowerCase().trim().replace(/ /g, "-");
self.newGroupForm = function () { }
self.groupEditItem({ Id: -1, Name: "" });
self.helpers.goToMenuOption(self.uiPages.group); return "<h" + level + " id=\"" + escaped + "\">"
}; // NOTE: We're setting display none INLINE, so you have
self.groupFormHidden = ko.computed(function () { // to override with !important if you want it to show.
return self.groupEditItem() == null; + " <a class=\"heading-anchor\" style=\"display:none;\" href=\"#" + escaped + '">'
}, self); + " <i class=\"oi oi-link-intact\"></i>"
self.editGroupClick = function (data) { + " </a>"
self.helpers.goToMenuOption(self.uiPages.group); + text
self.groupEditItem(data); + "</h" + level + ">";
}; };
self.getGroups = function () { self.renderer.table = function(header, body) {
var url = self.helpers.createRequestUrl(self.apiEndpoints.getGroups, null, false); return "<table class=\"table\">" +
$.getJSON(url, function (res) { "<thead class=\"thead-default\">" +
self.groupsList(res); header +
}).fail(function (resp, status, error) { "</thead>" +
console.log("error - getGroups"); "<tbody>" +
var errorObj = self.helpers.processRequestFailure(resp, status, error); body +
}); "</tbody>" +
}; "</table>";
self.deleteGroup = function (groupId) { };
var url = self.helpers.createRequestUrl(self.apiEndpoints.deleteGroups, /*
[{ key: "groupId", value: groupId }], * Adds highlight.js classes to `code` blocks
false, */
false); self.renderer.code = function(code, language) {
$.ajax({
url: url, var valid = !!(language && hljs.getLanguage(language));
type: 'DELETE', var highlighted = valid ? hljs.highlight(language, code).value : code
success: function () {
console.log("deleted " + groupId); return "<pre><code class=\"hljs lang-" + language + "\">" + highlighted + "</code></pre>";
self.hideGroupForm(); };
self.helpers.goToMenuOption(self.uiPages.home()); self.editor = new EasyMDE({
} element: document.getElementById("policyEditor"),
}); showIcons: ["bold", "italic", "strikethrough", "heading", "heading-smaller", "heading-bigger", "heading-1", "heading-2", "heading-3", "code", "quote", "unordered-list", "ordered-list", "clean-block", "link", "table", "horizontal-rule", "guide", "table"],
console.log("delete: " + groupId); hideIcons: ["preview", "side-by-side", "fullscreen"],
}; renderingConfig: {
self.submitGroupEdit = function(group) { markedOptions: {
var url = self.helpers.createRequestUrl(self.apiEndpoints.editGroup, null, false); renderer: self.renderer
$.post(url, group, function () { }
}, "json") }
.done(function () { });
self.groupEditItem(null); self.editor.codemirror.on("changes",
self.helpers.goToMenuOption(self.uiPages.home()); function () {
}) self.policyData.html(self.editor.options.previewRender(self.editor.value()));
.fail(function (resp, status, error) { });
self.helpers.goToMenuOption(self.uiPages.home()); self.uiPages = {
var errorObj = self.helpers.processRequestFailure(resp, status, error); overview: "overview",
}); group: "groups",
}; home: function () { return this.overview; }
self.getUnassignedCardData = function() { };
var url = self.helpers.createRequestUrl(self.apiEndpoints.getUnassignedCards, null, false); self.apiEndpoints = {
$.getJSON(url, deleteGroups:"/api/groups/delete",
function(res) { getGroups: "/api/groups",
self.unassignedCardList(res); editGroup: "/api/groups/edit",
}).fail(function(resp, status, error) { getUnassignedCards: "/api/cards/unassigned",
console.log("error - getUnassignedCards"); clearUnassignedCards: "/api/cards/unassigned",
var errorObj = self.helpers.processRequestFailure(resp, status, error); getPolicy:"/api/app/policy",
}); savePolicy:"/api/app/policy"
}; };
self.clearUnassignedCards = function() { self.clearGroupForm = function () {
var url = self.helpers.createRequestUrl(self.apiEndpoints.clearUnassignedCards, null, false); self.helpers.goToMenuOption(self.uiPages.group);
$.ajax({ self.groupEditItem(null);
type: "DELETE", };
url: url, self.hideGroupForm = function () {
data: "", self.groupEditItem(null);
success: function() { };
self.getUnassignedCardData(); //update self.newGroupForm = function () {
}, self.groupEditItem({ Id: -1, Name: "" });
error: function(jqxhr, status, error) { self.helpers.goToMenuOption(self.uiPages.group);
console.log("error - clearUnassignedCards"); };
var errorObj = self.helpers.processRequestFailure(resp, status, error); self.groupFormHidden = ko.computed(function () {
} return self.groupEditItem() == null;
}); }, self);
}; self.editGroupClick = function (data) {
self.padNumber = function (number) { self.helpers.goToMenuOption(self.uiPages.group);
return (number < 10 ? "0" : "") + number; self.groupEditItem(data);
}; };
self.convertToDisplayDateTime = function (dateValue) { self.getGroups = function () {
var date = new Date(dateValue); // dd MM YY HH:mm:ss e.g.: 01 Mar 17 17:34:02 var url = self.helpers.createRequestUrl(self.apiEndpoints.getGroups, null, false);
return date.getDate() + " " $.getJSON(url, function (res) {
+ date.toLocaleString("en-us", { month: "long" }) + " " self.groupsList(res);
+ (date.getYear()-100) + " " }).fail(function (resp, status, error) {
+ self.padNumber(date.getHours()) + ":" console.log("error - getGroups");
+ self.padNumber(date.getMinutes()) + ":" var errorObj = self.helpers.processRequestFailure(resp, status, error);
+ self.padNumber(date.getSeconds()); });
}; };
Sammy(function () { self.deleteGroup = function (groupId) {
this.disable_push_state = true; var url = self.helpers.createRequestUrl(self.apiEndpoints.deleteGroups,
this.get("#overview", function () { [{ key: "groupId", value: groupId }],
self.getGroups(); false,
self.getUnassignedCardData(); false);
}); $.ajax({
this.post("#editgroup", function () { url: url,
self.submitGroupEdit(self.groupEditItem()); type: "DELETE",
return false; success: function () {
}); console.log("deleted " + groupId);
//default route (home page) self.hideGroupForm();
this.get("", function () { this.app.runRoute("get", "#" + self.uiPages.home()) }); self.helpers.goToMenuOption(self.uiPages.home());
}).run(); }
}; });
console.log("delete: " + groupId);
};
self.submitGroupEdit = function(group) {
var url = self.helpers.createRequestUrl(self.apiEndpoints.editGroup, null, false);
$.post(url, group, function () {
}, "json")
.done(function () {
self.groupEditItem(null);
self.helpers.goToMenuOption(self.uiPages.home());
})
.fail(function (resp, status, error) {
self.helpers.goToMenuOption(self.uiPages.home());
var errorObj = self.helpers.processRequestFailure(resp, status, error);
});
};
self.getUnassignedCardData = function() {
var url = self.helpers.createRequestUrl(self.apiEndpoints.getUnassignedCards, null, false);
$.getJSON(url,
function(res) {
self.unassignedCardList(res);
}).fail(function(resp, status, error) {
console.log("error - getUnassignedCards");
var errorObj = self.helpers.processRequestFailure(resp, status, error);
});
};
self.clearUnassignedCards = function() {
var url = self.helpers.createRequestUrl(self.apiEndpoints.clearUnassignedCards, null, false);
$.ajax({
type: "DELETE",
url: url,
data: "",
success: function() {
self.getUnassignedCardData(); //update
},
error: function(jqxhr, status, error) {
console.log("error - clearUnassignedCards");
var errorObj = self.helpers.processRequestFailure(resp, status, error);
}
});
};
self.padNumber = function (number) {
return (number < 10 ? "0" : "") + number;
};
self.policySave = function () {
var url = self.helpers.createRequestUrl(self.apiEndpoints.savePolicy, null, false);
self.policyData.Markdown(self.editor.value()); //make sure we update it, as it doesnt push the value back into the variable
//console.log(self.policyData());
$.post(url, self.policyData(), function() {
}, "json") //todo: check this serialisation as the object is now complex.
.done(function() {
self.policyReload();
}).fail(function(resp, status, error) {
var errorObj = self.helpers.processRequestFailure(resp, status, error);
console.log(errorObj);
});
};
self.policyReload = function() {
var url = self.helpers.createRequestUrl(self.apiEndpoints.getPolicy,
[], false, false);
$.getJSON(url, function (res) {
//console.log(res);
self.editor.value(res.Markdown);
res.Version = (parseInt(res.Version) + 1).toString();
self.policyData.update(res);
$('#saveDialog').modal('hide');
}).fail(function (resp, status, error) {
console.log("error - policyReload");
var errObj = self.helpers.processRequestFailure(resp, status, error);
self.assignErrorObject(errObj.errorCode, errObj.errorMessage, "policyReload");
});
};
self.convertToDisplayDateTime = function (dateValue) {
var date = new Date(dateValue); // dd MM YY HH:mm:ss e.g.: 01 Mar 17 17:34:02
return date.getDate() + " "
+ date.toLocaleString("en-us", { month: "long" }) + " "
+ (date.getYear()-100) + " "
+ self.padNumber(date.getHours()) + ":"
+ self.padNumber(date.getMinutes()) + ":"
+ self.padNumber(date.getSeconds());
};
Sammy(function () {
this.disable_push_state = true;
this.get("#overview", function () {
self.getGroups();
self.getUnassignedCardData();
self.policyReload();
});
this.post("#editgroup", function () {
self.submitGroupEdit(self.groupEditItem());
return false;
});
//default route (home page)
this.get("", function () { this.app.runRoute("get", "#" + self.uiPages.home()) });
}).run();
};
ko.applyBindings(new AdminVM()); ko.applyBindings(new AdminVM());

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:.5em;background:#F0F0F0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888888}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-selector-pseudo{color:#BC6060}.hljs-literal{color:#78A960}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}

View File

@ -1,59 +1,59 @@
/* knockout.contextmenu v1.0.0 /* knockout.contextmenu v1.0.0
Nicolás Escalante - nlante@gmail.com Nicolás Escalante - nlante@gmail.com
Issues: https://github.com/nescalante/knockout.contextmenu/issues Issues: https://github.com/nescalante/knockout.contextmenu/issues
License: MIT */ License: MIT */
.context-menu { .context-menu {
position: absolute; position: absolute;
padding: 0; padding: 0;
margin: 0; margin: 0;
z-index: 1030; z-index: 1030;
background-color: #ffffff; background-color: #ffffff;
} }
.context-menu ul { .context-menu ul {
line-height: 1.6; line-height: 1.6;
padding: 0; padding: 0;
margin: 0; margin: 0;
border: 1px solid #dddddd; border: 1px solid #dddddd;
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3); box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
} }
.context-menu ul > li { .context-menu ul > li {
padding: 4px 20px; padding: 4px 20px;
margin: 0; margin: 0;
z-index: 1031; z-index: 1031;
list-style-type: none; list-style-type: none;
cursor: pointer; cursor: pointer;
white-space: nowrap; white-space: nowrap;
color: #333333; color: #333333;
} }
.context-menu ul > li:hover { .context-menu ul > li:hover {
background-color: #eeeeee; background-color: #eeeeee;
} }
.context-menu ul > li.disabled, .context-menu ul > li.disabled,
.context-menu ul > li.disabled a { .context-menu ul > li.disabled a {
color: #666666; color: #666666;
cursor: default; cursor: default;
} }
.context-menu ul > li.checked:before { .context-menu ul > li.checked:before {
position: absolute; position: absolute;
content: "\2713"; content: "\2713";
left: 7px; left: 7px;
} }
.context-menu ul > li.with-url { .context-menu ul > li.with-url {
padding: 0; padding: 0;
} }
.context-menu ul > li.with-url a { .context-menu ul > li.with-url a {
display: block; display: block;
padding: 4px 20px; padding: 4px 20px;
text-decoration: none; text-decoration: none;
color: #333333; color: #333333;
} }
.context-menu ul > li.separator { .context-menu ul > li.separator {
margin: 4px 0; margin: 4px 0;
padding: 0; padding: 0;
border-bottom: 1px solid #cccccc; border-bottom: 1px solid #cccccc;
cursor: default; cursor: default;
} }
.context-menu ul > li.separator:hover { .context-menu ul > li.separator:hover {
background-color: #ffffff; background-color: #ffffff;
} }

View File

@ -1,459 +1,459 @@
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */ /*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
html { html {
font-family: sans-serif; font-family: sans-serif;
line-height: 1.15; line-height: 1.15;
-ms-text-size-adjust: 100%; -ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;
} }
body { body {
margin: 0; margin: 0;
} }
article, article,
aside, aside,
footer, footer,
header, header,
nav, nav,
section { section {
display: block; display: block;
} }
h1 { h1 {
font-size: 2em; font-size: 2em;
margin: 0.67em 0; margin: 0.67em 0;
} }
figcaption, figcaption,
figure, figure,
main { main {
display: block; display: block;
} }
figure { figure {
margin: 1em 40px; margin: 1em 40px;
} }
hr { hr {
-webkit-box-sizing: content-box; -webkit-box-sizing: content-box;
box-sizing: content-box; box-sizing: content-box;
height: 0; height: 0;
overflow: visible; overflow: visible;
} }
pre { pre {
font-family: monospace, monospace; font-family: monospace, monospace;
font-size: 1em; font-size: 1em;
} }
a { a {
background-color: transparent; background-color: transparent;
-webkit-text-decoration-skip: objects; -webkit-text-decoration-skip: objects;
} }
a:active, a:active,
a:hover { a:hover {
outline-width: 0; outline-width: 0;
} }
abbr[title] { abbr[title] {
border-bottom: none; border-bottom: none;
text-decoration: underline; text-decoration: underline;
text-decoration: underline dotted; text-decoration: underline dotted;
} }
b, b,
strong { strong {
font-weight: inherit; font-weight: inherit;
} }
b, b,
strong { strong {
font-weight: bolder; font-weight: bolder;
} }
code, code,
kbd, kbd,
samp { samp {
font-family: monospace, monospace; font-family: monospace, monospace;
font-size: 1em; font-size: 1em;
} }
dfn { dfn {
font-style: italic; font-style: italic;
} }
mark { mark {
background-color: #ff0; background-color: #ff0;
color: #000; color: #000;
} }
small { small {
font-size: 80%; font-size: 80%;
} }
sub, sub,
sup { sup {
font-size: 75%; font-size: 75%;
line-height: 0; line-height: 0;
position: relative; position: relative;
vertical-align: baseline; vertical-align: baseline;
} }
sub { sub {
bottom: -0.25em; bottom: -0.25em;
} }
sup { sup {
top: -0.5em; top: -0.5em;
} }
audio, audio,
video { video {
display: inline-block; display: inline-block;
} }
audio:not([controls]) { audio:not([controls]) {
display: none; display: none;
height: 0; height: 0;
} }
img { img {
border-style: none; border-style: none;
} }
svg:not(:root) { svg:not(:root) {
overflow: hidden; overflow: hidden;
} }
button, button,
input, input,
optgroup, optgroup,
select, select,
textarea { textarea {
font-family: sans-serif; font-family: sans-serif;
font-size: 100%; font-size: 100%;
line-height: 1.15; line-height: 1.15;
margin: 0; margin: 0;
} }
button, button,
input { input {
overflow: visible; overflow: visible;
} }
button, button,
select { select {
text-transform: none; text-transform: none;
} }
button, button,
html [type="button"], html [type="button"],
[type="reset"], [type="reset"],
[type="submit"] { [type="submit"] {
-webkit-appearance: button; -webkit-appearance: button;
} }
button::-moz-focus-inner, button::-moz-focus-inner,
[type="button"]::-moz-focus-inner, [type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner { [type="submit"]::-moz-focus-inner {
border-style: none; border-style: none;
padding: 0; padding: 0;
} }
button:-moz-focusring, button:-moz-focusring,
[type="button"]:-moz-focusring, [type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring, [type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring { [type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText; outline: 1px dotted ButtonText;
} }
fieldset { fieldset {
border: 1px solid #c0c0c0; border: 1px solid #c0c0c0;
margin: 0 2px; margin: 0 2px;
padding: 0.35em 0.625em 0.75em; padding: 0.35em 0.625em 0.75em;
} }
legend { legend {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
color: inherit; color: inherit;
display: table; display: table;
max-width: 100%; max-width: 100%;
padding: 0; padding: 0;
white-space: normal; white-space: normal;
} }
progress { progress {
display: inline-block; display: inline-block;
vertical-align: baseline; vertical-align: baseline;
} }
textarea { textarea {
overflow: auto; overflow: auto;
} }
[type="checkbox"], [type="checkbox"],
[type="radio"] { [type="radio"] {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
} }
[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button { [type="number"]::-webkit-outer-spin-button {
height: auto; height: auto;
} }
[type="search"] { [type="search"] {
-webkit-appearance: textfield; -webkit-appearance: textfield;
outline-offset: -2px; outline-offset: -2px;
} }
[type="search"]::-webkit-search-cancel-button, [type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration { [type="search"]::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
} }
::-webkit-file-upload-button { ::-webkit-file-upload-button {
-webkit-appearance: button; -webkit-appearance: button;
font: inherit; font: inherit;
} }
details, details,
menu { menu {
display: block; display: block;
} }
summary { summary {
display: list-item; display: list-item;
} }
canvas { canvas {
display: inline-block; display: inline-block;
} }
template { template {
display: none; display: none;
} }
[hidden] { [hidden] {
display: none; display: none;
} }
html { html {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
*, *,
*::before, *::before,
*::after { *::after {
-webkit-box-sizing: inherit; -webkit-box-sizing: inherit;
box-sizing: inherit; box-sizing: inherit;
} }
@-ms-viewport { @-ms-viewport {
width: device-width; width: device-width;
} }
html { html {
-ms-overflow-style: scrollbar; -ms-overflow-style: scrollbar;
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
} }
body { body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 1rem; font-size: 1rem;
font-weight: normal; font-weight: normal;
line-height: 1.5; line-height: 1.5;
color: #292b2c; color: #292b2c;
background-color: #fff; background-color: #fff;
} }
[tabindex="-1"]:focus { [tabindex="-1"]:focus {
outline: none !important; outline: none !important;
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
margin-top: 0; margin-top: 0;
margin-bottom: .5rem; margin-bottom: .5rem;
} }
p { p {
margin-top: 0; margin-top: 0;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
abbr[title], abbr[title],
abbr[data-original-title] { abbr[data-original-title] {
cursor: help; cursor: help;
} }
address { address {
margin-bottom: 1rem; margin-bottom: 1rem;
font-style: normal; font-style: normal;
line-height: inherit; line-height: inherit;
} }
ol, ol,
ul, ul,
dl { dl {
margin-top: 0; margin-top: 0;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
ol ol, ol ol,
ul ul, ul ul,
ol ul, ol ul,
ul ol { ul ol {
margin-bottom: 0; margin-bottom: 0;
} }
dt { dt {
font-weight: bold; font-weight: bold;
} }
dd { dd {
margin-bottom: .5rem; margin-bottom: .5rem;
margin-left: 0; margin-left: 0;
} }
blockquote { blockquote {
margin: 0 0 1rem; margin: 0 0 1rem;
} }
a { a {
color: #0275d8; color: #0275d8;
text-decoration: none; text-decoration: none;
} }
a:focus, a:hover { a:focus, a:hover {
color: #014c8c; color: #014c8c;
text-decoration: underline; text-decoration: underline;
} }
a:not([href]):not([tabindex]) { a:not([href]):not([tabindex]) {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
a:not([href]):not([tabindex]):focus { a:not([href]):not([tabindex]):focus {
outline: 0; outline: 0;
} }
pre { pre {
margin-top: 0; margin-top: 0;
margin-bottom: 1rem; margin-bottom: 1rem;
overflow: auto; overflow: auto;
} }
figure { figure {
margin: 0 0 1rem; margin: 0 0 1rem;
} }
img { img {
vertical-align: middle; vertical-align: middle;
} }
[role="button"] { [role="button"] {
cursor: pointer; cursor: pointer;
} }
a, a,
area, area,
button, button,
[role="button"], [role="button"],
input, input,
label, label,
select, select,
summary, summary,
textarea { textarea {
-ms-touch-action: manipulation; -ms-touch-action: manipulation;
touch-action: manipulation; touch-action: manipulation;
} }
table { table {
border-collapse: collapse; border-collapse: collapse;
background-color: transparent; background-color: transparent;
} }
caption { caption {
padding-top: 0.75rem; padding-top: 0.75rem;
padding-bottom: 0.75rem; padding-bottom: 0.75rem;
color: #636c72; color: #636c72;
text-align: left; text-align: left;
caption-side: bottom; caption-side: bottom;
} }
th { th {
text-align: left; text-align: left;
} }
label { label {
display: inline-block; display: inline-block;
margin-bottom: .5rem; margin-bottom: .5rem;
} }
button:focus { button:focus {
outline: 1px dotted; outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color; outline: 5px auto -webkit-focus-ring-color;
} }
input, input,
button, button,
select, select,
textarea { textarea {
line-height: inherit; line-height: inherit;
} }
input[type="radio"]:disabled, input[type="radio"]:disabled,
input[type="checkbox"]:disabled { input[type="checkbox"]:disabled {
cursor: not-allowed; cursor: not-allowed;
} }
input[type="date"], input[type="date"],
input[type="time"], input[type="time"],
input[type="datetime-local"], input[type="datetime-local"],
input[type="month"] { input[type="month"] {
-webkit-appearance: listbox; -webkit-appearance: listbox;
} }
textarea { textarea {
resize: vertical; resize: vertical;
} }
fieldset { fieldset {
min-width: 0; min-width: 0;
padding: 0; padding: 0;
margin: 0; margin: 0;
border: 0; border: 0;
} }
legend { legend {
display: block; display: block;
width: 100%; width: 100%;
padding: 0; padding: 0;
margin-bottom: .5rem; margin-bottom: .5rem;
font-size: 1.5rem; font-size: 1.5rem;
line-height: inherit; line-height: inherit;
} }
input[type="search"] { input[type="search"] {
-webkit-appearance: none; -webkit-appearance: none;
} }
output { output {
display: inline-block; display: inline-block;
} }
[hidden] { [hidden] {
display: none !important; display: none !important;
} }
/*# sourceMappingURL=bootstrap-reboot.css.map */ /*# sourceMappingURL=bootstrap-reboot.css.map */

File diff suppressed because one or more lines are too long

View File

@ -86,8 +86,23 @@
<thead> <thead>
<tr> <tr>
<th class="col-md-1"></th> <th class="col-md-1"></th>
<th class="col-md-3">First Name</th> <th class="col-md-3">
<th class="col-md-3">Last Name</th> <div class="col-md-1">
<a href="#users?sort=firstAsc"><span data-bind="css:{ 'text-warning': $root.sortIsActive('firstAsc')}" class="glyphicon glyphicon-chevron-up"></span></a>
</div>
<div class="col-md-1">
<a href="#users?sort=firstDesc"><span data-bind="css:{ 'text-warning': $root.sortIsActive('firstDesc')}" class="glyphicon glyphicon-chevron-down"></span></a>
</div>
<span class="col-md-9">First Name</span>
</th>
<th class="col-md-3">
<div class="col-md-1">
<a href="#users?sort=lastAsc"><span data-bind="css:{ 'text-warning': $root.sortIsActive('lastAsc')}" class="glyphicon glyphicon-chevron-up"></span></a>
</div>
<div class="col-md-1">
<a href="#users?sort=lastDesc"><span data-bind="css:{ 'text-warning': $root.sortIsActive('lastDesc')}"class="glyphicon glyphicon-chevron-down"></span></a>
</div>
<span class="col-md-9">Last Name</span></th>
<th class="col-md-1 text-center">Contractor</th> <th class="col-md-1 text-center">Contractor</th>
<th/> <th/>
<th/> <th/>
@ -302,6 +317,11 @@
</menu> </menu>
</menu>--> </menu>-->
</div> </div>
<div class="container" data-bind="with: policyData">
<div class="row" data-bind="html:Html">
</div>
</div>
<div id="aboutDialog" class="modal fade" role="dialog" data-bind="with: appDetails"> <div id="aboutDialog" class="modal fade" role="dialog" data-bind="with: appDetails">
<div class="modal-dialog"> <div class="modal-dialog">
@ -330,6 +350,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Dialog to create a manual time entry-->
<div id="manualLogDialog" class="modal fade" role="dialog" data-bind="with: manualLog"> <div id="manualLogDialog" class="modal fade" role="dialog" data-bind="with: manualLog">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
@ -350,7 +371,8 @@
optionsText: function(item) { return item.Text }, optionsText: function(item) { return item.Text },
optionsValue: function(item){ return item.value }, optionsValue: function(item){ return item.value },
value: Direction, value: Direction,
optionsCaption: 'Choose...'"></select> optionsCaption: 'Choose...'"
required></select>
</div> </div>
</div> </div>
<br/> <br/>

View File

@ -0,0 +1,30 @@
function policy(data) {
var self = this;
if (typeof data === "undefined") {
data = createDefaultPolicy();
}
self.changeDate = ko.observable(data.changeDate);
self.description = ko.observable(data.description);
self.changeAuthor = ko.observable(data.changeAuthor);
self.version = ko.observable(data.version);
self.markdown = ko.observable(data.markdown);
self.html = ko.observable(data.html);
function createDefaultPolicy() {
return {
changeDate: moment().format(),
description: "",
changeAuthor: "",
version: -1,
markdown: "",
html: ""
};
}
self.update = function(data) {
self.changeDate(data.changeDate);
self.description(data.description);
self.changeAuthor(data.changeAuthor);
self.version(data.version);
self.markdown(data.markdown);
self.html(data.html);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,36 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<appSettings> <appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" /> <add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DefaultPageSize" value="20" /> <add key="DefaultPageSize" value="20" />
<add key="SwipeTimeGap" value="3" /> <add key="SwipeTimeGap" value="3" />
<add key="BugSubmissionEmailAddress" value="incoming+WattsC/FlexiTimeTrackerTool+24qrefn8e1urhl4iqct7we2jl@gitlab.com"/> <add key="BugSubmissionEmailAddress" value="incoming+WattsC/FlexiTimeTrackerTool+24qrefn8e1urhl4iqct7we2jl@gitlab.com" />
</appSettings> </appSettings>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> <dependentAssembly>
</runtime> <assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.Common" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Ninject.Web.Common.OwinHost" publicKeyToken="c7192dc5380945e7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>

View File

@ -1,133 +1,137 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5A4E2CF2-FA51-413E-82C7-14A19A50766D}</ProjectGuid> <ProjectGuid>{5A4E2CF2-FA51-413E-82C7-14A19A50766D}</ProjectGuid>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsDataServiceHost</RootNamespace> <RootNamespace>WindowsDataServiceHost</RootNamespace>
<AssemblyName>WindowsDataServiceHost</AssemblyName> <AssemblyName>WindowsDataServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath> <OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath> <OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Owin.FileSystems, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Microsoft.Owin.Host.HttpListener, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<Reference Include="System.Core" /> <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath> </Reference>
<Private>True</Private> <Reference Include="System" />
</Reference> <Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath> <Private>True</Private>
<Private>True</Private> </Reference>
</Reference> <Reference Include="System.ServiceProcess" />
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath> <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Data.DataSetExtensions" /> <HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
<Reference Include="Microsoft.CSharp" /> <Private>True</Private>
<Reference Include="System.Data" /> </Reference>
<Reference Include="System.Net.Http" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" /> <Reference Include="System.Data.DataSetExtensions" />
</ItemGroup> <Reference Include="Microsoft.CSharp" />
<ItemGroup> <Reference Include="System.Data" />
<Compile Include="Program.cs" /> <Reference Include="System.Net.Http" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config"> <Compile Include="Program.cs" />
<SubType>Designer</SubType> <Compile Include="Properties\AssemblyInfo.cs" />
</None> </ItemGroup>
<None Include="packages.config" /> <ItemGroup>
</ItemGroup> <None Include="App.config">
<ItemGroup> <SubType>Designer</SubType>
<ProjectReference Include="..\WindowsDataCenter\WindowsDataCenter.csproj"> </None>
<Project>{A5FEE048-17A6-4966-9B6B-BF073592A470}</Project> <None Include="packages.config" />
<Name>WindowsDataCenter</Name> </ItemGroup>
</ProjectReference> <ItemGroup>
</ItemGroup> <ProjectReference Include="..\WindowsDataCenter\WindowsDataCenter.csproj">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Project>{A5FEE048-17A6-4966-9B6B-BF073592A470}</Project>
<PropertyGroup> <Name>WindowsDataCenter</Name>
<PostBuildEvent>copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLiteRepository.dll" "$(TargetDir)" </ProjectReference>
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Win32.dll" "$(TargetDir)" </ItemGroup>
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Generic.dll" "$(TargetDir)" <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.dll" "$(TargetDir)" <PropertyGroup>
mkdir "$(TargetDir)Configs" <PostBuildEvent>copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLiteRepository.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)" copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Win32.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)" copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Generic.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)" copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\" mkdir "$(TargetDir)Configs"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)" copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)RazorEngine.dll" "$(TargetDir)"</PostBuildEvent> copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\"
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> copy "$(SolutionDir)WindowsDataCenter\$(OutDir)RazorEngine.dll" "$(TargetDir)"</PostBuildEvent>
</Target> </PropertyGroup>
<Target Name="AfterBuild"> <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
</Target> Other similar extension points exist, see Microsoft.Common.targets.
--> <Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.FileSystems" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.FileSystems" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Host.HttpListener" version="3.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Owin" version="1.0" targetFramework="net452" /> <package id="Owin" version="1.0" targetFramework="net452" />
</packages> </packages>

BIN
Tools/Sentinel.zip Normal file

Binary file not shown.