sneiasckin 4 vuotta sitten
commit
6a8579046c
100 muutettua tiedostoa jossa 24788 lisäystä ja 0 poistoa
  1. 1 0
      .gitignore
  2. 12 0
      .idea/Srez.iml
  3. 4 0
      .idea/misc.xml
  4. 8 0
      .idea/modules.xml
  5. 86 0
      .idea/workspace.xml
  6. 6 0
      CsAp/App.config
  7. 53 0
      CsAp/CsAp.csproj
  8. 75 0
      CsAp/Program.cs
  9. 36 0
      CsAp/Properties/AssemblyInfo.cs
  10. BIN
      CsAp/bin/Debug/CsAp.exe
  11. 6 0
      CsAp/bin/Debug/CsAp.exe.config
  12. BIN
      CsAp/bin/Debug/CsAp.pdb
  13. 4 0
      CsAp/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
  14. 1 0
      CsAp/obj/Debug/CsAp.csproj.CoreCompileInputs.cache
  15. 6 0
      CsAp/obj/Debug/CsAp.csproj.FileListAbsolute.txt
  16. BIN
      CsAp/obj/Debug/CsAp.exe
  17. BIN
      CsAp/obj/Debug/CsAp.pdb
  18. BIN
      CsAp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  19. 37 0
      Srez.sln
  20. 6 0
      Srez/App.config
  21. 9 0
      Srez/App.xaml
  22. 17 0
      Srez/App.xaml.cs
  23. 18 0
      Srez/MainWindow.xaml
  24. 53 0
      Srez/MainWindow.xaml.cs
  25. 55 0
      Srez/Properties/AssemblyInfo.cs
  26. 70 0
      Srez/Properties/Resources.Designer.cs
  27. 117 0
      Srez/Properties/Resources.resx
  28. 29 0
      Srez/Properties/Settings.Designer.cs
  29. 7 0
      Srez/Properties/Settings.settings
  30. 16 0
      Srez/Session.cs
  31. 119 0
      Srez/Srez.csproj
  32. 16 0
      Srez/UserSession.cs
  33. 17 0
      Srez/Users.cs
  34. 14 0
      Srez/Window1.xaml
  35. 40 0
      Srez/Window1.xaml.cs
  36. 45 0
      Srez/WsClient.cs
  37. BIN
      Srez/bin/Debug/Newtonsoft.Json.dll
  38. 11262 0
      Srez/bin/Debug/Newtonsoft.Json.xml
  39. BIN
      Srez/bin/Debug/Srez.exe
  40. 6 0
      Srez/bin/Debug/Srez.exe.config
  41. BIN
      Srez/bin/Debug/Srez.pdb
  42. BIN
      Srez/bin/Debug/WebSocketServerSrez.exe
  43. 6 0
      Srez/bin/Debug/WebSocketServerSrez.exe.config
  44. BIN
      Srez/bin/Debug/WebSocketServerSrez.pdb
  45. 4 0
      Srez/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
  46. 70 0
      Srez/obj/Debug/App.g.cs
  47. 70 0
      Srez/obj/Debug/App.g.i.cs
  48. BIN
      Srez/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  49. BIN
      Srez/obj/Debug/MainWindow.baml
  50. 106 0
      Srez/obj/Debug/MainWindow.g.cs
  51. 106 0
      Srez/obj/Debug/MainWindow.g.i.cs
  52. BIN
      Srez/obj/Debug/Srez.Properties.Resources.resources
  53. 0 0
      Srez/obj/Debug/Srez.csproj.CopyComplete
  54. 1 0
      Srez/obj/Debug/Srez.csproj.CoreCompileInputs.cache
  55. 43 0
      Srez/obj/Debug/Srez.csproj.FileListAbsolute.txt
  56. BIN
      Srez/obj/Debug/Srez.csproj.GenerateResource.cache
  57. BIN
      Srez/obj/Debug/Srez.csprojAssemblyReference.cache
  58. BIN
      Srez/obj/Debug/Srez.exe
  59. BIN
      Srez/obj/Debug/Srez.g.resources
  60. BIN
      Srez/obj/Debug/Srez.pdb
  61. 20 0
      Srez/obj/Debug/Srez_MarkupCompile.cache
  62. 20 0
      Srez/obj/Debug/Srez_MarkupCompile.i.cache
  63. 5 0
      Srez/obj/Debug/Srez_MarkupCompile.i.lref
  64. 5 0
      Srez/obj/Debug/Srez_MarkupCompile.lref
  65. BIN
      Srez/obj/Debug/Window1.baml
  66. 95 0
      Srez/obj/Debug/Window1.g.cs
  67. 95 0
      Srez/obj/Debug/Window1.g.i.cs
  68. 4 0
      Srez/packages.config
  69. 12 0
      SrezPy/.idea/Srez.iml
  70. 7 0
      SrezPy/.idea/misc.xml
  71. 8 0
      SrezPy/.idea/modules.xml
  72. 6 0
      SrezPy/.idea/vcs.xml
  73. 202 0
      SrezPy/.idea/workspace.xml
  74. BIN
      SrezPy/DatabaseScript.sql
  75. BIN
      SrezPy/__pycache__/db.cpython-37.pyc
  76. 50 0
      SrezPy/db.py
  77. 26 0
      SrezPy/main.py
  78. 6 0
      WebSocketServerSrez/App.config
  79. 131 0
      WebSocketServerSrez/Program.cs
  80. 36 0
      WebSocketServerSrez/Properties/AssemblyInfo.cs
  81. 17 0
      WebSocketServerSrez/Session.cs
  82. 16 0
      WebSocketServerSrez/UserSession.cs
  83. 17 0
      WebSocketServerSrez/Users.cs
  84. 60 0
      WebSocketServerSrez/WebSocketServerSrez.csproj
  85. BIN
      WebSocketServerSrez/bin/Debug/Newtonsoft.Json.dll
  86. 11262 0
      WebSocketServerSrez/bin/Debug/Newtonsoft.Json.xml
  87. BIN
      WebSocketServerSrez/bin/Debug/WebSocketServerSrez.exe
  88. 6 0
      WebSocketServerSrez/bin/Debug/WebSocketServerSrez.exe.config
  89. BIN
      WebSocketServerSrez/bin/Debug/WebSocketServerSrez.pdb
  90. 4 0
      WebSocketServerSrez/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
  91. BIN
      WebSocketServerSrez/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  92. 0 0
      WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csproj.CopyComplete
  93. 1 0
      WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csproj.CoreCompileInputs.cache
  94. 10 0
      WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csproj.FileListAbsolute.txt
  95. BIN
      WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csprojAssemblyReference.cache
  96. BIN
      WebSocketServerSrez/obj/Debug/WebSocketServerSrez.exe
  97. BIN
      WebSocketServerSrez/obj/Debug/WebSocketServerSrez.pdb
  98. 4 0
      WebSocketServerSrez/packages.config
  99. 6 0
      WssGui/App.config
  100. 0 0
      WssGui/App.xaml

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+.vs

