Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions DataInputt/DataInputt.Tests/DataInputt.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -9,7 +8,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DataInputt.Tests</RootNamespace>
<AssemblyName>DataInputt.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
Expand All @@ -19,6 +18,7 @@
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -38,40 +38,21 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataInputt\DataInputt.csproj">
<Project>{5E84912A-4948-49FE-BFFF-465A7FDC2C1C}</Project>
<Name>DataInputt</Name>
</ProjectReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.2.0</Version>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>1.2.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Protobuf Include="ProtoZeitService.proto" GrpcServices="Both" />
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
<PackageReference Include="Grpc.Core" Version="2.32.0" />
<PackageReference Include="Grpc.Tools" Version="2.32.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
40 changes: 40 additions & 0 deletions DataInputt/DataInputt.ZeitService.Api/IDataInputService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;

namespace DataInputt.ZeitService.Api
{
public interface IDataInputService
{
int CreateUser(User user);

int Login(User user);

List<Time> GetTimes(int userId);

void AddTime(Time time, int userId);

List<string> Projects();

decimal CalculateEarnings(int? id);
}

public class User
{
public string Name { get; set; }

public string Passwort { get; set; }
}

public class Time
{
public DateTime Start { get; set; }

public DateTime End { get; set; }

public string Project { get; set; }

public int uId { get; set; }

public int Id { get; set; }
}
}
47 changes: 47 additions & 0 deletions DataInputt/DataInputt.ZeitService.Api/MappingExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace DataInputt.ZeitService.Api
{
public static class MappingExtensions
{
public static User ToUser(this UserDto userDto)
{
return new User
{
Name = userDto.Name,
Passwort = userDto.Passwort
};
}

public static UserDto ToUserDto(this User user)
{
return new UserDto
{
Name = user.Name,
Passwort = user.Passwort
};
}

public static TimeDto ToTimeDto(this Time time)
{
return new TimeDto
{
Start = Google.Protobuf.WellKnownTypes.Timestamp.FromDateTime(time.Start.ToUniversalTime()),
End = Google.Protobuf.WellKnownTypes.Timestamp.FromDateTime(time.End.ToUniversalTime()),
Project = time.Project,
Uid = time.uId,
Id = time.Id
};
}

public static Time ToTime(this TimeDto timeDto)
{
return new Time
{
Start = timeDto.Start.ToDateTime(),
End = timeDto.End.ToDateTime(),
Project = timeDto.Project,
uId = timeDto.Uid,
Id = timeDto.Id
};
}
}
}
58 changes: 58 additions & 0 deletions DataInputt/DataInputt.ZeitService.Api/ProtoZeitService.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "google/protobuf/Empty.proto";

option csharp_namespace = "DataInputt.ZeitService.Api";

service ZeitService {
rpc CreateUser (UserDto) returns (UserResponse) {}
rpc Login (UserDto) returns (UserResponse) {}
rpc GetTimes (GetTimesRequest) returns (TimeCollection) {}
rpc AddTime (AddTimeRequest) returns (google.protobuf.Empty) {}
rpc Projects (google.protobuf.Empty) returns (ProjectCollection) {}
rpc CalculateEarnings (CalculateEarningRequest) returns (CalculateEarningResponse) {}
}


message UserDto {
string name = 1;
string passwort = 2;
}

message TimeDto {
google.protobuf.Timestamp start = 1;
google.protobuf.Timestamp end = 2;
string project = 3;
int32 uid = 4;
int32 id = 5;
}

message UserResponse {
int32 id = 1;
}

message GetTimesRequest {
int32 userId = 1;
}

message TimeCollection {
repeated TimeDto times = 1;
}

message AddTimeRequest {
TimeDto time = 1;
int32 userId = 2;
}

message ProjectCollection {
repeated string projects = 1;
}

message CalculateEarningRequest {
int32 userId = 1;
}

message CalculateEarningResponse {
float earning = 1;
}
12 changes: 12 additions & 0 deletions DataInputt/DataInputt.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataInputt.Tests", "DataInp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfServer", "WcfServer\WcfServer.csproj", "{2CB74F1D-6A02-4EB1-BA08-04619E4EE86D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataInputt.ZeitService.Api", "DataInputt.ZeitService.Api\DataInputt.ZeitService.Api.csproj", "{A8BD5AA6-AD86-43EF-8E17-F2D3BBC8BCE3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gRpcServer", "gRpcServer\gRpcServer.csproj", "{AC8A4837-D6FB-482C-AFAC-8F5E356D7B46}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -30,6 +34,14 @@ Global
{2CB74F1D-6A02-4EB1-BA08-04619E4EE86D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2CB74F1D-6A02-4EB1-BA08-04619E4EE86D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2CB74F1D-6A02-4EB1-BA08-04619E4EE86D}.Release|Any CPU.Build.0 = Release|Any CPU
{A8BD5AA6-AD86-43EF-8E17-F2D3BBC8BCE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8BD5AA6-AD86-43EF-8E17-F2D3BBC8BCE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8BD5AA6-AD86-43EF-8E17-F2D3BBC8BCE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8BD5AA6-AD86-43EF-8E17-F2D3BBC8BCE3}.Release|Any CPU.Build.0 = Release|Any CPU
{AC8A4837-D6FB-482C-AFAC-8F5E356D7B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC8A4837-D6FB-482C-AFAC-8F5E356D7B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC8A4837-D6FB-482C-AFAC-8F5E356D7B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC8A4837-D6FB-482C-AFAC-8F5E356D7B46}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
50 changes: 12 additions & 38 deletions DataInputt/DataInputt/App.config
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DataInputt.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="DataInputt.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<userSettings>
<DataInputt.Properties.Settings>
<setting name="DBUsername" serializeAs="String">
<value />
<value/>
</setting>
<setting name="DBPassword" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ConnectionString" serializeAs="String">
<value />
<value/>
</setting>
<setting name="LoggingImpl" serializeAs="String">
<value>NLogFacade</value>
Expand All @@ -28,34 +28,8 @@
</userSettings>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IDataInputService">
<security mode="Message">
<message clientCredentialType="Windows" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8733/Design_Time_Addresses/WcfServer/DataInputService/"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IDataInputService"
contract="DataInputServiceReference.IDataInputService" name="WSDualHttpBinding_IDataInputService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
</entityFramework>
</configuration>

This file was deleted.

This file was deleted.

Loading