Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new project for mutual classes #48

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions UI/FaceRecognition.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ VisualStudioVersion = 15.0.28010.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FaceRecognition", "UI\FaceRecognition.csproj", "{EC547F10-A585-4D2D-AF7B-21C22999BD18}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MutualClasses", "MutualClasses\MutualClasses.csproj", "{ADEF6543-C5E7-4C68-A203-20BA9D7AD83A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebServer", "WebServer\WebServer.csproj", "{54DD91CF-ED48-48BE-9F76-291BBF6082E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +19,14 @@ Global
{EC547F10-A585-4D2D-AF7B-21C22999BD18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC547F10-A585-4D2D-AF7B-21C22999BD18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC547F10-A585-4D2D-AF7B-21C22999BD18}.Release|Any CPU.Build.0 = Release|Any CPU
{ADEF6543-C5E7-4C68-A203-20BA9D7AD83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADEF6543-C5E7-4C68-A203-20BA9D7AD83A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADEF6543-C5E7-4C68-A203-20BA9D7AD83A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADEF6543-C5E7-4C68-A203-20BA9D7AD83A}.Release|Any CPU.Build.0 = Release|Any CPU
{54DD91CF-ED48-48BE-9F76-291BBF6082E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54DD91CF-ED48-48BE-9F76-291BBF6082E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54DD91CF-ED48-48BE-9F76-291BBF6082E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54DD91CF-ED48-48BE-9F76-291BBF6082E3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
41 changes: 7 additions & 34 deletions UI/UI/DatabaseInfo.cs → UI/MutualClasses/DatabaseInfo.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Configuration;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.OleDb;

namespace UI
namespace MutualClasses
{
class DatabaseInfo
public class DatabaseInfo
{
//Getting information from app.config
public SqlConnection GetConfigInfo()
Expand Down Expand Up @@ -75,7 +66,6 @@ public void CreateTable(SqlConnection connection)
}
}


// Insert row to table InsertRow(user, connection);
public void InsertRow(User user, SqlConnection connection)
{
Expand All @@ -85,7 +75,7 @@ public void InsertRow(User user, SqlConnection connection)
command.Parameters.AddWithValue("@First_Name", user.FirstName);
command.Parameters.AddWithValue("@Last_Name", user.LastName);
command.Parameters.AddWithValue("@Education", user.Information);
command.Parameters.AddWithValue("@Photo", "87d87e9wq7888d7w9f7889");
command.Parameters.AddWithValue("@Photo", user.Photo);

connection.Open();
int result = command.ExecuteNonQuery();
Expand Down Expand Up @@ -113,31 +103,14 @@ public void GetDataFromDatabase(List<User> Users, SqlConnection connection)
var user = new User(
reader["First_Name"].ToString(),
reader["Last_Name"].ToString(),
reader["Education"].ToString());
reader["Education"].ToString(),
reader["Photo"].ToString());

Users.Add(user);
Users.Add(user);
}
}
connection.Close();
}
}



/*public IEnumerable<object> GroupJoinCollections(List<User> OrderedUsers, List<UsersInfo> UsersPhotos)
{
var JoinedUsers = from p in OrderedUsers
join c in UsersPhotos
on p.FirstName equals c.FirstName
select new
{
PersonName = p.FirstName,
PersonSurname = c.LastName,
PersonInfo = p.Information,
PersonPhoto = c.Text
};
return JoinedUsers;

}*/
}
}
}
4 changes: 2 additions & 2 deletions UI/UI/ErrorHandling.cs → UI/MutualClasses/ErrorHandling.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Windows.Forms;

namespace UI
namespace MutualClasses
{
enum Errors { Connection_Error, Inserting_Error, Uploading_Error, Incorrect_Information_Error };
class ErrorHandling
public class ErrorHandling
{
public static void PrintError(Exception e)
{
Expand Down
53 changes: 53 additions & 0 deletions UI/MutualClasses/MutualClasses.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{ADEF6543-C5E7-4C68-A203-20BA9D7AD83A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MutualClasses</RootNamespace>
<AssemblyName>MutualClasses</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<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="DatabaseInfo.cs" />
<Compile Include="ErrorHandling.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="User.cs" />
<Compile Include="UsersInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
36 changes: 36 additions & 0 deletions UI/MutualClasses/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("MutualClasses")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MutualClasses")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[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("adef6543-c5e7-4c68-a203-20ba9d7ad83a")]

// 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")]
7 changes: 4 additions & 3 deletions UI/UI/User.cs → UI/MutualClasses/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace UI
namespace MutualClasses
{
public class User : IEnumerable // Only name, surname and information
{
public User(string firstName, string lastName, string information)
public User(string firstName, string lastName, string information, string photo)
{
FirstName = firstName;
LastName = lastName;
Information = information;
Photo = photo;
}
public string FirstName { get; set; }
public string LastName { get; set; }
public string Information { get; set; }
public string Photo { get; set; }

public IEnumerator GetEnumerator()
{
Expand Down
5 changes: 3 additions & 2 deletions UI/UI/UsersInfo.cs → UI/MutualClasses/UsersInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Text;
using System.Threading.Tasks;

namespace UI
namespace MutualClasses
{
public class UsersInfo // Only name, surname and photo
public class UsersInfo // Only name, surname and photo
{
public UsersInfo(string firstName, string lastName, string text)
{
Expand All @@ -18,4 +18,5 @@ public UsersInfo(string firstName, string lastName, string text)
public string LastName { get; set; }
public string Text { get; set; }
}

}
15 changes: 11 additions & 4 deletions UI/UI/FaceRecognition.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -148,8 +149,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="DatabaseInfo.cs" />
<Compile Include="ErrorHandling.cs" />
<Compile Include="FaceRecognition.cs" />
<Compile Include="MainWindow.cs">
<SubType>Form</SubType>
Expand All @@ -167,7 +166,6 @@
<Compile Include="ReadFiles.cs" />
<Compile Include="RegexClass.cs" />
<Compile Include="Settings.cs" />
<Compile Include="User.cs" />
<Compile Include="UserControls\AddControl.cs">
<SubType>UserControl</SubType>
</Compile>
Expand All @@ -186,7 +184,6 @@
<Compile Include="UserControls\HomeControl.Designer.cs">
<DependentUpon>HomeControl.cs</DependentUpon>
</Compile>
<Compile Include="UsersInfo.cs" />
<EmbeddedResource Include="MainWindow.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -226,6 +223,16 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MutualClasses\MutualClasses.csproj">
<Project>{adef6543-c5e7-4c68-a203-20ba9d7ad83a}</Project>
<Name>MutualClasses</Name>
</ProjectReference>
<ProjectReference Include="..\WebServer\WebServer.csproj">
<Project>{54dd91cf-ed48-48be-9f76-291bbf6082e3}</Project>
<Name>WebServer</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions UI/UI/ReadFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using System.IO;
using MutualClasses;

namespace UI
{
Expand All @@ -16,8 +17,8 @@ public void ReadKeyFile(ref apiInfo apiInformation, string pathOneFile, string p
ReadingWithStream(pathOneFile);
if(pathSecondFile != null)
ReadingWithStream(pathSecondFile);
apiInformation.apiKey = lines[0];
apiInformation.apiLoc = lines[1];
apiInformation.apiKey = lines[0];
apiInformation.apiLoc = lines[1];
}

private void ReadingWithStream(string path)
Expand Down
Loading