+ 12 - 0
.idea/Srez.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="TestRunnerService">
+    <option name="projectConfiguration" value="pytest" />
+    <option name="PROJECT_TEST_RUNNER" value="pytest" />
+  </component>
+</module>

+ 4 - 0
.idea/misc.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/Srez.iml" filepath="$PROJECT_DIR$/.idea/Srez.iml" />
+    </modules>
+  </component>
+</project>

+ 86 - 0
.idea/workspace.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="7350e25f-d769-4e90-85ae-b0e149791a3f" name="Default Changelist" comment="" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ProjectFrameBounds" extendedState="6">
+    <option name="x" value="-8" />
+    <option name="y" value="-8" />
+    <option name="width" value="1936" />
+    <option name="height" value="1056" />
+  </component>
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane">
+        <subPane>
+          <expand>
+            <path>
+              <item name="Srez" type="b2602c69:ProjectViewProjectNode" />
+              <item name="Srez" type="462c0819:PsiDirectoryNode" />
+            </path>
+          </expand>
+          <select />
+        </subPane>
+      </pane>
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="last_opened_file_path" value="Z:/SrezPy" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="7350e25f-d769-4e90-85ae-b0e149791a3f" name="Default Changelist" comment="" />
+      <created>1614562577237</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1614562577237</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
+    <layout>
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.12328767" />
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
+      <window_info id="Favorites" order="2" side_tool="true" />
+      <window_info anchor="bottom" id="Message" order="0" />
+      <window_info anchor="bottom" id="Find" order="1" />
+      <window_info anchor="bottom" id="Run" order="2" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="bottom" id="Version Control" order="7" />
+      <window_info anchor="bottom" id="Terminal" order="8" />
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
+      <window_info anchor="bottom" id="Python Console" order="10" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
+    </layout>
+  </component>
+</project>

+ 6 - 0
CsAp/App.config

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

+ 53 - 0
CsAp/CsAp.csproj

@@ -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>{8BD4E48D-5079-43CF-9681-6494EF129966}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>CsAp</RootNamespace>
+    <AssemblyName>CsAp</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </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="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="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 75 - 0
CsAp/Program.cs

@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CsAp
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            try
+            {
+                SendMessageFromSocket(11000);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+            }
+            finally
+            {
+                Console.ReadLine();
+            }
+        }
+
+        static void SendMessageFromSocket(int port)
+        {
+            // Буфер для входящих данных
+            byte[] bytes = new byte[1024];
+
+            // Соединяемся с удаленным устройством
+
+            // Устанавливаем удаленную точку для сокета
+            IPHostEntry ipHost = Dns.GetHostEntry("localhost");
+            IPAddress ipAddr = ipHost.AddressList[0];
+            IPEndPoint ipEndPoint = new IPEndPoint(ipAddr, port);
+
+            Socket sender = new Socket(ipAddr.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+
+            // Соединяем сокет с удаленной точкой
+            sender.Connect(ipEndPoint);
+
+            Console.Write("Введите сообщение: ");
+            string message = Console.ReadLine();
+
+            Console.WriteLine("Сокет соединяется с {0} ", sender.RemoteEndPoint.ToString());
+            byte[] msg = Encoding.UTF8.GetBytes(message);
+
+            // Отправляем данные через сокет
+            int bytesSent = sender.Send(msg);
+
+            // Получаем ответ от сервера
+            int bytesRec = sender.Receive(bytes);
+
+            Console.WriteLine("\nОтвет от сервера: {0}\n\n", Encoding.UTF8.GetString(bytes, 0, bytesRec));
+
+            // Используем рекурсию для неоднократного вызова SendMessageFromSocket()
+            if (message.IndexOf("<TheEnd>") == -1)
+                SendMessageFromSocket(port);
+
+            // Освобождаем сокет
+            sender.Shutdown(SocketShutdown.Both);
+            sender.Close();
+        }
+
+        public class SessionUser
+        {
+            public int id_user { get; set; }
+            public string date_start { get; set; }
+        }
+    }
+}

