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
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderService", "CardReaderService.csproj", "{5F30E8E4-5107-4C99-ADFF-38D735DC113D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderServiceHost", "..\CardReaderServiceHost\CardReaderServiceHost.csproj", "{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderService", "CardReaderService\CardReaderService.csproj", "{5F30E8E4-5107-4C99-ADFF-38D735DC113D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardReaderServiceHost", "CardReaderServiceHost\CardReaderServiceHost.csproj", "{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logger", "Logger\Logger.csproj", "{42EFE386-DC2E-455A-BA81-5FC9CEE45D02}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux Conf", "Linux Conf", "{F9053F37-761D-45EE-9153-46776B083DBA}"
ProjectSection(SolutionItems) = preProject
CardReaderService.conf = CardReaderService.conf
install.sh = install.sh
uninstall.sh = uninstall.sh
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F30E8E4-5107-4C99-ADFF-38D735DC113D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{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>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<appSettings>
<add key="DataCenterServiceEndpoint" value="http://localhost:1234"/>
</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"?>
<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>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderService</RootNamespace>
<AssemblyName>CardReaderService</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="pcsc-sharp, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\PCSC.3.6.0\lib\net40\pcsc-sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConfigureService.cs" />
<Compile Include="DataCenterHelper.cs" />
<Compile Include="Service1.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Service1.Designer.cs">
<DependentUpon>Service1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</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>
-->
<?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>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderService</RootNamespace>
<AssemblyName>CardReaderService</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PCSC, Version=4.2.0.0, Culture=neutral, PublicKeyToken=13b76e54a2ee80a7, processorArchitecture=MSIL">
<HintPath>..\packages\PCSC.4.2.0\lib\net40\PCSC.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CardDataPost.cs" />
<Compile Include="ConfigurationManager.cs" />
<Compile Include="ConfigurationProperty.cs" />
<Compile Include="ConfigurationType.cs" />
<Compile Include="ConfigureService.cs" />
<Compile Include="DataCenterHelper.cs" />
<Compile Include="Service1.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Service1.Designer.cs">
<DependentUpon>Service1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<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>

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

View File

@ -1,10 +1,13 @@
using PCSC;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using Logger;
using PCSC.Monitoring;
namespace CardReaderService
{
@ -12,14 +15,15 @@ namespace CardReaderService
{
private Thread _mainWorkThread;
private bool _stopMainWorkerThread;
private AutoResetEvent _mainWorkerTerminationSignal;
private string _readerName = "";
private readonly ManualResetEvent _mre;
private string _readerName = string.Empty;
private SCardMonitor _cardMonitor;
private bool _initialised=false;
public Service1()
{
InitializeComponent();
_mre = new ManualResetEvent(false);
}
public void Start()
@ -27,44 +31,54 @@ namespace CardReaderService
OnStart(new string[] { });
}
protected override void OnStart(string[] args)
{
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()
public new void Stop()
{
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()
{
MessageLogger.Log("Stopping..");
_stopMainWorkerThread = true;
_mainWorkerTerminationSignal.Set();
_mre.Set();
if (_mainWorkThread != null && _mainWorkThread.IsAlive)
{
_mainWorkThread.Interrupt();
_mainWorkThread.Join(3000);
if (_mainWorkThread.IsAlive)
{
_mainWorkThread.Interrupt();
}
}
if (_cardMonitor != null)
{
_cardMonitor.CardInserted -= CardMonitor_CardInserted;
_cardMonitor.StatusChanged -= CardMonitorOnStatusChanged;
_cardMonitor.Cancel();
_cardMonitor.Dispose();
_cardMonitor = null;
@ -79,96 +93,110 @@ namespace CardReaderService
Name = "CardServiceMainThread",
IsBackground = false
};
_mainWorkerTerminationSignal = new AutoResetEvent(false);
_mainWorkThread.Start();
}
private void _cardMonitor_CardInserted(object sender, CardStatusEventArgs e)
private void CardMonitor_CardInserted(object sender, CardStatusEventArgs e)
{
var ctxFac = ContextFactory.Instance;
using (var ctx = ctxFac.Establish(SCardScope.System))
try
{
var reader = new SCardReader(ctx);
var pioSendPci = new IntPtr();
byte[] rcvBuffer = new byte[256];
if (_readerName == string.Empty)
var ctxFac = ContextFactory.Instance;
using (var ctx = ctxFac.Establish(SCardScope.System))
{
Console.WriteLine("Reader name is somehow empty... WTF!");
_stopMainWorkerThread = true;
return;
}
var reader = new SCardReader(ctx);
byte[] rcvBuffer = new byte[256];
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 uIdcmd = new byte[] { 0xFF, 0xCA, 0x00, 0x00, 0x00 };
err = reader.Transmit(pioSendPci, uIdcmd, ref rcvBuffer);
var err = reader.Connect(_readerName, SCardShareMode.Shared, SCardProtocol.Any);
if (err == SCardError.Success)
{
var uid = ConvertByteUIDToString(rcvBuffer);
var atrString = ConvertByteUIDToString(e.Atr);
Console.WriteLine("Card Inserted, ATR: " + atrString + ", and UID is: " + uid);
var pci = SCardPCI.GetPci(reader.ActiveProtocol);
CardDataPost postObj = new CardDataPost { CardUId = uid };
DataCenterHelper.PostAsync(postObj, "/api/swipedata");
Console.WriteLine("Posted to Server");
err = reader.Transmit(pci, CardCommands.GetUid, ref rcvBuffer);
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
{
Console.WriteLine("Reader failed to connect, error: " + Enum.GetName(typeof(SCardError), err));
}
}
catch (Exception ex)
{
MessageLogger.Log("Exception has occurred in Card Inserted Event handler. Exception: "+ ex);
throw;
}
}
private void MainWorkerThread()
{
var minimumLoopTimemS = 5000;
while (!_stopMainWorkerThread)
{
if (!WeHaveValidCardReader())
{ //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");
if (_cardMonitor == null)
{
var ctxFactory = ContextFactory.Instance;
using (var context = ctxFactory.Establish(SCardScope.System))
{
var readerNames = context.GetReaders();
if (!NoReaderAvailable(readerNames))
if (NoReaderAvailable(readerNames))
{
//we have a reader available, so initialise!
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;
MessageLogger.Log("No Card Reader available, Waiting..");
}
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)
{
var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
foreach (var b in uid)
{
@ -183,4 +211,9 @@ namespace CardReaderService
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"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="PCSC" version="3.6.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
<package id="PCSC" version="4.2.0" targetFramework="net45" />
</packages>

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
</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" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml"/>
<add key="DataCenterServiceEndpoint" value="http://localhost:8800"/>
</appSettings>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DataCenterServiceEndpoint" value="http://localhost:8800" />
</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>

View File

@ -1,125 +1,127 @@
<?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>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderService</RootNamespace>
<AssemblyName>CardReaderService</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.Xml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.Xml.3.2.0.0\lib\net45-full\Ninject.Extensions.Xml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="pcsc-sharp, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PCSC.3.6.0\lib\net40\pcsc-sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration.cs" />
<Compile Include="ConfigureService.cs" />
<Compile Include="DataCenterHelper.cs" />
<Compile Include="DefaultComponents\DefaultLogger.cs" />
<Compile Include="NinjectHelper.cs" />
<Compile Include="CardReaderService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CardReaderService.Designer.cs">
<DependentUpon>CardReaderService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</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>
</ItemGroup>
<ItemGroup>
<Content Include="NinjectConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?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>{5F30E8E4-5107-4C99-ADFF-38D735DC113D}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderService</RootNamespace>
<AssemblyName>CardReaderService</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.Xml, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.Xml.3.3.0\lib\net45\Ninject.Extensions.Xml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="pcsc-sharp, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PCSC.3.6.0\lib\net40\pcsc-sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration.cs" />
<Compile Include="ConfigureService.cs" />
<Compile Include="DataCenterHelper.cs" />
<Compile Include="DefaultComponents\DefaultLogger.cs" />
<Compile Include="DefaultComponents\LogFileLogger.cs" />
<Compile Include="NinjectHelper.cs" />
<Compile Include="CardReaderService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CardReaderService.Designer.cs">
<DependentUpon>CardReaderService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</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>
</ItemGroup>
<ItemGroup>
<Content Include="NinjectConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</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" ?>
<module name="NinjectAssemblies">
<bind service="Interfaces.ILogger, Interfaces"
to="NLogLogger.NLogger, NLogLogger" scope="singleton" />
to="CardReaderService.DefaultComponents.LogFileLogger, CardReaderService" scope="singleton" />
</module>

View File

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

View File

@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml"/>
<add key="DataCenterServiceEndpoint" value="http://localhost:1234"/>
</appSettings>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DataCenterServiceEndpoint" value="http://localhost:1234" />
</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>

View File

@ -1,101 +1,101 @@
<?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>{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderServiceHost</RootNamespace>
<AssemblyName>CardReaderServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" />
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CardReaderService\CardReaderService.csproj">
<Project>{5f30e8e4-5107-4c99-adff-38d735dc113d}</Project>
<Name>CardReaderService</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(TargetDir)Configs"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- 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>
-->
<?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>{6E48913F-9D8C-4132-93A7-C7B1C6DD5264}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CardReaderServiceHost</RootNamespace>
<AssemblyName>CardReaderServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" />
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CardReaderService\CardReaderService.csproj">
<Project>{5f30e8e4-5107-4c99-adff-38d735dc113d}</Project>
<Name>CardReaderService</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(TargetDir)Configs"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- 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

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

View File

@ -30,8 +30,18 @@
<Component Id="SmartCardServiceConfig" Guid="{73D2E31D-F256-457C-AFD5-EC456CDAD7E8}" KeyPath="yes">
<ServiceControl Id="SmartCardServiceStarter"
Start="install"
Stop="install"
Name="SCardSvr"
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 Id="CardReaderServiceExe" Guid="{24C9D834-21E2-476D-8302-EF35730D0BA8}">
<File Id="CardReaderService.exe"
@ -61,6 +71,7 @@
ThirdFailureActionType="restart"
ResetPeriodInDays="1"
RestartServiceDelayInSeconds="10" />
<ServiceDependency Id="SCardSvr" Group="no"/>
</ServiceInstall>
</Component>
<Component Id="CardReaderServiceExeConfig" Guid="{E20D23BC-C8E7-49F8-962C-DE856A84258E}">

View File

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

View File

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

View File

@ -1,86 +1,89 @@
<?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>{B7347B72-E208-423A-9D99-723B558EA3D7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Interfaces</RootNamespace>
<AssemblyName>Interfaces</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</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="AppDetails.cs" />
<Compile Include="DailyLogs.cs" />
<Compile Include="EventLogResponse.cs" />
<Compile Include="Group.cs" />
<Compile Include="GroupList.cs" />
<Compile Include="ILogger.cs" />
<Compile Include="IRepository.cs" />
<Compile Include="Identifier.cs" />
<Compile Include="IdentifierList.cs" />
<Compile Include="ManualLog.cs" />
<Compile Include="OperationResponse.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TimeLog.cs" />
<Compile Include="TimeLogList.cs" />
<Compile Include="User.cs" />
<Compile Include="UserList.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?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>{B7347B72-E208-423A-9D99-723B558EA3D7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Interfaces</RootNamespace>
<AssemblyName>Interfaces</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</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="AppDetails.cs" />
<Compile Include="DailyLogs.cs" />
<Compile Include="EventLogResponse.cs" />
<Compile Include="Group.cs" />
<Compile Include="GroupList.cs" />
<Compile Include="ILogger.cs" />
<Compile Include="IRepository.cs" />
<Compile Include="Identifier.cs" />
<Compile Include="IdentifierList.cs" />
<Compile Include="ManualLog.cs" />
<Compile Include="OperationResponse.cs" />
<Compile Include="Policy.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SortOptions.cs" />
<Compile Include="TimeLog.cs" />
<Compile Include="TimeLogList.cs" />
<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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</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;
namespace Interfaces
{
public class UserList
{
public UserList()
{
Users = new List<User>();
PageSize = 10;
}
public string Query { get; set; }
public int UserCount { get { return Users.Count; } }
public int TotalUserCount { get; set; }
public List<User> Users { get; set; }
public int PageCount
{
get
{
if (TotalUserCount < PageSize)
return 1;
return (TotalUserCount / PageSize);
}
}
public Group GroupFilter { get; set; }
public int PageSize { get; set; }
public int PageNumber { get; set; }
}
using System;
using System.Collections.Generic;
namespace Interfaces
{
public class UserList
{
public UserList()
{
Users = new List<User>();
PageSize = 10;
}
public string Query { get; set; }
public int UserCount { get { return Users.Count; } }
public int TotalUserCount { get; set; }
public List<User> Users { get; set; }
public SortOptions SelectedSortOption { get; set; }
public int PageCount
{
get
{
if (TotalUserCount < PageSize)
return 1;
return (int)Math.Ceiling(Convert.ToDouble(TotalUserCount) / Convert.ToDouble(PageSize));
}
}
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"?>
<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>{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NLogLogger</RootNamespace>
<AssemblyName>NLogLogger</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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="NLogger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="NLogConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<?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>{1C5220D6-9166-4F47-B57D-BEB4D09D2A3F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NLogLogger</RootNamespace>
<AssemblyName>NLogLogger</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<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="NLogger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="NLogConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.4.2" targetFramework="net452" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.4.2" targetFramework="net452" />
</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
{
internal static class SQLiteProcedures
{
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) + "=?";
public const string GET_TIMELOGS =
@ -11,20 +16,18 @@ namespace SQLiteRepository
nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)";
public const string GET_ALL_USERS =
"select * from " + nameof(UserIdentity) + " ut "
"select * 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') )"
+ "order by "
+ nameof(UserIdentity.LastName) + " collate nocase, "
+ nameof(UserIdentity.FirstName) + " collate nocase";
+ " 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') )"
+ "order by ? collate nocase ?, ? collate nocase ?";
public const string GET_ALL_USERS_PAGINATE =
"select * from " + nameof(UserIdentity) + " ut "
@ -38,18 +41,18 @@ namespace SQLiteRepository
+ "select " + nameof(GroupDb.GroupId)
+ " from " + nameof(GroupDb)
+ " where " + nameof(GroupDb.GroupName) + " = 'Archived') )"
+ "order by "
+ nameof(UserIdentity.LastName) + " collate nocase, "
+ nameof(UserIdentity.FirstName) + " collate nocase "
+ "limit ? offset ?";
+ " order by "
+ "{0} collate nocase {1}, "
+ "{2} collate nocase {3} "
+ "limit {4} offset {5}";
public const string GET_ALL_USERS_BY_GROUP =
"select u." + nameof(UserIdentity.Id) + ", u." + nameof(UserIdentity.FirstName) + ", u." +
nameof(UserIdentity.LastName) + ", u." + nameof(UserIdentity.HoursPerWeek) + ", u." +
nameof(UserIdentity.IsContractor) + " from " + nameof(UserIdentity) + " u left join " +
nameof(UserGroupJoinDb) + " ugj on ugj." + nameof(UserGroupJoinDb.UserId_FK) + " = u." +
nameof(UserIdentity.Id) + " where ugj." + nameof(UserGroupJoinDb.GroupId_FK) + "=? order by u." +
nameof(UserIdentity.LastName) + " collate nocase, u." + nameof(UserIdentity.LastName) + " collate nocase";
nameof(UserIdentity.Id) + " where ugj." + nameof(UserGroupJoinDb.GroupId_FK) + "= {0} " +
"order by u.{1} collate nocase {2}, u.{3} collate nocase {4}";
public const string GET_USER_BY_ID =
"select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?";
@ -60,6 +63,9 @@ namespace SQLiteRepository
public const string GET_CARDS_BY_UNIQUE_ID =
"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 =
"select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?";
@ -88,9 +94,82 @@ namespace SQLiteRepository
nameof(TimeLogDb.SwipeEventDateTime) + " desc LIMIT 1";
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 =
"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"?>
<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>{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SQLiteRepository</RootNamespace>
<AssemblyName>SQLiteRepository</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<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>
<Private>True</Private>
</Reference>
<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>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<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>
<Private>True</Private>
</Reference>
<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="CardUniqueId.cs" />
<Compile Include="DBVersion.cs" />
<Compile Include="GroupDb.cs" />
<Compile Include="LogSourceDb.cs" />
<Compile Include="SQLiteRepository.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SQLiteProcedures.cs" />
<Compile Include="LogDirectionDb.cs" />
<Compile Include="TimeLogDb.cs" />
<Compile Include="UserGroupJoinDb.cs" />
<Compile Include="UserIdentity.cs" />
</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>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="UpgradeScripts\0.2.sql" />
</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>
<?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>{B3510C81-F069-48A2-B826-EBE0CE7AB0B2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SQLiteRepository</RootNamespace>
<AssemblyName>SQLiteRepository</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<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>
<Private>True</Private>
</Reference>
<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>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<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>
<Private>True</Private>
</Reference>
<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="CardUniqueId.cs" />
<Compile Include="Converters\IdentifierConverter.cs" />
<Compile Include="Converters\LogDirectionConverter.cs" />
<Compile Include="Converters\LogSourceConverter.cs" />
<Compile Include="Converters\PolicyConverter.cs" />
<Compile Include="Converters\TimeLogConverter.cs" />
<Compile Include="Converters\UserConverter.cs" />
<Compile Include="DBVersion.cs" />
<Compile Include="Extensions\Extensions.cs" />
<Compile Include="GroupDb.cs" />
<Compile Include="LogSourceDb.cs" />
<Compile Include="PolicyDb.cs" />
<Compile Include="SQLiteRepository.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SQLiteProcedures.cs" />
<Compile Include="LogDirectionDb.cs" />
<Compile Include="TimeLogDb.cs" />
<Compile Include="UserGroupJoinDb.cs" />
<Compile Include="UserIdentity.cs" />
</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>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="UpgradeScripts\0.2.sql" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</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"?>
<packages>
<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="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net452" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<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="System.Data.SQLite.Core" version="1.0.104.0" targetFramework="net452" />
</packages>

View File

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

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
{
public class CardData
{
public string CardUId { get; set; }
}
using System;
namespace WindowsDataCenter
{
public class CardData
{
public DateTime? UtcTimeStamp { get; set; }
public string CardUId { get; set; }
}
}

View File

@ -1,26 +1,51 @@
using System.Reflection;
using System.Web.Http;
using Interfaces;
namespace WindowsDataCenter
{
[RoutePrefix("api/app")]
public class ApplicationController:ApiController
{
[Route("")]
public IHttpActionResult GetAppDetails()
{
var ninjectHelper = NinjectHelper.GetInstance();
var appDetails = new AppDetails
{
ApplicationName = "Flexitime Tracker",
DataBaseProvider = ninjectHelper.Get<IRepository>().GetType().ToString(),
LoggerProvider = ninjectHelper.Get<ILogger>().GetType().ToString(),
Version = Assembly.GetEntryAssembly().GetName().Version.ToString(),
ErrorEmailAddress = ConfigurationHandler.ConfigurationHandler.GetConfiguration("BugSubmissionEmailAddress") ?? "NONE"
};
return Ok(appDetails);
}
}
}
using System.Reflection;
using System.Web.Http;
using WindowsDataCenter.Helpers;
using Interfaces;
namespace WindowsDataCenter
{
[RoutePrefix("api/app")]
public class ApplicationController:ApiController
{
private IRepository _repo;
public ApplicationController(IRepository repo)
{
_repo = repo;
}
[Route("")]
public IHttpActionResult GetAppDetails()
{
var ninjectHelper = NinjectHelper.GetInstance();
var appDetails = new 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.Net;
using System.Net.Http;
using System.Web.Http;
using Interfaces;
namespace WindowsDataCenter
{
/// <summary>
///
/// </summary>
[RoutePrefix("api/swipedata")]
public class SwipeDataController : ApiController
{
private readonly IRepository _repo;
private readonly ILogger _logger;
/// <summary>
///
/// </summary>
/// <param name="repo"></param>
/// <param name="logger"></param>
public SwipeDataController(IRepository repo, ILogger logger)
{
if(repo == null) throw new ArgumentNullException(nameof(repo));
_repo = repo;
if(logger == null) throw new ArgumentNullException(nameof(logger));
_logger = logger;
}
/// <summary>
///
/// </summary>
/// <param name="cData"></param>
/// <returns></returns>
[HttpPost]
[Route("")]
public IHttpActionResult PostData([FromBody] CardData cData)
{
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,
DateTime.UtcNow, resp.Direction);
return Ok(new {Id = logId, resp.Direction});
}
}
using System;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Interfaces;
namespace WindowsDataCenter
{
/// <summary>
///
/// </summary>
[RoutePrefix("api/swipedata")]
public class SwipeDataController : ApiController
{
private readonly IRepository _repo;
private readonly ILogger _logger;
/// <summary>
///
/// </summary>
/// <param name="repo"></param>
/// <param name="logger"></param>
public SwipeDataController(IRepository repo, ILogger logger)
{
if(repo == null) throw new ArgumentNullException(nameof(repo));
_repo = repo;
if(logger == null) throw new ArgumentNullException(nameof(logger));
_logger = logger;
}
/// <summary>
///
/// </summary>
/// <param name="cData"></param>
/// <returns></returns>
[HttpPost]
[Route("")]
public IHttpActionResult PostData([FromBody] CardData cData)
{
int logId;
var id = new Identifier {UniqueId = cData.CardUId};
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 = ""
, [FromUri] int pageSize = -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;
pageSize = GetPageSize(pageSize);
var userList = query != string.Empty
? _repo.Search(query)
: groupId != -1
? _repo.GetUsers(groupId: groupId)
: _repo.GetUsers(pageNumber, pageSize);
? _repo.GetUsers(groupId: groupId, sort:sort)
: _repo.GetUsers(pageNumber, pageSize, sort:sort);
_logger.Trace("Got UserList from Repository, UserCount: {0}", userList.UserCount);
if (query != string.Empty)
{
@ -57,6 +58,7 @@ namespace WindowsDataCenter
userList.PageNumber = pageNumber;
userList.PageSize = pageSize;
userList.SelectedSortOption = sort;
_logger.Trace("Returning UserList from GetUsers.");
var msg = Request.CreateResponse(HttpStatusCode.OK, userList);
@ -93,8 +95,7 @@ namespace WindowsDataCenter
{
int userId;
_repo.UpdateUser(user, out userId);
//TODO return ID.
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent("unknownIdTODO")});
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent(userId.ToString())});
}
[HttpPost]

View File

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

View File

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

View File

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

View File

@ -1,37 +1,37 @@
@using System.Net.Http.Headers
@using DalSoft.WebApi.HelpPage.SampleGeneration
@model IDictionary<MediaTypeHeaderValue, object>
@{
// 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 mediaTypes = samples.Keys;
}
<div>
@{
foreach (var mediaType in mediaTypes)
{
<h4 class="sample-header">@mediaType</h4>
<div class="sample-content">
<span><b>Sample:</b></span>
@{ var sample = samples[mediaType]; }
@if (sample == null)
{
<p>Sample not available.</p>
}
else if (sample is TextSample)
{
<pre class="wrapped">@(((TextSample)sample).Text)</pre>
}
else if (sample is ImageSample)
{
<img src="@(((ImageSample)sample).Src)"/>
}
else if (sample is InvalidSample)
{
<div class="warning-message-container">@(((InvalidSample)sample).ErrorMessage)</div>
}
</div>
}
}
@using System.Net.Http.Headers
@using DalSoft.WebApi.HelpPage.SampleGeneration
@model IDictionary<MediaTypeHeaderValue, object>
@{
// 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 mediaTypes = samples.Keys;
}
<div>
@{
foreach (var mediaType in mediaTypes)
{
<h4 class="sample-header">@mediaType</h4>
<div class="sample-content">
<span><b>Sample:</b></span>
@{ var sample = samples[mediaType]; }
@if (sample == null)
{
<p>Sample not available.</p>
}
else if (sample is TextSample)
{
<pre class="wrapped">@(((TextSample)sample).Text)</pre>
}
else if (sample is ImageSample)
{
<img src="@(((ImageSample)sample).Src)"/>
}
else if (sample is InvalidSample)
{
<div class="warning-message-container">@(((InvalidSample)sample).ErrorMessage)</div>
}
</div>
}
}
</div>

View File

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

View File

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

View File

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

View File

@ -1,350 +1,389 @@
<?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>{A5FEE048-17A6-4966-9B6B-BF073592A470}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsDataCenter</RootNamespace>
<AssemblyName>WindowsDataCenter</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DalSoft.WebApi.HelpPage, Version=0.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DalSoft.WebApi.HelpPage.0.0.7.0\lib\net451\DalSoft.WebApi.HelpPage.dll</HintPath>
<Private>True</Private>
</Reference>
<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>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.FileSystems, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener, 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>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Hosting, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.StaticFiles, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.ContextPreservation, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.ContextPreservation.3.2.0.0\lib\net45-full\Ninject.Extensions.ContextPreservation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.NamedScope, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.NamedScope.3.2.0.0\lib\net45-full\Ninject.Extensions.NamedScope.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.Xml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.Xml.3.2.0.0\lib\net45-full\Ninject.Extensions.Xml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.Common, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.Common.3.2.3.0\lib\net45-full\Ninject.Web.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.Common.OwinHost, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.Common.OwinHost.3.2.3.0\lib\net45-full\Ninject.Web.Common.OwinHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.WebApi, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.WebApi.3.2.4.0\lib\net45-full\Ninject.Web.WebApi.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.WebApi.OwinHost, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.WebApi.OwinHost.3.2.4.0\lib\net45-full\Ninject.Web.WebApi.OwinHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RazorEngine, Version=3.7.2.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL">
<HintPath>..\packages\RazorEngine.3.7.2\lib\net45\RazorEngine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<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>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Formatting, 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>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.Owin, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.0.0\lib\net45\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<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.ServiceProcess" />
<Reference Include="System.Xml" />
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<HintPath>..\packages\WebActivatorEx.2.0\lib\net40\WebActivatorEx.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CardData.cs" />
<Compile Include="Controllers\ApplicationController.cs" />
<Compile Include="Controllers\CardsController.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="Controllers\GroupController.cs" />
<Compile Include="Controllers\LogsController.cs" />
<Compile Include="Controllers\TimelogController.cs" />
<Compile Include="DefaultComponents\DefaultLogger.cs" />
<Compile Include="Helpers\CacheControlAttribute.cs" />
<Compile Include="JsonpFormatter.cs" />
<Compile Include="NinjectDependencyResolver.cs" />
<Compile Include="NinjectDependencyScope.cs" />
<Compile Include="NinjectHelper.cs" />
<Compile Include="RestService_Get.cs" />
<Compile Include="RestService_Post.cs" />
<Compile Include="DataCenterService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DataCenterService.Designer.cs">
<DependentUpon>DataCenterService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StartOwin.cs" />
<Compile Include="Controllers\SwipeDataController.cs" />
<Compile Include="Controllers\UsersController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Minifier\MinifierConfig.xml" />
<Content Include="NinjectConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\Admin.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\admin.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\admin.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap-theme.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap-theme.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\knockout.contextmenu.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\favicon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\fonts\glyphicons-halflings-regular.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\Helpers.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\Helpers.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\js\bootstrap.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\bootstrap.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\knockout.contextmenu.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.min.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\api.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\ApiGroup.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\HelpPageApiModel.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Parameters.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Samples.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\index.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Minifier\Minify.bat" />
<None Include="packages.config" />
<None Include="www\css\bootstrap-theme.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\bootstrap-theme.min.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\bootstrap.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\bootstrap.min.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\fonts\glyphicons-halflings-regular.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</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="Help\DalSoft.WebApi.HelpPage.Views\HelpPage.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<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" />
<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>
<PropertyGroup>
<PreBuildEvent>call "$(ProjectDir)Minifier\Minify.bat" "$(SolutionDir)"</PreBuildEvent>
</PropertyGroup>
<?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>{A5FEE048-17A6-4966-9B6B-BF073592A470}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsDataCenter</RootNamespace>
<AssemblyName>WindowsDataCenter</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\WindowsDataCenter.XML</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<DocumentationFile>bin\ReleaseInstallers\WindowsDataCenter.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.2.0\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DalSoft.WebApi.HelpPage, Version=0.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DalSoft.WebApi.HelpPage.0.0.7.0\lib\net451\DalSoft.WebApi.HelpPage.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.FileSystems, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener, 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>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Hosting, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.StaticFiles, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.ContextPreservation, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.ContextPreservation.3.3.1\lib\net45\Ninject.Extensions.ContextPreservation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.Factory, Version=3.3.2.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.NamedScope, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.NamedScope.3.3.0\lib\net45\Ninject.Extensions.NamedScope.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Extensions.Xml, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Extensions.Xml.3.3.0\lib\net45\Ninject.Extensions.Xml.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.Common, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.Common.3.3.1\lib\net45\Ninject.Web.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.Common.OwinHost, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.Common.OwinHost.3.3.1\lib\net45\Ninject.Web.Common.OwinHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.Common.WebHost, Version=3.3.1.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.Common.WebHost.3.3.1\lib\net45\Ninject.Web.Common.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.WebApi, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.WebApi.3.3.0\lib\net45\Ninject.Web.WebApi.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ninject.Web.WebApi.OwinHost, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>..\packages\Ninject.Web.WebApi.OwinHost.3.3.0\lib\net45\Ninject.Web.WebApi.OwinHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RazorEngine, Version=3.7.2.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a, processorArchitecture=MSIL">
<HintPath>..\packages\RazorEngine.3.7.2\lib\net45\RazorEngine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<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>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Formatting, 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>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.Owin, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.0.0\lib\net45\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<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.ServiceProcess" />
<Reference Include="System.Xml" />
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<HintPath>..\packages\WebActivatorEx.2.2.0\lib\net40\WebActivatorEx.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\Ninject.Web.Common.cs" />
<Compile Include="CardData.cs" />
<Compile Include="Controllers\ApplicationController.cs" />
<Compile Include="Controllers\CardsController.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="Controllers\GroupController.cs" />
<Compile Include="Controllers\LogsController.cs" />
<Compile Include="Controllers\TimelogController.cs" />
<Compile Include="DefaultComponents\DefaultLogger.cs" />
<Compile Include="Helpers\CacheControlAttribute.cs" />
<Compile Include="JsonpFormatter.cs" />
<Compile Include="NinjectDependencyResolver.cs" />
<Compile Include="NinjectDependencyScope.cs" />
<Compile Include="NinjectHelper.cs" />
<Compile Include="RestService_Get.cs" />
<Compile Include="RestService_Post.cs" />
<Compile Include="DataCenterService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DataCenterService.Designer.cs">
<DependentUpon>DataCenterService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StartOwin.cs" />
<Compile Include="Controllers\SwipeDataController.cs" />
<Compile Include="Controllers\UsersController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\HelpPage.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Minifier\MinifierConfig.xml" />
<Content Include="NinjectConfig.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\Admin.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\admin.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\admin.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap-theme.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap-theme.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\bootstrap.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\highlightjs.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\knockout.contextmenu.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\favicon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\fonts\glyphicons-halflings-regular.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\Helpers.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\Helpers.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\js\bootstrap.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\bootstrap.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\css\easymde.min.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\easymde.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\highlightjs.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\htmlparser.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\knockout.contextmenu.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\js\marked.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="www\js\PolicyObject.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.min.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="www\spa.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\api.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\ApiGroup.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\HelpPageApiModel.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Parameters.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\DisplayTemplates\Samples.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Help\DalSoft.WebApi.HelpPage.Views\index.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Minifier\Minify.bat" />
<None Include="packages.config" />
<None Include="www\css\bootstrap-theme.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\bootstrap-theme.min.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\bootstrap.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\css\bootstrap.min.css.map">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="www\fonts\glyphicons-halflings-regular.eot">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</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.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>

View File

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

View File

@ -1,30 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DalSoft.WebApi.HelpPage" version="0.0.7.0" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" 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.Host.HttpListener" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.StaticFiles" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Ninject" version="3.2.2.0" targetFramework="net452" />
<package id="Ninject.Extensions.ContextPreservation" version="3.2.0.0" targetFramework="net452" />
<package id="Ninject.Extensions.NamedScope" version="3.2.0.0" targetFramework="net452" />
<package id="Ninject.Extensions.Xml" version="3.2.0.0" targetFramework="net452" />
<package id="Ninject.Web.Common" version="3.2.3.0" targetFramework="net452" />
<package id="Ninject.Web.Common.OwinHost" version="3.2.3.0" targetFramework="net452" />
<package id="Ninject.Web.WebApi" version="3.2.4.0" targetFramework="net452" />
<package id="Ninject.Web.WebApi.OwinHost" version="3.2.4.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.0" targetFramework="net452" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.2.0" targetFramework="net452" />
<package id="DalSoft.WebApi.HelpPage" version="0.0.7.0" targetFramework="net452" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net452" />
<package id="Microsoft.Owin" version="3.1.0" 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.Hosting" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.StaticFiles" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Ninject" version="3.3.4" targetFramework="net452" />
<package id="Ninject.Extensions.ContextPreservation" version="3.3.1" targetFramework="net452" />
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net452" />
<package id="Ninject.Extensions.NamedScope" version="3.3.0" targetFramework="net452" />
<package id="Ninject.Extensions.Xml" version="3.3.0" targetFramework="net452" />
<package id="Ninject.Web.Common" version="3.3.1" targetFramework="net452" />
<package id="Ninject.Web.Common.OwinHost" version="3.3.1" targetFramework="net452" />
<package id="Ninject.Web.Common.WebHost" version="3.3.1" targetFramework="net452" />
<package id="Ninject.Web.WebApi" version="3.3.0" targetFramework="net452" />
<package id="Ninject.Web.WebApi.OwinHost" version="3.3.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>

View File

@ -1,109 +1,171 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Flexitime Admin page</title>
<link rel="stylesheet preload" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<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/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://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Big Brother</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a class="indent-nav-xs" href="index.html">Home</a></li>
<li class="hidden-xs">
<a data-toggle="modal" data-target="#aboutDialog">About</a>
</li>
</ul>
</div>
</div>
</nav>
<div id="GroupAdminPage" class="container">
<div class="row">
<h2 class="col-md-4">Groups</h2>
<button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.newGroupForm">
<span class="glyphicon glyphicon-plus"></span>
</button>
</div>
<hr/>
<div class="row">
<div data-bind="with: groupsList, css:{'col-md-8': !$root.groupFormHidden(), 'col-md-12':$root.groupFormHidden()}">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th class="col-md-3">User Count</th>
<th class="col-md-1"></th>
</tr>
</thead>
<tbody data-bind="foreach: Groups">
<tr data-bind="click: $root.editGroupClick">
<td class="valign" data-bind="text: Name"></td>
<td class="valign" data-bind="text: UserCount"></td>
<td><button class="btn btn-link" data-bind="enable: UserCount=='0', click: function(data, event){$root.deleteGroup(Id);}" type="button">Delete</button></td>
</tr>
</tbody>
</table>
</div>
<form method="post" action="#editgroup" data-bind="with: $root.groupEditItem(), css:{'col-md-4':!$root.groupFormHidden()}">
<input type="hidden" name="id" data-bind="value: Id">
<div class="form-group">
<label for="groupNameEdit">Group Name</label>
<input for="Name" type="text" class="form-control" id="groupNameEdit" placeholder="Group Name" data-bind="value: Name"/>
</div>
<button pageDestination="Users" class="btn btn-secondary" type="button"
data-bind="click: $root.hideGroupForm">Cancel</button>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
<div id="CardManagement" class="container">
<div class="row">
<h2 class="col-md-4">Unassigned Cards</h2>
<button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.clearUnassignedCards">
<span class="glyphicon glyphicon-trash"></span>
</button>
</div>
<div class="row">
<div data-bind="with: unassignedCardList">
<table class="table table-striped">
<thead>
<tr>
<th>Card Unique Id</th>
<th>Last Used Date</th>
</tr>
</thead>
<tbody data-bind="foreach: data">
<tr>
<td data-bind="text: UniqueId"></td>
<td data-bind="text: $root.convertToDisplayDateTime(LastUsed)"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="Helpers.min.js" type="text/javascript"></script>
<script src="admin.js" type="text/javascript"></script>
</body>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Flexitime Admin page</title>
<link rel="stylesheet preload" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<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/knockout/3.0.0/knockout-min.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://cdnjs.cloudflare.com/ajax/libs/sammy.js/0.7.6/sammy.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/easymde.min.css" />
<link rel="stylesheet" href="css/highlightjs.min.css" />
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Big Brother</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a class="indent-nav-xs" href="index.html">Home</a></li>
<li class="hidden-xs">
<a data-toggle="modal" data-target="#aboutDialog">About</a>
</li>
</ul>
</div>
</div>
</nav>
<div id="GroupAdminPage" class="container">
<div class="row">
<h2 class="col-md-4">Groups</h2>
<button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.newGroupForm">
<span class="glyphicon glyphicon-plus"></span>
</button>
</div>
<hr />
<div class="row">
<div data-bind="with: groupsList, css:{'col-md-8': !$root.groupFormHidden(), 'col-md-12':$root.groupFormHidden()}">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th class="col-md-3">User Count</th>
<th class="col-md-1"></th>
</tr>
</thead>
<tbody data-bind="foreach: Groups">
<tr data-bind="click: $root.editGroupClick">
<td class="valign" data-bind="text: Name"></td>
<td class="valign" data-bind="text: UserCount"></td>
<td><button class="btn btn-link" data-bind="enable: UserCount=='0', click: function(data, event){$root.deleteGroup(Id);}" type="button">Delete</button></td>
</tr>
</tbody>
</table>
</div>
<form method="post" action="#editgroup" data-bind="with: $root.groupEditItem(), css:{'col-md-4':!$root.groupFormHidden()}">
<input type="hidden" name="id" data-bind="value: Id">
<div class="form-group">
<label for="groupNameEdit">Group Name</label>
<input for="Name" type="text" class="form-control" id="groupNameEdit" placeholder="Group Name" data-bind="value: Name" />
</div>
<button pageDestination="Users" class="btn btn-secondary" type="button"
data-bind="click: $root.hideGroupForm">
Cancel
</button>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
<div id="CardManagement" class="container">
<div class="row">
<h2 class="col-md-4">Unassigned Cards</h2>
<button class="col-md-1 btn btn-default pull-right" style="margin-top: 20px;" data-bind="click: $root.clearUnassignedCards">
<span class="glyphicon glyphicon-trash"></span>
</button>
</div>
<div class="row">
<div data-bind="with: unassignedCardList">
<table class="table table-striped">
<thead>
<tr>
<th>Card Unique Id</th>
<th>Last Used Date</th>
</tr>
</thead>
<tbody data-bind="foreach: data">
<tr>
<td data-bind="text: UniqueId"></td>
<td data-bind="text: $root.convertToDisplayDateTime(LastUsed)"></td>
</tr>
</tbody>
</table>
</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>

View File

@ -1,126 +1,221 @@
function AdminVM() {
var self = this;
self.groupsList = ko.observable(null);
self.groupEditItem = ko.observable(null);
self.unassignedCardList = ko.observable(null);
self.helpers = new Helpers();
self.uiPages = {
overview: "overview",
group: "groups",
home: function () { return this.overview; }
};
self.apiEndpoints = {
deleteGroups:"/api/groups/delete",
getGroups: "/api/groups",
editGroup: "/api/groups/edit",
getUnassignedCards: "/api/cards/unassigned",
clearUnassignedCards: "/api/cards/unassigned"
};
self.clearGroupForm = function () {
self.helpers.goToMenuOption(self.uiPages.group);
self.groupEditItem(null);
};
self.hideGroupForm = function () {
self.groupEditItem(null);
};
self.newGroupForm = function () {
self.groupEditItem({ Id: -1, Name: "" });
self.helpers.goToMenuOption(self.uiPages.group);
};
self.groupFormHidden = ko.computed(function () {
return self.groupEditItem() == null;
}, self);
self.editGroupClick = function (data) {
self.helpers.goToMenuOption(self.uiPages.group);
self.groupEditItem(data);
};
self.getGroups = function () {
var url = self.helpers.createRequestUrl(self.apiEndpoints.getGroups, null, false);
$.getJSON(url, function (res) {
self.groupsList(res);
}).fail(function (resp, status, error) {
console.log("error - getGroups");
var errorObj = self.helpers.processRequestFailure(resp, status, error);
});
};
self.deleteGroup = function (groupId) {
var url = self.helpers.createRequestUrl(self.apiEndpoints.deleteGroups,
[{ key: "groupId", value: groupId }],
false,
false);
$.ajax({
url: url,
type: 'DELETE',
success: function () {
console.log("deleted " + groupId);
self.hideGroupForm();
self.helpers.goToMenuOption(self.uiPages.home());
}
});
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.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();
});
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();
};
function AdminVM() {
var self = this;
self.groupsList = ko.observable(null);
self.groupEditItem = ko.observable(null);
self.unassignedCardList = ko.observable(null);
self.helpers = new Helpers();
self.policyMarkdown = "";
self.policyData = new policy();
self.renderer = new marked.Renderer();
self.renderer.blockquote = function(quote) {
return "<blockquote class=\"blockquote\">" + quote + "</blockquote>";
};
self.renderer.heading = function (text, level) {
var parserHandler = new Tautologistics.NodeHtmlParser.DefaultHandler(function (error) {
if (error)
throw new Error("Cannot parse \"" + text + "\" in markdown file.");
});
var parser = new Tautologistics.NodeHtmlParser.Parser(parserHandler);
parser.parseComplete(text);
var escaped = "unknown";
if (parserHandler.dom.length > 0) {
escaped = parserHandler.dom[0].raw.toLowerCase().trim().replace(/ /g, "-");
}
return "<h" + level + " id=\"" + escaped + "\">"
// NOTE: We're setting display none INLINE, so you have
// to override with !important if you want it to show.
+ " <a class=\"heading-anchor\" style=\"display:none;\" href=\"#" + escaped + '">'
+ " <i class=\"oi oi-link-intact\"></i>"
+ " </a>"
+ text
+ "</h" + level + ">";
};
self.renderer.table = function(header, body) {
return "<table class=\"table\">" +
"<thead class=\"thead-default\">" +
header +
"</thead>" +
"<tbody>" +
body +
"</tbody>" +
"</table>";
};
/*
* Adds highlight.js classes to `code` blocks
*/
self.renderer.code = function(code, language) {
var valid = !!(language && hljs.getLanguage(language));
var highlighted = valid ? hljs.highlight(language, code).value : code
return "<pre><code class=\"hljs lang-" + language + "\">" + highlighted + "</code></pre>";
};
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"],
hideIcons: ["preview", "side-by-side", "fullscreen"],
renderingConfig: {
markedOptions: {
renderer: self.renderer
}
}
});
self.editor.codemirror.on("changes",
function () {
self.policyData.html(self.editor.options.previewRender(self.editor.value()));
});
self.uiPages = {
overview: "overview",
group: "groups",
home: function () { return this.overview; }
};
self.apiEndpoints = {
deleteGroups:"/api/groups/delete",
getGroups: "/api/groups",
editGroup: "/api/groups/edit",
getUnassignedCards: "/api/cards/unassigned",
clearUnassignedCards: "/api/cards/unassigned",
getPolicy:"/api/app/policy",
savePolicy:"/api/app/policy"
};
self.clearGroupForm = function () {
self.helpers.goToMenuOption(self.uiPages.group);
self.groupEditItem(null);
};
self.hideGroupForm = function () {
self.groupEditItem(null);
};
self.newGroupForm = function () {
self.groupEditItem({ Id: -1, Name: "" });
self.helpers.goToMenuOption(self.uiPages.group);
};
self.groupFormHidden = ko.computed(function () {
return self.groupEditItem() == null;
}, self);
self.editGroupClick = function (data) {
self.helpers.goToMenuOption(self.uiPages.group);
self.groupEditItem(data);
};
self.getGroups = function () {
var url = self.helpers.createRequestUrl(self.apiEndpoints.getGroups, null, false);
$.getJSON(url, function (res) {
self.groupsList(res);
}).fail(function (resp, status, error) {
console.log("error - getGroups");
var errorObj = self.helpers.processRequestFailure(resp, status, error);
});
};
self.deleteGroup = function (groupId) {
var url = self.helpers.createRequestUrl(self.apiEndpoints.deleteGroups,
[{ key: "groupId", value: groupId }],
false,
false);
$.ajax({
url: url,
type: "DELETE",
success: function () {
console.log("deleted " + groupId);
self.hideGroupForm();
self.helpers.goToMenuOption(self.uiPages.home());
}
});
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());

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

View File

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

File diff suppressed because one or more lines are too long

View File

@ -86,8 +86,23 @@
<thead>
<tr>
<th class="col-md-1"></th>
<th class="col-md-3">First Name</th>
<th class="col-md-3">Last Name</th>
<th class="col-md-3">
<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/>
<th/>
@ -302,6 +317,11 @@
</menu>
</menu>-->
</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 class="modal-dialog">
@ -330,6 +350,7 @@
</div>
</div>
</div>
<!-- Dialog to create a manual time entry-->
<div id="manualLogDialog" class="modal fade" role="dialog" data-bind="with: manualLog">
<div class="modal-dialog">
<div class="modal-content">
@ -350,7 +371,8 @@
optionsText: function(item) { return item.Text },
optionsValue: function(item){ return item.value },
value: Direction,
optionsCaption: 'Choose...'"></select>
optionsCaption: 'Choose...'"
required></select>
</div>
</div>
<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"?>
<configuration>
<appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DefaultPageSize" value="20" />
<add key="SwipeTimeGap" value="3" />
<add key="BugSubmissionEmailAddress" value="incoming+WattsC/FlexiTimeTrackerTool+24qrefn8e1urhl4iqct7we2jl@gitlab.com"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="NLogConfigFilePath" value="Configs/NLogConfig.xml" />
<add key="DefaultPageSize" value="20" />
<add key="SwipeTimeGap" value="3" />
<add key="BugSubmissionEmailAddress" value="incoming+WattsC/FlexiTimeTrackerTool+24qrefn8e1urhl4iqct7we2jl@gitlab.com" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<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>

View File

@ -1,133 +1,137 @@
<?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>{5A4E2CF2-FA51-413E-82C7-14A19A50766D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsDataServiceHost</RootNamespace>
<AssemblyName>WindowsDataServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener, 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>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http.Formatting, 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>
<Private>True</Private>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WindowsDataCenter\WindowsDataCenter.csproj">
<Project>{A5FEE048-17A6-4966-9B6B-BF073592A470}</Project>
<Name>WindowsDataCenter</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLiteRepository.dll" "$(TargetDir)"
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Win32.dll" "$(TargetDir)"
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Generic.dll" "$(TargetDir)"
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.dll" "$(TargetDir)"
mkdir "$(TargetDir)Configs"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)RazorEngine.dll" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- 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>
-->
<?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>{5A4E2CF2-FA51-413E-82C7-14A19A50766D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsDataServiceHost</RootNamespace>
<AssemblyName>WindowsDataServiceHost</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugInstallers|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\DebugInstallers\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseInstallers|AnyCPU'">
<OutputPath>bin\ReleaseInstallers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.FileSystems, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Owin.Host.HttpListener, 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>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http.Formatting, 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>
<Private>True</Private>
</Reference>
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WindowsDataCenter\WindowsDataCenter.csproj">
<Project>{A5FEE048-17A6-4966-9B6B-BF073592A470}</Project>
<Name>WindowsDataCenter</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLiteRepository.dll" "$(TargetDir)"
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Win32.dll" "$(TargetDir)"
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.Platform.Generic.dll" "$(TargetDir)"
copy "$(SolutionDir)SQLiteRepository\$(OutDir)SQLite.Net.dll" "$(TargetDir)"
mkdir "$(TargetDir)Configs"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLog.dll" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogLogger.dll.config" "$(TargetDir)"
copy "$(SolutionDir)NLogLogger\$(OutDir)NLogConfig.xml" "$(TargetDir)Configs\"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)Ninject.Extensions.Xml.dll" "$(TargetDir)"
copy "$(SolutionDir)WindowsDataCenter\$(OutDir)RazorEngine.dll" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- 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

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

BIN
Tools/Sentinel.zip Normal file

Binary file not shown.