+ 36 - 0
CsAp/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
+// связанные с этой сборкой.
+[assembly: AssemblyTitle("CsAp")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CsAp")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// из модели COM задайте для атрибута ComVisible этого типа значение true.
+[assembly: ComVisible(false)]
+
+// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM
+[assembly: Guid("8bd4e48d-5079-43cf-9681-6494ef129966")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Номер редакции
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

BIN
CsAp/bin/Debug/CsAp.exe


+ 6 - 0
CsAp/bin/Debug/CsAp.exe.config

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

BIN
CsAp/bin/Debug/CsAp.pdb


+ 4 - 0
CsAp/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs

@@ -0,0 +1,4 @@
+// <autogenerated />
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

+ 1 - 0
CsAp/obj/Debug/CsAp.csproj.CoreCompileInputs.cache

@@ -0,0 +1 @@
+7f4b213b428f4c013f19137338418ee1f5525793

+ 6 - 0
CsAp/obj/Debug/CsAp.csproj.FileListAbsolute.txt

@@ -0,0 +1,6 @@
+Z:\Srez\CsAp\bin\Debug\CsAp.exe.config
+Z:\Srez\CsAp\bin\Debug\CsAp.exe
+Z:\Srez\CsAp\bin\Debug\CsAp.pdb
+Z:\Srez\CsAp\obj\Debug\CsAp.csproj.CoreCompileInputs.cache
+Z:\Srez\CsAp\obj\Debug\CsAp.exe
+Z:\Srez\CsAp\obj\Debug\CsAp.pdb

BIN
CsAp/obj/Debug/CsAp.exe


BIN
CsAp/obj/Debug/CsAp.pdb


BIN
CsAp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


+ 37 - 0
Srez.sln

@@ -0,0 +1,37 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31005.135
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Srez", "Srez\Srez.csproj", "{A1C6E364-8E68-47B7-BBD6-044F41B737E5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebSocketServerSrez", "WebSocketServerSrez\WebSocketServerSrez.csproj", "{0DBD7D69-F414-49FB-B610-B1BF9A4EEB91}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WssGui", "WssGui\WssGui.csproj", "{85701C61-6085-4B3F-9A15-F73BF33EB5BF}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{A1C6E364-8E68-47B7-BBD6-044F41B737E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A1C6E364-8E68-47B7-BBD6-044F41B737E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A1C6E364-8E68-47B7-BBD6-044F41B737E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A1C6E364-8E68-47B7-BBD6-044F41B737E5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0DBD7D69-F414-49FB-B610-B1BF9A4EEB91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{0DBD7D69-F414-49FB-B610-B1BF9A4EEB91}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0DBD7D69-F414-49FB-B610-B1BF9A4EEB91}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{0DBD7D69-F414-49FB-B610-B1BF9A4EEB91}.Release|Any CPU.Build.0 = Release|Any CPU
+		{85701C61-6085-4B3F-9A15-F73BF33EB5BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{85701C61-6085-4B3F-9A15-F73BF33EB5BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{85701C61-6085-4B3F-9A15-F73BF33EB5BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{85701C61-6085-4B3F-9A15-F73BF33EB5BF}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {A0CBFBBA-8F4C-448B-A060-01BA4B21FFA3}
+	EndGlobalSection
+EndGlobal

+ 6 - 0
Srez/App.config

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

+ 9 - 0
Srez/App.xaml

@@ -0,0 +1,9 @@
+<Application x:Class="Srez.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:Srez"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+    </Application.Resources>
+</Application>

+ 17 - 0
Srez/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Srez
+{
+    /// <summary>
+    /// Логика взаимодействия для App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 18 - 0
Srez/MainWindow.xaml

@@ -0,0 +1,18 @@
+<Window x:Class="Srez.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:Srez"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="450" Width="400" 
+        WindowStartupLocation="CenterScreen">
+    <Grid>
+        <StackPanel Orientation="Vertical"
+                    Margin="20" VerticalAlignment="Center">
+            <TextBox Name="InputUserCode" Height="30"/>
+            <Button Content="Войти" Height="30"
+                    Name="loginBtn" Click="loginBtn_Click"/>
+        </StackPanel>
+    </Grid>
+</Window>

+ 53 - 0
Srez/MainWindow.xaml.cs

@@ -0,0 +1,53 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Srez
+{
+    /// <summary>
+    /// Логика взаимодействия для MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+
+            Session.DateFinish = DateTime.Now;
+            Session.DateStart = DateTime.Now;
+            Session.IdSession = 0;
+            Session.IdUser = 0;
+        }
+
+        private void loginBtn_Click(object sender, RoutedEventArgs e)
+        {
+            Session.DateStart = DateTime.Now;
+            Session.IdUser = Convert.ToInt32(InputUserCode.Text);
+
+            WsClient.WsClientConnect();
+            WsClient.WsClientSendMessage($"SetUserSession {InputUserCode.Text}");
+            Session.IdSession = Convert.ToInt32(WsClient.WsClientResponseFromWss());
+            WsClient.WsClientClose();
+
+            new Window1().Show();
+            this.Close();
+        }
+    }
+}

+ 55 - 0
Srez/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набор атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
+// связанные со сборкой.
+[assembly: AssemblyTitle("Srez")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Srez")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// из модели COM, установите атрибут ComVisible для этого типа в значение true.
+[assembly: ComVisible(false)]
+
+//Чтобы начать создание локализуемых приложений, задайте
+//<UICulture>CultureYouAreCodingWith</UICulture> в файле .csproj
+//в <PropertyGroup>. Например, при использовании английского (США)
+//в своих исходных файлах установите <UICulture> в en-US.  Затем отмените преобразование в комментарий
+//атрибута NeutralResourceLanguage ниже.  Обновите "en-US" в
+//строка внизу для обеспечения соответствия настройки UICulture в файле проекта.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам
+                                     //(используется, если ресурс не найден на странице,
+                                     // или в словарях ресурсов приложения)
+    ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов
+                                              //(используется, если ресурс не найден на странице,
+                                              // в приложении или в каких-либо словарях ресурсов для конкретной темы)
+)]
+
+
+// Сведения о версии для сборки включают четыре следующих значения:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Номер редакции
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 70 - 0
Srez/Properties/Resources.Designer.cs

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код был создан программным средством.
+//     Версия среды выполнения: 4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
+//     код создан повторно.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace Srez.Properties
+{
+    /// <summary>
+    ///   Класс ресурсов со строгим типом для поиска локализованных строк и пр.
+    /// </summary>
+    // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
+    // класс с помощью таких средств, как ResGen или Visual Studio.
+    // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
+    // с параметром /str или заново постройте свой VS-проект.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Srez.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   Переопределяет свойство CurrentUICulture текущего потока для всех
+        ///   подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
Srez/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 29 - 0
Srez/Properties/Settings.Designer.cs

@@ -0,0 +1,29 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+
+namespace Srez.Properties
+{
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
Srez/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 16 - 0
Srez/Session.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Srez
+{
+    public static class Session
+    {
+        public static int IdSession { get; set; }
+        public static DateTime DateStart { get; set; }
+        public static DateTime DateFinish { get; set; }
+        public static int IdUser { get; set; }
+    }
+}

+ 119 - 0
Srez/Srez.csproj

@@ -0,0 +1,119 @@
+<?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>{A1C6E364-8E68-47B7-BBD6-044F41B737E5}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>Srez</RootNamespace>
+    <AssemblyName>Srez</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </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.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Compile Include="Session.cs" />
+    <Compile Include="Users.cs" />
+    <Compile Include="UserSession.cs" />
+    <Compile Include="Window1.xaml.cs">
+      <DependentUpon>Window1.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="WsClient.cs" />
+    <Page Include="MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="Window1.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="packages.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\WebSocketServerSrez\WebSocketServerSrez.csproj">
+      <Project>{0dbd7d69-f414-49fb-b610-b1bf9a4eeb91}</Project>
+      <Name>WebSocketServerSrez</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 16 - 0
Srez/UserSession.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Srez
+{
+    public class UserSession
+    {
+        public int IdSession { get; set; }
+        public DateTime DateStart { get; set; }
+        public DateTime DateFinish { get; set; }
+        public int IdUser { get; set; }
+    }
+}

+ 17 - 0
Srez/Users.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Srez
+{
+    class Users
+    {
+        public int Id { get; set; }
+        public string LastName { get; set; }
+        public string FirstName { get; set; }
+        public string MiddleName { get; set; }
+        public int IdPriliveleges { get; set; }
+    }
+}

+ 14 - 0
Srez/Window1.xaml

@@ -0,0 +1,14 @@
+<Window x:Class="Srez.Window1"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:Srez"
+        mc:Ignorable="d"
+        Title="Window1" Height="450" Width="800">
+    <Grid>
+        <Button Content="Закончить смену"
+                Name="CloseSessionBtn"
+                Click="CloseSessionBtn_Click"/>
+    </Grid>
+</Window>

+ 40 - 0
Srez/Window1.xaml.cs

@@ -0,0 +1,40 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Srez
+{
+    /// <summary>
+    /// Логика взаимодействия для Window1.xaml
+    /// </summary>
+    public partial class Window1 : Window
+    {
+        public Window1()
+        {
+            InitializeComponent();
+        }
+
+        private void CloseSessionBtn_Click(object sender, RoutedEventArgs e)
+        {
+            WsClient.WsClientConnect();
+            WsClient.WsClientSendMessage($"UpdateUserSession {Session.IdSession}");
+            WsClient.WsClientClose();
+
+            Application.Current.Shutdown();
+        }
+    }
+}

+ 45 - 0
Srez/WsClient.cs

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Srez
+{
+    public class WsClient
+    {
+        private static byte[] bytes = new byte[1024];
+        private static IPHostEntry iPHostEntry = Dns.GetHostEntry("localhost");
+        private static IPAddress iPAddress = iPHostEntry.AddressList[0];
+        private static IPEndPoint iPEndPoint = new IPEndPoint(iPAddress, 11000);
+        private static Socket socket = null;
+
+        public static void WsClientConnect()
+        {
+            socket = new Socket(iPAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
+            socket.Connect(iPEndPoint);
+
+        }
+
+        public static void WsClientSendMessage(string data)
+        {
+            socket.Send(Encoding.UTF8.GetBytes(data));
+
+        }
+
+        public static string WsClientResponseFromWss()
+        {
+            return Encoding.UTF8.GetString(bytes, 0, socket.Receive(bytes));
+
+        }
+
+        public static void WsClientClose()
+        {
+            socket.Shutdown(SocketShutdown.Both);
+            socket.Close();
+
+        }
+    }
+}

BIN
Srez/bin/Debug/Newtonsoft.Json.dll


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11262 - 0
Srez/bin/Debug/Newtonsoft.Json.xml


BIN
Srez/bin/Debug/Srez.exe


+ 6 - 0
Srez/bin/Debug/Srez.exe.config

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

BIN
Srez/bin/Debug/Srez.pdb


BIN
Srez/bin/Debug/WebSocketServerSrez.exe


+ 6 - 0
Srez/bin/Debug/WebSocketServerSrez.exe.config

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

BIN
Srez/bin/Debug/WebSocketServerSrez.pdb


+ 4 - 0
Srez/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs

@@ -0,0 +1,4 @@
+// <autogenerated />
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

+ 70 - 0
Srez/obj/Debug/App.g.cs

@@ -0,0 +1,70 @@
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0B67D4E80EC02839E5AD0547393EA390C7DE07AEEC8BC75EF76B9BDC8E9DEA93"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using Srez;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace Srez {
+    
+    
+    /// <summary>
+    /// App
+    /// </summary>
+    public partial class App : System.Windows.Application {
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            
+            #line 5 "..\..\App.xaml"
+            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
+            
+            #line default
+            #line hidden
+        }
+        
+        /// <summary>
+        /// Application Entry Point.
+        /// </summary>
+        [System.STAThreadAttribute()]
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public static void Main() {
+            Srez.App app = new Srez.App();
+            app.InitializeComponent();
+            app.Run();
+        }
+    }
+}
+

+ 70 - 0
Srez/obj/Debug/App.g.i.cs

@@ -0,0 +1,70 @@
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0B67D4E80EC02839E5AD0547393EA390C7DE07AEEC8BC75EF76B9BDC8E9DEA93"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using Srez;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace Srez {
+    
+    
+    /// <summary>
+    /// App
+    /// </summary>
+    public partial class App : System.Windows.Application {
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            
+            #line 5 "..\..\App.xaml"
+            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
+            
+            #line default
+            #line hidden
+        }
+        
+        /// <summary>
+        /// Application Entry Point.
+        /// </summary>
+        [System.STAThreadAttribute()]
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public static void Main() {
+            Srez.App app = new Srez.App();
+            app.InitializeComponent();
+            app.Run();
+        }
+    }
+}
+

BIN
Srez/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
Srez/obj/Debug/MainWindow.baml


+ 106 - 0
Srez/obj/Debug/MainWindow.g.cs

@@ -0,0 +1,106 @@
+#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2858A0B3C2CCABCF13B2B35A676344786A5C3903741400A441B1CE0D8C3306AE"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using Srez;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace Srez {
+    
+    
+    /// <summary>
+    /// MainWindow
+    /// </summary>
+    public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 13 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox InputUserCode;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 15 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button loginBtn;
+        
+        #line default
+        #line hidden
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/Srez;component/mainwindow.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\MainWindow.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.InputUserCode = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 2:
+            this.loginBtn = ((System.Windows.Controls.Button)(target));
+            
+            #line 15 "..\..\MainWindow.xaml"
+            this.loginBtn.Click += new System.Windows.RoutedEventHandler(this.loginBtn_Click);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 106 - 0
Srez/obj/Debug/MainWindow.g.i.cs

@@ -0,0 +1,106 @@
+#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2858A0B3C2CCABCF13B2B35A676344786A5C3903741400A441B1CE0D8C3306AE"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using Srez;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace Srez {
+    
+    
+    /// <summary>
+    /// MainWindow
+    /// </summary>
+    public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 13 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox InputUserCode;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 15 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button loginBtn;
+        
+        #line default
+        #line hidden
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/Srez;component/mainwindow.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\MainWindow.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.InputUserCode = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 2:
+            this.loginBtn = ((System.Windows.Controls.Button)(target));
+            
+            #line 15 "..\..\MainWindow.xaml"
+            this.loginBtn.Click += new System.Windows.RoutedEventHandler(this.loginBtn_Click);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

BIN
Srez/obj/Debug/Srez.Properties.Resources.resources


+ 0 - 0
Srez/obj/Debug/Srez.csproj.CopyComplete


+ 1 - 0
Srez/obj/Debug/Srez.csproj.CoreCompileInputs.cache

@@ -0,0 +1 @@
+328c58626a77b8a6724c4ce955155033b3906dc2

+ 43 - 0
Srez/obj/Debug/Srez.csproj.FileListAbsolute.txt

@@ -0,0 +1,43 @@
+C:\Users\sneiasckin\source\repos\Srez\Srez\bin\Debug\Srez.exe.config
+C:\Users\sneiasckin\source\repos\Srez\Srez\bin\Debug\Srez.exe
+C:\Users\sneiasckin\source\repos\Srez\Srez\bin\Debug\Srez.pdb
+C:\Users\sneiasckin\source\repos\Srez\Srez\bin\Debug\Newtonsoft.Json.dll
+C:\Users\sneiasckin\source\repos\Srez\Srez\bin\Debug\Newtonsoft.Json.xml
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.csprojAssemblyReference.cache
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\MainWindow.g.cs
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\App.g.cs
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez_MarkupCompile.cache
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez_MarkupCompile.lref
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\MainWindow.baml
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.g.resources
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.Properties.Resources.resources
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.csproj.GenerateResource.cache
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.csproj.CoreCompileInputs.cache
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.csproj.CopyComplete
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.exe
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Srez.pdb
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Window1.g.cs
+C:\Users\sneiasckin\source\repos\Srez\Srez\obj\Debug\Window1.baml
+Z:\Srez\Srez\bin\Debug\Srez.exe.config
+Z:\Srez\Srez\bin\Debug\Srez.exe
+Z:\Srez\Srez\bin\Debug\Srez.pdb
+Z:\Srez\Srez\bin\Debug\Newtonsoft.Json.dll
+Z:\Srez\Srez\bin\Debug\Newtonsoft.Json.xml
+Z:\Srez\Srez\obj\Debug\Srez.csprojAssemblyReference.cache
+Z:\Srez\Srez\obj\Debug\MainWindow.g.cs
+Z:\Srez\Srez\obj\Debug\Window1.g.cs
+Z:\Srez\Srez\obj\Debug\App.g.cs
+Z:\Srez\Srez\obj\Debug\Srez_MarkupCompile.cache
+Z:\Srez\Srez\obj\Debug\Srez_MarkupCompile.lref
+Z:\Srez\Srez\obj\Debug\MainWindow.baml
+Z:\Srez\Srez\obj\Debug\Window1.baml
+Z:\Srez\Srez\obj\Debug\Srez.g.resources
+Z:\Srez\Srez\obj\Debug\Srez.Properties.Resources.resources
+Z:\Srez\Srez\obj\Debug\Srez.csproj.GenerateResource.cache
+Z:\Srez\Srez\obj\Debug\Srez.csproj.CoreCompileInputs.cache
+Z:\Srez\Srez\obj\Debug\Srez.csproj.CopyComplete
+Z:\Srez\Srez\obj\Debug\Srez.exe
+Z:\Srez\Srez\obj\Debug\Srez.pdb
+Z:\Srez\Srez\bin\Debug\WebSocketServerSrez.exe
+Z:\Srez\Srez\bin\Debug\WebSocketServerSrez.pdb
+Z:\Srez\Srez\bin\Debug\WebSocketServerSrez.exe.config

BIN
Srez/obj/Debug/Srez.csproj.GenerateResource.cache


BIN
Srez/obj/Debug/Srez.csprojAssemblyReference.cache


BIN
Srez/obj/Debug/Srez.exe


BIN
Srez/obj/Debug/Srez.g.resources


BIN
Srez/obj/Debug/Srez.pdb


+ 20 - 0
Srez/obj/Debug/Srez_MarkupCompile.cache

@@ -0,0 +1,20 @@
+Srez
+
+
+winexe
+C#
+.cs
+Z:\Srez\Srez\obj\Debug\
+Srez
+none
+false
+DEBUG;TRACE
+Z:\Srez\Srez\App.xaml
+2462529049
+
+101823206544
+15-540510416
+MainWindow.xaml;Window1.xaml;
+
+False
+

+ 20 - 0
Srez/obj/Debug/Srez_MarkupCompile.i.cache

@@ -0,0 +1,20 @@
+Srez
+
+
+winexe
+C#
+.cs
+Z:\Srez\Srez\obj\Debug\
+Srez
+none
+false
+DEBUG;TRACE
+Z:\Srez\Srez\App.xaml
+2462529049
+
+11980847177
+15-540510416
+MainWindow.xaml;Window1.xaml;
+
+True
+

+ 5 - 0
Srez/obj/Debug/Srez_MarkupCompile.i.lref

@@ -0,0 +1,5 @@
+
+
+FZ:\Srez\Srez\MainWindow.xaml;;
+FZ:\Srez\Srez\Window1.xaml;;
+

+ 5 - 0
Srez/obj/Debug/Srez_MarkupCompile.lref

@@ -0,0 +1,5 @@
+
+
+FZ:\Srez\Srez\MainWindow.xaml;;
+FZ:\Srez\Srez\Window1.xaml;;
+

BIN
Srez/obj/Debug/Window1.baml


+ 95 - 0
Srez/obj/Debug/Window1.g.cs

@@ -0,0 +1,95 @@
+#pragma checksum "..\..\Window1.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AE749F1EB10CD119107D2DBC968D5927867D622F8C7FC965734E4B1F440D594E"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using Srez;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace Srez {
+    
+    
+    /// <summary>
+    /// Window1
+    /// </summary>
+    public partial class Window1 : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 11 "..\..\Window1.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button CloseSessionBtn;
+        
+        #line default
+        #line hidden
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/Srez;component/window1.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\Window1.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.CloseSessionBtn = ((System.Windows.Controls.Button)(target));
+            
+            #line 12 "..\..\Window1.xaml"
+            this.CloseSessionBtn.Click += new System.Windows.RoutedEventHandler(this.CloseSessionBtn_Click);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 95 - 0
Srez/obj/Debug/Window1.g.i.cs

@@ -0,0 +1,95 @@
+#pragma checksum "..\..\Window1.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AE749F1EB10CD119107D2DBC968D5927867D622F8C7FC965734E4B1F440D594E"
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан программой.
+//     Исполняемая версия:4.0.30319.42000
+//
+//     Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
+//     повторной генерации кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using Srez;
+using System;
+using System.Diagnostics;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Media.Effects;
+using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
+using System.Windows.Media.TextFormatting;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+
+
+namespace Srez {
+    
+    
+    /// <summary>
+    /// Window1
+    /// </summary>
+    public partial class Window1 : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 11 "..\..\Window1.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button CloseSessionBtn;
+        
+        #line default
+        #line hidden
+        
+        private bool _contentLoaded;
+        
+        /// <summary>
+        /// InitializeComponent
+        /// </summary>
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        public void InitializeComponent() {
+            if (_contentLoaded) {
+                return;
+            }
+            _contentLoaded = true;
+            System.Uri resourceLocater = new System.Uri("/Srez;component/window1.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\Window1.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #line default
+            #line hidden
+        }
+        
+        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
+        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
+        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
+            switch (connectionId)
+            {
+            case 1:
+            this.CloseSessionBtn = ((System.Windows.Controls.Button)(target));
+            
+            #line 12 "..\..\Window1.xaml"
+            this.CloseSessionBtn.Click += new System.Windows.RoutedEventHandler(this.CloseSessionBtn_Click);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 4 - 0
Srez/packages.config

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

+ 12 - 0
SrezPy/.idea/Srez.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="TestRunnerService">
+    <option name="projectConfiguration" value="pytest" />
+    <option name="PROJECT_TEST_RUNNER" value="pytest" />
+  </component>
+</module>

+ 7 - 0
SrezPy/.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
+  <component name="PyCharmProfessionalAdvertiser">
+    <option name="shown" value="true" />
+  </component>
+</project>

+ 8 - 0
SrezPy/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/Srez.iml" filepath="$PROJECT_DIR$/.idea/Srez.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
SrezPy/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 202 - 0
SrezPy/.idea/workspace.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="456968af-b8f9-44f5-9d29-3e06d2e20577" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/db.py" beforeDir="false" afterPath="$PROJECT_DIR$/db.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
+    </list>
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
+      <file pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/main.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="323">
+              <caret line="19" column="32" selection-start-line="19" selection-start-column="13" selection-end-line="19" selection-end-column="32" />
+              <folding>
+                <element signature="e#0#41#0" expanded="true" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/db.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="333">
+              <caret line="26" column="16" lean-forward="true" selection-start-line="26" selection-start-column="16" selection-end-line="26" selection-end-column="16" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Python Script" />
+      </list>
+    </option>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="CHANGED_PATHS">
+      <list>
+        <option value="$PROJECT_DIR$/main.py" />
+        <option value="$PROJECT_DIR$/db.py" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectFrameBounds">
+    <option name="x" value="-8" />
+    <option name="y" value="-8" />
+    <option name="width" value="976" />
+    <option name="height" value="1056" />
+  </component>
+  <component name="ProjectView">
+    <navigator proportions="" version="1">
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane">
+        <subPane>
+          <expand>
+            <path>
+              <item name="SrezPy" type="b2602c69:ProjectViewProjectNode" />
+              <item name="SrezPy" type="462c0819:PsiDirectoryNode" />
+            </path>
+          </expand>
+          <select />
+        </subPane>
+      </pane>
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+    <property name="restartRequiresConfirmation" value="false" />
+  </component>
+  <component name="RunDashboard">
+    <option name="ruleStates">
+      <list>
+        <RuleState>
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
+        </RuleState>
+        <RuleState>
+          <option name="name" value="StatusDashboardGroupingRule" />
+        </RuleState>
+      </list>
+    </option>
+  </component>
+  <component name="RunManager">
+    <configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true">
+      <module name="Srez" />
+      <option name="INTERPRETER_OPTIONS" value="" />
+      <option name="PARENT_ENVS" value="true" />
+      <envs>
+        <env name="PYTHONUNBUFFERED" value="1" />
+      </envs>
+      <option name="SDK_HOME" value="" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+      <option name="IS_MODULE_SDK" value="true" />
+      <option name="ADD_CONTENT_ROOTS" value="true" />
+      <option name="ADD_SOURCE_ROOTS" value="true" />
+      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
+      <option name="PARAMETERS" value="" />
+      <option name="SHOW_COMMAND_LINE" value="false" />
+      <option name="EMULATE_TERMINAL" value="false" />
+      <option name="MODULE_MODE" value="false" />
+      <option name="REDIRECT_INPUT" value="false" />
+      <option name="INPUT_FILE" value="" />
+      <method v="2" />
+    </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Python.main" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="456968af-b8f9-44f5-9d29-3e06d2e20577" name="Default Changelist" comment="" />
+      <created>1614311521441</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1614311521441</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="-8" y="-8" width="976" height="1056" extended-state="0" />
+    <editor active="true" />
+    <layout>
+      <window_info content_ui="combo" id="Project" order="0" weight="0.19189766" />
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
+      <window_info id="Favorites" order="2" side_tool="true" />
+      <window_info anchor="bottom" id="Message" order="0" />
+      <window_info anchor="bottom" id="Find" order="1" />
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.2156013" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.39934355" />
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
+      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="bottom" id="Version Control" order="7" />
+      <window_info anchor="bottom" id="Terminal" order="8" />
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
+      <window_info anchor="bottom" id="Python Console" order="10" />
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
+    </layout>
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager>
+      <default-breakpoints>
+        <breakpoint type="python-exception">
+          <properties notifyOnTerminate="true" exception="BaseException">
+            <option name="notifyOnTerminate" value="true" />
+          </properties>
+        </breakpoint>
+      </default-breakpoints>
+    </breakpoint-manager>
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$USER_HOME$/AppData/Roaming/Python/Python37/site-packages/flask/app.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="275">
+          <caret line="1255" column="56" lean-forward="true" selection-start-line="1255" selection-start-column="56" selection-end-line="1255" selection-end-column="56" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/db.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="333">
+          <caret line="26" column="16" lean-forward="true" selection-start-line="26" selection-start-column="16" selection-end-line="26" selection-end-column="16" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/main.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="323">
+          <caret line="19" column="32" selection-start-line="19" selection-start-column="13" selection-end-line="19" selection-end-column="32" />
+          <folding>
+            <element signature="e#0#41#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+</project>

BIN
SrezPy/DatabaseScript.sql


BIN
SrezPy/__pycache__/db.cpython-37.pyc


+ 50 - 0
SrezPy/db.py

@@ -0,0 +1,50 @@
+import pyodbc
+
+
+CONNECTION = pyodbc.connect('Driver={SQL Server};'
+                            'Server=mssql;'
+                            'Database=sneiasckin;'
+                            'Trusted_Connection=true;')
+
+
+def get_all_users():
+    cursor = CONNECTION.cursor()
+    data = []
+
+    for row in cursor.execute('''
+            select * from Users'''):
+        data.append({
+            'Id': row.Id,
+            'LastName': row.LastName,
+            'FirstName': row.FirstName,
+            'MiddleName': row.MiddleName,
+            'IdPrivileges': row.IdPrivileges
+        })
+
+    return data
+
+
+def set_session_user(user_session_data):
+    cursor = CONNECTION.cursor()
+
+    cursor.execute('''insert into SessionUser(DateStart, IdUser)
+                    values (?, ?)''', user_session_data['date_start'], user_session_data['id_user'])
+    CONNECTION.commit()
+
+    for row in cursor.execute('''
+            select Id from SessionUser
+            where Id = (select max(Id) from SessionUser)'''):
+        print(row.Id)
+        return {"id_user_session": row.Id}
+
+
+def update_session_user(user_session_data):
+    cursor = CONNECTION.cursor()
+    print(user_session_data['date_finish'])
+    print(user_session_data['Id'])
+    cursor.execute('''
+            update SessionUser
+            set DateFinish = ?
+            where Id = ?''', user_session_data['date_finish'], user_session_data['Id'])
+
+    CONNECTION.commit()

+ 26 - 0
SrezPy/main.py

@@ -0,0 +1,26 @@
+from flask import Flask, jsonify, request
+import db
+
+
+app = Flask(__name__)
+app.config["DEBUG"] = True
+app.config["JSON_AS_ASCII"] = False
+
+
+@app.route('/', methods=["GET"])
+def index():
+    return jsonify(db.get_all_users())
+
+
+@app.route('/set_session_user', methods=["POST"])
+def set_session_user():
+    return jsonify(db.set_session_user(request.json))
+
+
+@app.route('/update_session_user', methods=["POST"])
+def update_session_user():
+    db.update_session_user(request.json)
+    return "Success"
+
+
+app.run()

+ 6 - 0
WebSocketServerSrez/App.config

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

+ 131 - 0
WebSocketServerSrez/Program.cs

@@ -0,0 +1,131 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Net.WebSockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebSocketServerSrez
+{
+    public class Program
+    {
+        static void Main(string[] args)
+        {
+
+            WebSocketServer(11000);
+        }
+
+        public static void WebSocketServer(int port)
+        {
+            IPHostEntry iPHostEntry = Dns.GetHostEntry("localhost");
+            IPAddress iPAddress = iPHostEntry.AddressList[0];
+            IPEndPoint iPEndPoint = new IPEndPoint(iPAddress, port);
+
+            Socket socketListener = new Socket(iPAddress.AddressFamily, SocketType.Stream,ProtocolType.Tcp);
+
+            try
+            {
+                socketListener.Bind(iPEndPoint);
+                socketListener.Listen(10);
+
+                while (true)
+                {
+                    Socket handler = socketListener.Accept();
+                    string data = null;
+
+                    byte[] bytes = new byte[1024];
+                    int bytesRec = handler.Receive(bytes);
+
+                    // Tut
+                    data += Encoding.UTF8.GetString(bytes, 0, bytesRec);
+
+                    var dataR = data.Split(' ');
+
+                    if (dataR[0] == "SetUserSession")
+                    {
+                        Session.IdUser = Convert.ToInt32(dataR[1]);
+                        Session.DateStart = DateTime.Now;
+
+                        SetSessionUser setSessionUser = new SetSessionUser()
+                        {
+                            id_user = Convert.ToInt32(dataR[1]),
+                            date_start = DateTime.Now.ToString()
+                        };
+
+                        var dataSend = JsonConvert.SerializeObject(setSessionUser, Formatting.Indented);
+
+                        var request = WebRequest.Create("http://127.0.0.1:5000/set_session_user");
+                        request.ContentType = "application/json";
+                        request.Method = "POST";
+
+                        using (var sw = new StreamWriter(request.GetRequestStream()))
+                        {
+                            sw.Write(dataSend);
+                        }
+
+                        var response = request.GetResponse();
+                        using (var sr = new StreamReader(response.GetResponseStream()))
+                        {
+                            var jsonResp = JsonConvert.DeserializeObject<RespSetSessionUser>(sr.ReadToEnd());
+                            
+                            byte[] mes = Encoding.UTF8.GetBytes(jsonResp.id_user_session.ToString());
+
+                            handler.Send(mes);
+                            handler.Shutdown(SocketShutdown.Both);
+                            handler.Close();
+                        }
+                    }
+                    else if (dataR[0] == "UpdateUserSession")
+                    {
+                        Session.DateFinish = DateTime.Now;
+
+                        var request = WebRequest.Create("http://127.0.0.1:5000/update_session_user");
+                        request.ContentType = "application/json";
+                        request.Method = "POST";
+
+                        UpdateSessionUser updateSessionUser = new UpdateSessionUser()
+                        {
+                            Id = Convert.ToInt32(dataR[1]),
+                            date_finish = Session.DateFinish.ToString()
+                        };
+
+                        var dataSend = JsonConvert.SerializeObject(updateSessionUser, Formatting.Indented);
+
+                        using (var sw = new StreamWriter(request.GetRequestStream()))
+                        {
+                            sw.Write(dataSend);
+                        }
+                        request.GetResponse();
+                    }
+                }
+            }
+            catch (Exception)
+            {
+                throw;
+            } 
+            finally
+            {
+            }
+        }
+
+        public class SetSessionUser
+        {
+            public int id_user { get; set; }
+            public string date_start { get; set; }
+        }
+        public class RespSetSessionUser
+        {
+            public int id_user_session { get; set; }
+        }
+
+        public class UpdateSessionUser
+        {
+            public int Id { get; set; }
+            public string date_finish { get; set; }
+        }
+    }
+}

+ 36 - 0
WebSocketServerSrez/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
+// связанные с этой сборкой.
+[assembly: AssemblyTitle("WebSocketServerSrez")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WebSocketServerSrez")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// из модели COM задайте для атрибута ComVisible этого типа значение true.
+[assembly: ComVisible(false)]
+
+// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM
+[assembly: Guid("0dbd7d69-f414-49fb-b610-b1bf9a4eeb91")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Номер редакции
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 17 - 0
WebSocketServerSrez/Session.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebSocketServerSrez
+
+{
+    public static class Session
+    {
+        public static int IdSession { get; set; }
+        public static DateTime DateStart { get; set; }
+        public static DateTime DateFinish { get; set; }
+        public static int IdUser { get; set; }
+    }
+}

+ 16 - 0
WebSocketServerSrez/UserSession.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebSocketServerSrez
+{
+    public class UserSession
+    {
+        public int IdSession { get; set; }
+        public DateTime DateStart { get; set; }
+        public DateTime DateFinish { get; set; }
+        public int IdUser { get; set; }
+    }
+}

+ 17 - 0
WebSocketServerSrez/Users.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WebSocketServerSrez
+{
+    class Users
+    {
+        public int Id { get; set; }
+        public string LastName { get; set; }
+        public string FirstName { get; set; }
+        public string MiddleName { get; set; }
+        public int IdPriliveleges { get; set; }
+    }
+}

+ 60 - 0
WebSocketServerSrez/WebSocketServerSrez.csproj

@@ -0,0 +1,60 @@
+<?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>{0DBD7D69-F414-49FB-B610-B1BF9A4EEB91}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>WebSocketServerSrez</RootNamespace>
+    <AssemblyName>WebSocketServerSrez</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </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.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <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="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Session.cs" />
+    <Compile Include="Users.cs" />
+    <Compile Include="UserSession.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

BIN
WebSocketServerSrez/bin/Debug/Newtonsoft.Json.dll


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 11262 - 0
WebSocketServerSrez/bin/Debug/Newtonsoft.Json.xml


BIN
WebSocketServerSrez/bin/Debug/WebSocketServerSrez.exe


+ 6 - 0
WebSocketServerSrez/bin/Debug/WebSocketServerSrez.exe.config

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

BIN
WebSocketServerSrez/bin/Debug/WebSocketServerSrez.pdb


+ 4 - 0
WebSocketServerSrez/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs

@@ -0,0 +1,4 @@
+// <autogenerated />
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

BIN
WebSocketServerSrez/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


+ 0 - 0
WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csproj.CopyComplete


+ 1 - 0
WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csproj.CoreCompileInputs.cache

@@ -0,0 +1 @@
+290b5ba548e237ad9718854bfbce557f7b8f53c2

+ 10 - 0
WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csproj.FileListAbsolute.txt

@@ -0,0 +1,10 @@
+Z:\Srez\WebSocketServerSrez\bin\Debug\WebSocketServerSrez.exe.config
+Z:\Srez\WebSocketServerSrez\bin\Debug\WebSocketServerSrez.exe
+Z:\Srez\WebSocketServerSrez\bin\Debug\WebSocketServerSrez.pdb
+Z:\Srez\WebSocketServerSrez\obj\Debug\WebSocketServerSrez.csprojAssemblyReference.cache
+Z:\Srez\WebSocketServerSrez\obj\Debug\WebSocketServerSrez.csproj.CoreCompileInputs.cache
+Z:\Srez\WebSocketServerSrez\obj\Debug\WebSocketServerSrez.exe
+Z:\Srez\WebSocketServerSrez\obj\Debug\WebSocketServerSrez.pdb
+Z:\Srez\WebSocketServerSrez\bin\Debug\Newtonsoft.Json.dll
+Z:\Srez\WebSocketServerSrez\bin\Debug\Newtonsoft.Json.xml
+Z:\Srez\WebSocketServerSrez\obj\Debug\WebSocketServerSrez.csproj.CopyComplete

BIN
WebSocketServerSrez/obj/Debug/WebSocketServerSrez.csprojAssemblyReference.cache


BIN
WebSocketServerSrez/obj/Debug/WebSocketServerSrez.exe


BIN
WebSocketServerSrez/obj/Debug/WebSocketServerSrez.pdb


+ 4 - 0
WebSocketServerSrez/packages.config

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

+ 6 - 0
WssGui/App.config

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

+ 0 - 0
WssGui/App.xaml


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä