فهرست منبع

Переделал архитектуру + сделал связь с кассами и их отслеживание

gr672_pgv 4 سال پیش
والد
کامیت
3af843bb80
100فایلهای تغییر یافته به همراه57814 افزوده شده و 383 حذف شده
  1. 6 0
      Cashier/App.config
  2. 11 0
      Cashier/App.xaml
  3. 17 0
      Cashier/App.xaml.cs
  4. 107 0
      Cashier/Cashier.csproj
  5. 21 0
      Cashier/Helper.cs
  6. 17 0
      Cashier/MainWindow.xaml
  7. 40 0
      Cashier/MainWindow.xaml.cs
  8. 14 0
      Cashier/ManagerFrame.cs
  9. 55 0
      Cashier/Properties/AssemblyInfo.cs
  10. 70 0
      Cashier/Properties/Resources.Designer.cs
  11. 117 0
      Cashier/Properties/Resources.resx
  12. 29 0
      Cashier/Properties/Settings.Designer.cs
  13. 7 0
      Cashier/Properties/Settings.settings
  14. 32 0
      Cashier/StartWorkPage.xaml
  15. 80 0
      Cashier/StartWorkPage.xaml.cs
  16. BIN
      Cashier/bin/Debug/Cashier.exe
  17. 6 0
      Cashier/bin/Debug/Cashier.exe.config
  18. BIN
      Cashier/bin/Debug/Cashier.pdb
  19. 4 0
      Cashier/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
  20. BIN
      Cashier/obj/Debug/App.baml
  21. 83 0
      Cashier/obj/Debug/App.g.cs
  22. 83 0
      Cashier/obj/Debug/App.g.i.cs
  23. BIN
      Cashier/obj/Debug/Cashier.Properties.Resources.resources
  24. 1 0
      Cashier/obj/Debug/Cashier.csproj.CoreCompileInputs.cache
  25. 18 0
      Cashier/obj/Debug/Cashier.csproj.FileListAbsolute.txt
  26. BIN
      Cashier/obj/Debug/Cashier.csproj.GenerateResource.cache
  27. BIN
      Cashier/obj/Debug/Cashier.csprojAssemblyReference.cache
  28. BIN
      Cashier/obj/Debug/Cashier.exe
  29. BIN
      Cashier/obj/Debug/Cashier.g.resources
  30. BIN
      Cashier/obj/Debug/Cashier.pdb
  31. 20 0
      Cashier/obj/Debug/Cashier_MarkupCompile.cache
  32. 20 0
      Cashier/obj/Debug/Cashier_MarkupCompile.i.cache
  33. 4 0
      Cashier/obj/Debug/Cashier_MarkupCompile.i.lref
  34. 5 0
      Cashier/obj/Debug/Cashier_MarkupCompile.lref
  35. BIN
      Cashier/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  36. BIN
      Cashier/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  37. BIN
      Cashier/obj/Debug/MainWindow.baml
  38. 112 0
      Cashier/obj/Debug/MainWindow.g.cs
  39. 112 0
      Cashier/obj/Debug/MainWindow.g.i.cs
  40. BIN
      Cashier/obj/Debug/StartWorkPage.baml
  41. 128 0
      Cashier/obj/Debug/StartWorkPage.g.cs
  42. 128 0
      Cashier/obj/Debug/StartWorkPage.g.i.cs
  43. 3 58
      CentralServer/CentralServer.csproj
  44. 18 5
      CentralServer/Program.cs
  45. 17 0
      CentralServer/RootDataOfEmployee.cs
  46. 19 0
      CentralServer/RootDataOfProductInStore.cs
  47. 1 1
      CentralServer/RootDataOfStore.cs
  48. 16 0
      CentralServer/RootDataOfWorkShift.cs
  49. 0 26
      CentralServer/StoreModel.edmx.diagram
  50. BIN
      CentralServer/bin/Debug/CentralServer.exe
  51. BIN
      CentralServer/bin/Debug/CentralServer.pdb
  52. 1 1
      CentralServer/obj/Debug/CentralServer.csproj.CoreCompileInputs.cache
  53. BIN
      CentralServer/obj/Debug/CentralServer.csprojAssemblyReference.cache
  54. BIN
      CentralServer/obj/Debug/CentralServer.exe
  55. BIN
      CentralServer/obj/Debug/CentralServer.pdb
  56. BIN
      CentralServer/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  57. BIN
      CentralServer/obj/Debug/TempPE/StoreModel.Designer.cs.dll
  58. BIN
      CentralServer/obj/Debug/TempPE/StoreModel.cs.dll
  59. 109 0
      CentralServer/obj/Debug/edmxResourcesToEmbed/StoreModel.csdl
  60. 19 1
      CentralServer/obj/Debug/edmxResourcesToEmbed/StoreModel.msl
  61. 88 22
      CentralServer/obj/Debug/edmxResourcesToEmbed/StoreModel.ssdl
  62. 6 6
      StoreAllProject.sln
  63. 21 4
      StoreServer/App.config
  64. 3 3
      CentralServer/Cashier.cs
  65. 2 3
      StoreServer/RootDataOfCashier.cs
  66. 3 3
      CentralServer/Employee.cs
  67. 10 7
      CentralServer/Store.cs
  68. 19 0
      StoreServer/EmployeePartial.cs
  69. 5 1
      StoreServer/Helper.cs
  70. 1 1
      StoreServer/MainWindow.xaml
  71. 6 3
      StoreServer/MainWindow.xaml.cs
  72. 12 9
      CentralServer/StoreModel.Context.cs
  73. 1 1
      CentralServer/StoreModel.Context.tt
  74. 1 1
      CentralServer/StoreModel.Designer.cs
  75. 0 0
      StoreServer/ModelStore.cs
  76. 392 141
      CentralServer/StoreModel.edmx
  77. 34 0
      StoreServer/ModelStore.edmx.diagram
  78. 1 1
      CentralServer/StoreModel.tt
  79. 6 3
      StoreServer/MonitoringCashierPage.xaml
  80. 71 7
      StoreServer/MonitoringCashierPage.xaml.cs
  81. 6 5
      CentralServer/Order.cs
  82. 3 3
      CentralServer/PaymentMetod.cs
  83. 24 0
      StoreServer/PaymentOrder.cs
  84. 3 3
      CentralServer/Product.cs
  85. 2 2
      CentralServer/ProductInOrder.cs
  86. 33 0
      StoreServer/ProductInStore.cs
  87. 0 16
      StoreServer/RootDataOfStore.cs
  88. 10 6
      StoreServer/StartWorkPage.xaml
  89. 8 29
      StoreServer/StartWorkPage.xaml.cs
  90. 35 0
      StoreServer/Store.cs
  91. 82 2
      StoreServer/StoreServer.csproj
  92. 5 5
      CentralServer/WorkShift.cs
  93. 21 0
      StoreServer/WorkShiftPartial.cs
  94. BIN
      StoreServer/bin/Debug/EntityFramework.SqlServer.dll
  95. 2093 0
      StoreServer/bin/Debug/EntityFramework.SqlServer.xml
  96. BIN
      StoreServer/bin/Debug/EntityFramework.dll
  97. 53236 0
      StoreServer/bin/Debug/EntityFramework.xml
  98. BIN
      StoreServer/bin/Debug/StoreServer.exe
  99. 21 4
      StoreServer/bin/Debug/StoreServer.exe.config
  100. 0 0
      StoreServer/bin/Debug/StoreServer.pdb

+ 6 - 0
Cashier/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>

+ 11 - 0
Cashier/App.xaml

@@ -0,0 +1,11 @@
+<Application x:Class="Cashier.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:Cashier"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+        <Style TargetType="TextBlock" >
+            <Setter Property="FontSize" Value="20"></Setter>
+        </Style>
+    </Application.Resources>
+</Application>

+ 17 - 0
Cashier/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 Cashier
+{
+    /// <summary>
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 107 - 0
Cashier/Cashier.csproj

@@ -0,0 +1,107 @@
+<?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>{C831CDB6-72AF-4CB7-BFA2-0A1019F214C4}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>Cashier</RootNamespace>
+    <AssemblyName>Cashier</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="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="StartWorkPage.xaml.cs">
+      <DependentUpon>StartWorkPage.xaml</DependentUpon>
+    </Compile>
+    <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="Helper.cs" />
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="StartWorkPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ManagerFrame.cs" />
+    <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="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 21 - 0
Cashier/Helper.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Cashier
+{
+    public class Helper
+    {
+        public static void ErrorMessage(string message)
+        {
+            MessageBox.Show(message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
+        }
+        public static void InformationMessage(string message)
+        {
+            MessageBox.Show(message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Information);
+        }
+    }
+}

+ 17 - 0
Cashier/MainWindow.xaml

@@ -0,0 +1,17 @@
+<Window x:Class="Cashier.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:Cashier"
+        mc:Ignorable="d"
+        Title="{Binding ElementName=MainFrame, Path=Content.Title}" Height="450" Width="800" WindowStartupLocation="CenterScreen" MinHeight="450" MinWidth="800">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="70"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Button x:Name="BtnBack" Content="Назад" HorizontalAlignment="Right" VerticalAlignment="Center" Width="100" Click="BtnBack_Click" Visibility="Collapsed" Height="30" Margin="0,0,20,0"></Button>
+        <Frame Grid.Row="1" Name="MainFrame" NavigationUIVisibility="Hidden" ContentRendered="MainFrame_ContentRendered"></Frame>
+    </Grid>
+</Window>

+ 40 - 0
Cashier/MainWindow.xaml.cs

@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+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 Cashier
+{
+    /// <summary>
+    /// Interaction logic for MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+            ManagerFrame.MainFrame = this.MainFrame;
+            ManagerFrame.MainFrame.Navigate(new StartWorkPage());
+        }
+
+        private void MainFrame_ContentRendered(object sender, EventArgs e)
+        {
+            BtnBack.Visibility = ManagerFrame.MainFrame.CanGoBack ? Visibility.Visible : Visibility.Collapsed;
+        }
+
+        private void BtnBack_Click(object sender, RoutedEventArgs e)
+        {
+            ManagerFrame.MainFrame.GoBack();
+        }
+    }
+}

+ 14 - 0
Cashier/ManagerFrame.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace Cashier
+{
+   public class ManagerFrame
+    {
+        public static Frame MainFrame;
+    }
+}

+ 55 - 0
Cashier/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Cashier")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Cashier")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
+//inside a <PropertyGroup>.  For example, if you are using US english
+//in your source files, set the <UICulture> to en-US.  Then uncomment
+//the NeutralResourceLanguage attribute below.  Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+                                     //(used if a resource is not found in the page,
+                                     // or application resource dictionaries)
+    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+                                              //(used if a resource is not found in the page,
+                                              // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

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

@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <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 Cashier.Properties
+{
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [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>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </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("Cashier.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </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
Cashier/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
Cashier/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 Cashier.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
Cashier/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>

+ 32 - 0
Cashier/StartWorkPage.xaml

@@ -0,0 +1,32 @@
+<Page x:Class="Cashier.StartWorkPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:Cashier"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="Начало работы">
+
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="3*"/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition/>
+            <RowDefinition Height="3*"/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+        <TextBlock HorizontalAlignment="Right" Grid.Row="1" VerticalAlignment="Center" Margin="5">ID магазина</TextBlock>
+        <TextBox Grid.Row="1" Grid.Column="1" x:Name="TxtIDStore"  Margin="7,5,300,5"/>
+        <TextBlock HorizontalAlignment="Right" Grid.Row="2" VerticalAlignment="Center" Margin="5">Номер кассы</TextBlock>
+        <TextBox Grid.Row="2" Grid.Column="1" x:Name="TxtNumberCashier"  Margin="7,5,300,5"/>
+        <TextBlock HorizontalAlignment="Right" Grid.Row="3" VerticalAlignment="Center" Margin="5">Код сотрудника</TextBlock>
+        <TextBox Grid.Row="3" Grid.Column="1" x:Name="TxtCodeEmployee"  Margin="7,5,300,5"/>
+        <Button Grid.Row="4" Grid.ColumnSpan="2" Height="30" Margin="300,0,300,0" Name="BtnConnect" Click="BtnConnect_Click">Начать</Button>
+    </Grid>
+</Page>

+ 80 - 0
Cashier/StartWorkPage.xaml.cs

@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+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.Navigation;
+using System.Windows.Shapes;
+
+namespace Cashier
+{
+    /// <summary>
+    /// Interaction logic for StartWorkPage.xaml
+    /// </summary>
+    public partial class StartWorkPage : Page
+    {
+        public StartWorkPage()
+        {
+            InitializeComponent();
+        }
+
+        public async void ConnectToStore(string IDStore, string Message)
+        {
+            try
+            {
+                if (IDStore.Length == 1) IDStore.Insert(0, "0");
+                IPEndPoint iPEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), Convert.ToInt32("102" + IDStore));
+                Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+                socket.Connect(iPEndPoint);
+                byte[] data = Encoding.UTF8.GetBytes(Message);
+                socket.Send(data);
+                data = new byte[256];
+                int byts = 0;
+                StringBuilder builder = new StringBuilder();
+                do
+                {
+                    byts = socket.Receive(data, data.Length, 0);
+                    builder.Append(Encoding.UTF8.GetString(data, 0, byts));
+                } while (socket.Available > 0);
+                MessageBox.Show(builder.ToString());
+                socket.Shutdown(SocketShutdown.Both);
+                socket.Close();
+            }
+            catch (Exception)
+            {
+                Helper.ErrorMessage("Нет ответа от сервера");
+            }
+
+        }
+
+        private void BtnConnect_Click(object sender, RoutedEventArgs e)
+        {
+            if (string.IsNullOrEmpty(TxtIDStore.Text) || TxtIDStore.Text.All(char.IsDigit) == false)
+            {
+                Helper.ErrorMessage("Не корректный ID");
+                return;
+            }
+            if (string.IsNullOrEmpty(TxtNumberCashier.Text) || TxtNumberCashier.Text.All(char.IsDigit)== false)
+            {
+                Helper.ErrorMessage("Не корректный номер кассы");
+                return;
+            }
+            if (string.IsNullOrEmpty(TxtCodeEmployee.Text) || TxtCodeEmployee.Text.All(char.IsDigit) == false)
+            {
+                Helper.ErrorMessage("Не корректный код сотрудника");
+                return;
+            }
+            string Message = $"Code cashier={TxtNumberCashier.Text}; Code employee ={TxtCodeEmployee.Text}";
+            ConnectToStore(TxtIDStore.Text, Message);
+        }
+    }
+}

BIN
Cashier/bin/Debug/Cashier.exe


+ 6 - 0
Cashier/bin/Debug/Cashier.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
Cashier/bin/Debug/Cashier.pdb


+ 4 - 0
Cashier/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
Cashier/obj/Debug/App.baml


+ 83 - 0
Cashier/obj/Debug/App.g.cs

@@ -0,0 +1,83 @@
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AD9B0C7226FEE570041659F8412D9F131C662BC0FE707DE83D8B42373230F1EA"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using Cashier;
+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 Cashier {
+    
+    
+    /// <summary>
+    /// App
+    /// </summary>
+    public partial class App : System.Windows.Application {
+        
+        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;
+            
+            #line 5 "..\..\App.xaml"
+            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
+            
+            #line default
+            #line hidden
+            System.Uri resourceLocater = new System.Uri("/Cashier;component/app.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\App.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #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() {
+            Cashier.App app = new Cashier.App();
+            app.InitializeComponent();
+            app.Run();
+        }
+    }
+}
+

+ 83 - 0
Cashier/obj/Debug/App.g.i.cs

@@ -0,0 +1,83 @@
+#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "AD9B0C7226FEE570041659F8412D9F131C662BC0FE707DE83D8B42373230F1EA"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using Cashier;
+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 Cashier {
+    
+    
+    /// <summary>
+    /// App
+    /// </summary>
+    public partial class App : System.Windows.Application {
+        
+        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;
+            
+            #line 5 "..\..\App.xaml"
+            this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
+            
+            #line default
+            #line hidden
+            System.Uri resourceLocater = new System.Uri("/Cashier;component/app.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\App.xaml"
+            System.Windows.Application.LoadComponent(this, resourceLocater);
+            
+            #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() {
+            Cashier.App app = new Cashier.App();
+            app.InitializeComponent();
+            app.Run();
+        }
+    }
+}
+

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


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

@@ -0,0 +1 @@
+9a651debc9ca2b9a7e9a16e7404e195d9a394182

+ 18 - 0
Cashier/obj/Debug/Cashier.csproj.FileListAbsolute.txt

@@ -0,0 +1,18 @@
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\bin\Debug\Cashier.exe.config
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\bin\Debug\Cashier.exe
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\bin\Debug\Cashier.pdb
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.csprojAssemblyReference.cache
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\MainWindow.g.cs
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\StartWorkPage.g.cs
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\App.g.cs
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier_MarkupCompile.cache
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier_MarkupCompile.lref
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\App.baml
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\MainWindow.baml
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\StartWorkPage.baml
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.g.resources
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.Properties.Resources.resources
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.csproj.GenerateResource.cache
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.csproj.CoreCompileInputs.cache
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.exe
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\Cashier.pdb

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


BIN
Cashier/obj/Debug/Cashier.csprojAssemblyReference.cache


BIN
Cashier/obj/Debug/Cashier.exe


BIN
Cashier/obj/Debug/Cashier.g.resources


BIN
Cashier/obj/Debug/Cashier.pdb


+ 20 - 0
Cashier/obj/Debug/Cashier_MarkupCompile.cache

@@ -0,0 +1,20 @@
+Cashier
+
+
+winexe
+C#
+.cs
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\
+Cashier
+none
+false
+DEBUG;TRACE
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\App.xaml
+2-759188912
+
+8-839002340
+13-1505183044
+MainWindow.xaml;StartWorkPage.xaml;
+
+False
+

+ 20 - 0
Cashier/obj/Debug/Cashier_MarkupCompile.i.cache

@@ -0,0 +1,20 @@
+Cashier
+
+
+winexe
+C#
+.cs
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\obj\Debug\
+Cashier
+none
+false
+DEBUG;TRACE
+C:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\App.xaml
+2-759188912
+
+9-1681361707
+13-1505183044
+MainWindow.xaml;StartWorkPage.xaml;
+
+True
+

+ 4 - 0
Cashier/obj/Debug/Cashier_MarkupCompile.i.lref

@@ -0,0 +1,4 @@
+
+
+FC:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\StartWorkPage.xaml;;
+

+ 5 - 0
Cashier/obj/Debug/Cashier_MarkupCompile.lref

@@ -0,0 +1,5 @@
+
+FC:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\App.xaml;;
+FC:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\MainWindow.xaml;;
+FC:\Users\gr672_pgv\source\repos\StoreAllProject\Cashier\StartWorkPage.xaml;;
+

BIN
Cashier/obj/Debug/DesignTimeResolveAssemblyReferences.cache


BIN
Cashier/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
Cashier/obj/Debug/MainWindow.baml


+ 112 - 0
Cashier/obj/Debug/MainWindow.g.cs

@@ -0,0 +1,112 @@
+#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2C0E03236AB82A9F6606ED1A42491FDD077861BF0FAFD7EA68AB826FD14E39A3"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using Cashier;
+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 Cashier {
+    
+    
+    /// <summary>
+    /// MainWindow
+    /// </summary>
+    public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 14 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button BtnBack;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 15 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Frame MainFrame;
+        
+        #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("/Cashier;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.BtnBack = ((System.Windows.Controls.Button)(target));
+            
+            #line 14 "..\..\MainWindow.xaml"
+            this.BtnBack.Click += new System.Windows.RoutedEventHandler(this.BtnBack_Click);
+            
+            #line default
+            #line hidden
+            return;
+            case 2:
+            this.MainFrame = ((System.Windows.Controls.Frame)(target));
+            
+            #line 15 "..\..\MainWindow.xaml"
+            this.MainFrame.ContentRendered += new System.EventHandler(this.MainFrame_ContentRendered);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 112 - 0
Cashier/obj/Debug/MainWindow.g.i.cs

@@ -0,0 +1,112 @@
+#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "2C0E03236AB82A9F6606ED1A42491FDD077861BF0FAFD7EA68AB826FD14E39A3"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using Cashier;
+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 Cashier {
+    
+    
+    /// <summary>
+    /// MainWindow
+    /// </summary>
+    public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 14 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button BtnBack;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 15 "..\..\MainWindow.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Frame MainFrame;
+        
+        #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("/Cashier;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.BtnBack = ((System.Windows.Controls.Button)(target));
+            
+            #line 14 "..\..\MainWindow.xaml"
+            this.BtnBack.Click += new System.Windows.RoutedEventHandler(this.BtnBack_Click);
+            
+            #line default
+            #line hidden
+            return;
+            case 2:
+            this.MainFrame = ((System.Windows.Controls.Frame)(target));
+            
+            #line 15 "..\..\MainWindow.xaml"
+            this.MainFrame.ContentRendered += new System.EventHandler(this.MainFrame_ContentRendered);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

BIN
Cashier/obj/Debug/StartWorkPage.baml


+ 128 - 0
Cashier/obj/Debug/StartWorkPage.g.cs

@@ -0,0 +1,128 @@
+#pragma checksum "..\..\StartWorkPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27B1BDA00FDB99F0D054578A5F93E0A553C9CC2ED2ABA4FA732225F03632DA77"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using Cashier;
+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 Cashier {
+    
+    
+    /// <summary>
+    /// StartWorkPage
+    /// </summary>
+    public partial class StartWorkPage : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 25 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox TxtIDStore;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 27 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox TxtNumberCashier;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 29 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox TxtCodeEmployee;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 30 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button BtnConnect;
+        
+        #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("/Cashier;component/startworkpage.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\StartWorkPage.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.TxtIDStore = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 2:
+            this.TxtNumberCashier = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 3:
+            this.TxtCodeEmployee = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 4:
+            this.BtnConnect = ((System.Windows.Controls.Button)(target));
+            
+            #line 30 "..\..\StartWorkPage.xaml"
+            this.BtnConnect.Click += new System.Windows.RoutedEventHandler(this.BtnConnect_Click);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 128 - 0
Cashier/obj/Debug/StartWorkPage.g.i.cs

@@ -0,0 +1,128 @@
+#pragma checksum "..\..\StartWorkPage.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "27B1BDA00FDB99F0D054578A5F93E0A553C9CC2ED2ABA4FA732225F03632DA77"
+//------------------------------------------------------------------------------
+// <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>
+//------------------------------------------------------------------------------
+
+using Cashier;
+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 Cashier {
+    
+    
+    /// <summary>
+    /// StartWorkPage
+    /// </summary>
+    public partial class StartWorkPage : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
+        
+        
+        #line 25 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox TxtIDStore;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 27 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox TxtNumberCashier;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 29 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.TextBox TxtCodeEmployee;
+        
+        #line default
+        #line hidden
+        
+        
+        #line 30 "..\..\StartWorkPage.xaml"
+        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
+        internal System.Windows.Controls.Button BtnConnect;
+        
+        #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("/Cashier;component/startworkpage.xaml", System.UriKind.Relative);
+            
+            #line 1 "..\..\StartWorkPage.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.TxtIDStore = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 2:
+            this.TxtNumberCashier = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 3:
+            this.TxtCodeEmployee = ((System.Windows.Controls.TextBox)(target));
+            return;
+            case 4:
+            this.BtnConnect = ((System.Windows.Controls.Button)(target));
+            
+            #line 30 "..\..\StartWorkPage.xaml"
+            this.BtnConnect.Click += new System.Windows.RoutedEventHandler(this.BtnConnect_Click);
+            
+            #line default
+            #line hidden
+            return;
+            }
+            this._contentLoaded = true;
+        }
+    }
+}
+

+ 3 - 58
CentralServer/CentralServer.csproj

@@ -55,72 +55,17 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Cashier.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="Employee.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="Order.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="PaymentMetod.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="Product.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="ProductInOrder.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="RootDataOfCashier.cs" />
+    <Compile Include="RootDataOfEmployee.cs" />
+    <Compile Include="RootDataOfProductInStore.cs" />
     <Compile Include="RootDataOfStore.cs" />
-    <Compile Include="Store.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="StoreModel.Context.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>StoreModel.Context.tt</DependentUpon>
-    </Compile>
-    <Compile Include="StoreModel.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
-    <Compile Include="StoreModel.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>StoreModel.edmx</DependentUpon>
-    </Compile>
-    <Compile Include="WorkShift.cs">
-      <DependentUpon>StoreModel.tt</DependentUpon>
-    </Compile>
+    <Compile Include="RootDataOfWorkShift.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
-    <EntityDeploy Include="StoreModel.edmx">
-      <Generator>EntityModelCodeGenerator</Generator>
-      <LastGenOutput>StoreModel.Designer.cs</LastGenOutput>
-    </EntityDeploy>
     <None Include="packages.config" />
-    <None Include="StoreModel.edmx.diagram">
-      <DependentUpon>StoreModel.edmx</DependentUpon>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="StoreModel.Context.tt">
-      <Generator>TextTemplatingFileGenerator</Generator>
-      <LastGenOutput>StoreModel.Context.cs</LastGenOutput>
-      <DependentUpon>StoreModel.edmx</DependentUpon>
-    </Content>
-    <Content Include="StoreModel.tt">
-      <Generator>TextTemplatingFileGenerator</Generator>
-      <DependentUpon>StoreModel.edmx</DependentUpon>
-      <LastGenOutput>StoreModel.cs</LastGenOutput>
-    </Content>
   </ItemGroup>
   <ItemGroup>
     <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />

+ 18 - 5
CentralServer/Program.cs

@@ -11,7 +11,7 @@ namespace CentralServer
 {
     class Program
     {
-       public static gr672_pgvEntities db = new gr672_pgvEntities();
+
         static void Main(string[] args)
         {
             Listener();
@@ -31,8 +31,7 @@ namespace CentralServer
                 if (request.RawUrl.Contains("/getDataOfStore"))
                 {
                     string StoreID = request.RawUrl.Split('=')[1];
-                    int ID = Convert.ToInt32(StoreID);
-                    var Store = db.Stores.Find(ID);
+                    var Store = db.Stores.Find(Convert.ToInt32(StoreID));
                     HttpListenerResponse response = context.Response;
                     if (Store is null)
                     {
@@ -45,11 +44,26 @@ namespace CentralServer
                     else
                     {
                         List<RootDataOfCashier> dataOfCashier = new List<RootDataOfCashier>();
+                        List<RootDataOfProductInStore> dataOfProductInStores = new List<RootDataOfProductInStore>();
                         foreach (var item in Store.Cashiers)
                         {
                             dataOfCashier.Add(new RootDataOfCashier { CashierID = item.CashierID });
                         }
+                        foreach (var item in Store.ProductInStores)
+                        {
+                            dataOfProductInStores.Add(new RootDataOfProductInStore
+                            {
+                                ProductID = item.Product.ProductID,
+                                NameProduct = item.Product.NameProduct,
+                                Weight = item.Product.Weight,
+                                Packaging = item.Product.Packaging,
+                                PriceOfOne = item.Product.PriceOfOne,
+                                BarCode = item.Product.BarCode,
+                                RemainsProduct= item.RemainsProduct
+                            });
+                        }
                         RootDataOfStore rootDataOfStore = new RootDataOfStore();
+                        rootDataOfStore.Product = dataOfProductInStores;
                         rootDataOfStore.Cashiers = dataOfCashier;
                         rootDataOfStore.StoreID = Store.StoreID;
                         rootDataOfStore.Address = Store.Address;
@@ -59,8 +73,7 @@ namespace CentralServer
                         Stream output = response.OutputStream;
                         output.Write(buffer, 0, buffer.Length);
                         output.Close();
-                    }       
-
+                    }
                 }
             }
         }

+ 17 - 0
CentralServer/RootDataOfEmployee.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CentralServer
+{
+    public class RootDataOfEmployee
+    {
+        public int EmployeeID { get; set; }
+        public string LastName { get; set; }
+        public string Name { get; set; }
+        public string MiddleName { get; set; }
+        public string Code { get; set; }
+    }
+}

+ 19 - 0
CentralServer/RootDataOfProductInStore.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CentralServer
+{
+   public class RootDataOfProductInStore
+    {
+        public int ProductID { get; set; }
+        public string NameProduct { get; set; }
+        public int Weight { get; set; }
+        public int Packaging { get; set; }
+        public decimal PriceOfOne { get; set; }
+        public string BarCode { get; set; }
+        public int RemainsProduct { get; set; }
+    }
+}

+ 1 - 1
CentralServer/RootDataOfStore.cs

@@ -10,7 +10,7 @@ namespace CentralServer
     {
         public int StoreID { get; set; }
         public string Address { get; set; }
-
         public List<RootDataOfCashier> Cashiers { get; set; }
+        public List<RootDataOfProductInStore> Product { get; set; }
     }
 }

+ 16 - 0
CentralServer/RootDataOfWorkShift.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CentralServer
+{
+    public class RootDataOfWorkShift
+    {
+        public RootDataOfCashier Cashier { get; set; }
+        public RootDataOfEmployee Employee { get; set; }
+        public DateTime StartDateAndTimeWork { get; set; }
+        public Nullable<DateTime> EndDateAndTimeWork { get; set; }
+    }
+}

+ 0 - 26
CentralServer/StoreModel.edmx.diagram

@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
- <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
-  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
-    <!-- Diagram content (shape and connector positions) -->
-    <edmx:Diagrams>
-      <Diagram DiagramId="2f87749bf36e41f2bb860cfba28d3d76" Name="Diagram1">
-        <EntityTypeShape EntityType="gr672_pgvModel.Employee" Width="1.5" PointX="1.75" PointY="1" />
-        <EntityTypeShape EntityType="gr672_pgvModel.Order" Width="1.5" PointX="6.25" PointY="0.875" />
-        <EntityTypeShape EntityType="gr672_pgvModel.PaymentMetod" Width="1.5" PointX="4" PointY="5.25" />
-        <EntityTypeShape EntityType="gr672_pgvModel.Product" Width="1.5" PointX="6.25" PointY="4.875" />
-        <EntityTypeShape EntityType="gr672_pgvModel.ProductInOrder" Width="1.5" PointX="8.5" PointY="1.125" />
-        <EntityTypeShape EntityType="gr672_pgvModel.Store" Width="1.5" PointX="8.75" PointY="4.625" />
-        <EntityTypeShape EntityType="gr672_pgvModel.WorkShift" Width="1.5" PointX="4" PointY="0.875" />
-        <AssociationConnector Association="gr672_pgvModel.FK_WorkShift_Employee" />
-        <AssociationConnector Association="gr672_pgvModel.FK_Order_PaymentMetod" />
-        <AssociationConnector Association="gr672_pgvModel.FK_Order_WorkShift" />
-        <AssociationConnector Association="gr672_pgvModel.FK_ProductInOrder_Order" />
-        <AssociationConnector Association="gr672_pgvModel.FK_ProductInOrder_Product" />
-        <EntityTypeShape EntityType="gr672_pgvModel.Cashier" Width="1.5" PointX="11" PointY="4.5" />
-        <AssociationConnector Association="gr672_pgvModel.FK_Cashier_Store" />
-        <AssociationConnector Association="gr672_pgvModel.FK_WorkShift_Cashier" />
-      </Diagram>
-    </edmx:Diagrams>
-  </edmx:Designer>
-</edmx:Edmx>

BIN
CentralServer/bin/Debug/CentralServer.exe


BIN
CentralServer/bin/Debug/CentralServer.pdb


+ 1 - 1
CentralServer/obj/Debug/CentralServer.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-559f3312610c7046dfe19da5f145bd03482f2228
+ecd59829e19c329d962690f484cc8e792284b68a

BIN
CentralServer/obj/Debug/CentralServer.csprojAssemblyReference.cache


BIN
CentralServer/obj/Debug/CentralServer.exe


BIN
CentralServer/obj/Debug/CentralServer.pdb


BIN
CentralServer/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
CentralServer/obj/Debug/TempPE/StoreModel.Designer.cs.dll


BIN
CentralServer/obj/Debug/TempPE/StoreModel.cs.dll


+ 109 - 0
CentralServer/obj/Debug/edmxResourcesToEmbed/StoreModel.csdl

@@ -37,6 +37,28 @@
       <End Role="Cashier" EntitySet="Cashiers" />
       <End Role="WorkShift" EntitySet="WorkShifts" />
     </AssociationSet>
+    <EntitySet Name="PaymentOrders" EntityType="gr672_pgvModel.PaymentOrder" />
+    <EntitySet Name="ProductInStores" EntityType="gr672_pgvModel.ProductInStore" />
+    <AssociationSet Name="FK_PaymentOrder_Order" Association="gr672_pgvModel.FK_PaymentOrder_Order">
+      <End Role="Order" EntitySet="Orders" />
+      <End Role="PaymentOrder" EntitySet="PaymentOrders" />
+    </AssociationSet>
+    <AssociationSet Name="FK_PaymentOrder_PaymentMetod" Association="gr672_pgvModel.FK_PaymentOrder_PaymentMetod">
+      <End Role="PaymentMetod" EntitySet="PaymentMetods" />
+      <End Role="PaymentOrder" EntitySet="PaymentOrders" />
+    </AssociationSet>
+    <AssociationSet Name="FK_ProductInStore_Product" Association="gr672_pgvModel.FK_ProductInStore_Product">
+      <End Role="Product" EntitySet="Products" />
+      <End Role="ProductInStore" EntitySet="ProductInStores" />
+    </AssociationSet>
+    <AssociationSet Name="FK_ProductInOrder_ProductInStore" Association="gr672_pgvModel.FK_ProductInOrder_ProductInStore">
+      <End Role="ProductInStore" EntitySet="ProductInStores" />
+      <End Role="ProductInOrder" EntitySet="ProductInOrders" />
+    </AssociationSet>
+    <AssociationSet Name="FK_ProductInStore_Store" Association="gr672_pgvModel.FK_ProductInStore_Store">
+      <End Role="Store" EntitySet="Stores" />
+      <End Role="ProductInStore" EntitySet="ProductInStores" />
+    </AssociationSet>
   </EntityContainer>
   <EntityType Name="Employee">
     <Key>
@@ -61,6 +83,7 @@
     <NavigationProperty Name="PaymentMetod" Relationship="gr672_pgvModel.FK_Order_PaymentMetod" FromRole="Order" ToRole="PaymentMetod" />
     <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_Order_WorkShift" FromRole="Order" ToRole="WorkShift" />
     <NavigationProperty Name="ProductInOrders" Relationship="gr672_pgvModel.FK_ProductInOrder_Order" FromRole="Order" ToRole="ProductInOrder" />
+    <NavigationProperty Name="PaymentOrders" Relationship="gr672_pgvModel.FK_PaymentOrder_Order" FromRole="Order" ToRole="PaymentOrder" />
   </EntityType>
   <EntityType Name="PaymentMetod">
     <Key>
@@ -69,6 +92,7 @@
     <Property Name="PaymentMetodID" Type="Int32" Nullable="false" />
     <Property Name="PaymentMetodName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
     <NavigationProperty Name="Orders" Relationship="gr672_pgvModel.FK_Order_PaymentMetod" FromRole="PaymentMetod" ToRole="Order" />
+    <NavigationProperty Name="PaymentOrders" Relationship="gr672_pgvModel.FK_PaymentOrder_PaymentMetod" FromRole="PaymentMetod" ToRole="PaymentOrder" />
   </EntityType>
   <EntityType Name="Product">
     <Key>
@@ -81,6 +105,7 @@
     <Property Name="PriceOfOne" Type="Decimal" Nullable="false" Precision="19" Scale="4" />
     <Property Name="BarCode" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
     <NavigationProperty Name="ProductInOrders" Relationship="gr672_pgvModel.FK_ProductInOrder_Product" FromRole="Product" ToRole="ProductInOrder" />
+    <NavigationProperty Name="ProductInStores" Relationship="gr672_pgvModel.FK_ProductInStore_Product" FromRole="Product" ToRole="ProductInStore" />
   </EntityType>
   <EntityType Name="ProductInOrder">
     <Key>
@@ -92,6 +117,7 @@
     <Property Name="AmountProduct" Type="Int32" Nullable="false" />
     <NavigationProperty Name="Order" Relationship="gr672_pgvModel.FK_ProductInOrder_Order" FromRole="ProductInOrder" ToRole="Order" />
     <NavigationProperty Name="Product" Relationship="gr672_pgvModel.FK_ProductInOrder_Product" FromRole="ProductInOrder" ToRole="Product" />
+    <NavigationProperty Name="ProductInStore" Relationship="gr672_pgvModel.FK_ProductInOrder_ProductInStore" FromRole="ProductInOrder" ToRole="ProductInStore" />
   </EntityType>
   <EntityType Name="Store">
     <Key>
@@ -100,6 +126,7 @@
     <Property Name="StoreID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
     <Property Name="Address" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
     <NavigationProperty Name="Cashiers" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Store" ToRole="Cashier" />
+    <NavigationProperty Name="ProductInStores" Relationship="gr672_pgvModel.FK_ProductInStore_Store" FromRole="Store" ToRole="ProductInStore" />
   </EntityType>
   <EntityType Name="WorkShift">
     <Key>
@@ -207,4 +234,86 @@
       </Dependent>
     </ReferentialConstraint>
   </Association>
+  <EntityType Name="PaymentOrder">
+    <Key>
+      <PropertyRef Name="PaymentID" />
+    </Key>
+    <Property Name="PaymentID" Type="Int32" Nullable="false" />
+    <Property Name="IDPaymentMetod" Type="Int32" Nullable="false" />
+    <Property Name="IDOrder" Type="Int32" Nullable="false" />
+    <NavigationProperty Name="Order" Relationship="gr672_pgvModel.FK_PaymentOrder_Order" FromRole="PaymentOrder" ToRole="Order" />
+    <NavigationProperty Name="PaymentMetod" Relationship="gr672_pgvModel.FK_PaymentOrder_PaymentMetod" FromRole="PaymentOrder" ToRole="PaymentMetod" />
+  </EntityType>
+  <EntityType Name="ProductInStore">
+    <Key>
+      <PropertyRef Name="ProductInStoreID" />
+    </Key>
+    <Property Name="IDStore" Type="Int32" Nullable="false" />
+    <Property Name="IDProduct" Type="Int32" Nullable="false" />
+    <Property Name="RemainsProduct" Type="Int32" Nullable="false" />
+    <Property Name="ProductInStoreID" Type="Int32" Nullable="false" />
+    <NavigationProperty Name="Product" Relationship="gr672_pgvModel.FK_ProductInStore_Product" FromRole="ProductInStore" ToRole="Product" />
+    <NavigationProperty Name="ProductInOrders" Relationship="gr672_pgvModel.FK_ProductInOrder_ProductInStore" FromRole="ProductInStore" ToRole="ProductInOrder" />
+    <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_ProductInStore_Store" FromRole="ProductInStore" ToRole="Store" />
+  </EntityType>
+  <Association Name="FK_PaymentOrder_Order">
+    <End Type="gr672_pgvModel.Order" Role="Order" Multiplicity="1" />
+    <End Type="gr672_pgvModel.PaymentOrder" Role="PaymentOrder" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Order">
+        <PropertyRef Name="OrderID" />
+      </Principal>
+      <Dependent Role="PaymentOrder">
+        <PropertyRef Name="IDOrder" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_PaymentOrder_PaymentMetod">
+    <End Type="gr672_pgvModel.PaymentMetod" Role="PaymentMetod" Multiplicity="1" />
+    <End Type="gr672_pgvModel.PaymentOrder" Role="PaymentOrder" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="PaymentMetod">
+        <PropertyRef Name="PaymentMetodID" />
+      </Principal>
+      <Dependent Role="PaymentOrder">
+        <PropertyRef Name="IDPaymentMetod" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_ProductInStore_Product">
+    <End Type="gr672_pgvModel.Product" Role="Product" Multiplicity="1" />
+    <End Type="gr672_pgvModel.ProductInStore" Role="ProductInStore" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Product">
+        <PropertyRef Name="ProductID" />
+      </Principal>
+      <Dependent Role="ProductInStore">
+        <PropertyRef Name="IDProduct" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_ProductInOrder_ProductInStore">
+    <End Type="gr672_pgvModel.ProductInStore" Role="ProductInStore" Multiplicity="1" />
+    <End Type="gr672_pgvModel.ProductInOrder" Role="ProductInOrder" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="ProductInStore">
+        <PropertyRef Name="ProductInStoreID" />
+      </Principal>
+      <Dependent Role="ProductInOrder">
+        <PropertyRef Name="IDProduct" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_ProductInStore_Store">
+    <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
+    <End Type="gr672_pgvModel.ProductInStore" Role="ProductInStore" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Store">
+        <PropertyRef Name="StoreID" />
+      </Principal>
+      <Dependent Role="ProductInStore">
+        <PropertyRef Name="IDStore" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
 </Schema>

+ 19 - 1
CentralServer/obj/Debug/edmxResourcesToEmbed/StoreModel.msl

@@ -15,7 +15,6 @@
     <EntitySetMapping Name="Orders">
       <EntityTypeMapping TypeName="gr672_pgvModel.Order">
         <MappingFragment StoreEntitySet="Order">
-          <ScalarProperty Name="IDPaymentMetod" ColumnName="IDPaymentMetod" />
           <ScalarProperty Name="State" ColumnName="State" />
           <ScalarProperty Name="IDWorkShift" ColumnName="IDWorkShift" />
           <ScalarProperty Name="Date" ColumnName="Date" />
@@ -79,5 +78,24 @@
         </MappingFragment>
       </EntityTypeMapping>
     </EntitySetMapping>
+    <EntitySetMapping Name="PaymentOrders">
+      <EntityTypeMapping TypeName="gr672_pgvModel.PaymentOrder">
+        <MappingFragment StoreEntitySet="PaymentOrder">
+          <ScalarProperty Name="IDOrder" ColumnName="IDOrder" />
+          <ScalarProperty Name="IDPaymentMetod" ColumnName="IDPaymentMetod" />
+          <ScalarProperty Name="PaymentID" ColumnName="PaymentID" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
+    <EntitySetMapping Name="ProductInStores">
+      <EntityTypeMapping TypeName="gr672_pgvModel.ProductInStore">
+        <MappingFragment StoreEntitySet="ProductInStore">
+          <ScalarProperty Name="ProductInStoreID" ColumnName="ProductInStoreID" />
+          <ScalarProperty Name="RemainsProduct" ColumnName="RemainsProduct" />
+          <ScalarProperty Name="IDProduct" ColumnName="IDProduct" />
+          <ScalarProperty Name="IDStore" ColumnName="IDStore" />
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
   </EntityContainerMapping>
 </Mapping>

+ 88 - 22
CentralServer/obj/Debug/edmxResourcesToEmbed/StoreModel.ssdl

@@ -25,7 +25,6 @@
     <Property Name="Date" Type="date" Nullable="false" />
     <Property Name="IDWorkShift" Type="int" Nullable="false" />
     <Property Name="State" Type="bit" Nullable="false" />
-    <Property Name="IDPaymentMetod" Type="int" />
   </EntityType>
   <EntityType Name="PaymentMetod">
     <Key>
@@ -34,6 +33,14 @@
     <Property Name="PaymentMetodID" Type="int" Nullable="false" />
     <Property Name="PaymentMetodName" Type="nvarchar" MaxLength="50" Nullable="false" />
   </EntityType>
+  <EntityType Name="PaymentOrder">
+    <Key>
+      <PropertyRef Name="PaymentID" />
+    </Key>
+    <Property Name="PaymentID" Type="int" Nullable="false" />
+    <Property Name="IDPaymentMetod" Type="int" Nullable="false" />
+    <Property Name="IDOrder" Type="int" Nullable="false" />
+  </EntityType>
   <EntityType Name="Product">
     <Key>
       <PropertyRef Name="ProductID" />
@@ -54,6 +61,15 @@
     <Property Name="IDProduct" Type="int" Nullable="false" />
     <Property Name="AmountProduct" Type="int" Nullable="false" />
   </EntityType>
+  <EntityType Name="ProductInStore">
+    <Key>
+      <PropertyRef Name="ProductInStoreID" />
+    </Key>
+    <Property Name="IDStore" Type="int" Nullable="false" />
+    <Property Name="IDProduct" Type="int" Nullable="false" />
+    <Property Name="RemainsProduct" Type="int" Nullable="false" />
+    <Property Name="ProductInStoreID" Type="int" Nullable="false" />
+  </EntityType>
   <EntityType Name="Store">
     <Key>
       <PropertyRef Name="StoreID" />
@@ -83,18 +99,6 @@
       </Dependent>
     </ReferentialConstraint>
   </Association>
-  <Association Name="FK_Order_PaymentMetod">
-    <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="0..1" />
-    <End Role="Order" Type="Self.Order" Multiplicity="*" />
-    <ReferentialConstraint>
-      <Principal Role="PaymentMetod">
-        <PropertyRef Name="PaymentMetodID" />
-      </Principal>
-      <Dependent Role="Order">
-        <PropertyRef Name="IDPaymentMetod" />
-      </Dependent>
-    </ReferentialConstraint>
-  </Association>
   <Association Name="FK_Order_WorkShift">
     <End Role="WorkShift" Type="Self.WorkShift" Multiplicity="1" />
     <End Role="Order" Type="Self.Order" Multiplicity="*" />
@@ -107,6 +111,30 @@
       </Dependent>
     </ReferentialConstraint>
   </Association>
+  <Association Name="FK_PaymentOrder_Order">
+    <End Role="Order" Type="Self.Order" Multiplicity="1" />
+    <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Order">
+        <PropertyRef Name="OrderID" />
+      </Principal>
+      <Dependent Role="PaymentOrder">
+        <PropertyRef Name="IDOrder" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_PaymentOrder_PaymentMetod">
+    <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="1" />
+    <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="PaymentMetod">
+        <PropertyRef Name="PaymentMetodID" />
+      </Principal>
+      <Dependent Role="PaymentOrder">
+        <PropertyRef Name="IDPaymentMetod" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
   <Association Name="FK_ProductInOrder_Order">
     <End Role="Order" Type="Self.Order" Multiplicity="1" />
     <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
@@ -119,18 +147,42 @@
       </Dependent>
     </ReferentialConstraint>
   </Association>
-  <Association Name="FK_ProductInOrder_Product">
-    <End Role="Product" Type="Self.Product" Multiplicity="1" />
+  <Association Name="FK_ProductInOrder_ProductInStore">
+    <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="1" />
     <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
     <ReferentialConstraint>
+      <Principal Role="ProductInStore">
+        <PropertyRef Name="ProductInStoreID" />
+      </Principal>
+      <Dependent Role="ProductInOrder">
+        <PropertyRef Name="IDProduct" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
+  <Association Name="FK_ProductInStore_Product">
+    <End Role="Product" Type="Self.Product" Multiplicity="1" />
+    <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
+    <ReferentialConstraint>
       <Principal Role="Product">
         <PropertyRef Name="ProductID" />
       </Principal>
-      <Dependent Role="ProductInOrder">
+      <Dependent Role="ProductInStore">
         <PropertyRef Name="IDProduct" />
       </Dependent>
     </ReferentialConstraint>
   </Association>
+  <Association Name="FK_ProductInStore_Store">
+    <End Role="Store" Type="Self.Store" Multiplicity="1" />
+    <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
+    <ReferentialConstraint>
+      <Principal Role="Store">
+        <PropertyRef Name="StoreID" />
+      </Principal>
+      <Dependent Role="ProductInStore">
+        <PropertyRef Name="IDStore" />
+      </Dependent>
+    </ReferentialConstraint>
+  </Association>
   <Association Name="FK_WorkShift_Cashier">
     <End Role="Cashier" Type="Self.Cashier" Multiplicity="1" />
     <End Role="WorkShift" Type="Self.WorkShift" Multiplicity="*" />
@@ -160,30 +212,44 @@
     <EntitySet Name="Employee" EntityType="Self.Employee" Schema="dbo" store:Type="Tables" />
     <EntitySet Name="Order" EntityType="Self.Order" Schema="dbo" store:Type="Tables" />
     <EntitySet Name="PaymentMetod" EntityType="Self.PaymentMetod" Schema="dbo" store:Type="Tables" />
+    <EntitySet Name="PaymentOrder" EntityType="Self.PaymentOrder" Schema="dbo" store:Type="Tables" />
     <EntitySet Name="Product" EntityType="Self.Product" Schema="dbo" store:Type="Tables" />
     <EntitySet Name="ProductInOrder" EntityType="Self.ProductInOrder" Schema="dbo" store:Type="Tables" />
+    <EntitySet Name="ProductInStore" EntityType="Self.ProductInStore" Schema="dbo" store:Type="Tables" />
     <EntitySet Name="Store" EntityType="Self.Store" Schema="dbo" store:Type="Tables" />
     <EntitySet Name="WorkShift" EntityType="Self.WorkShift" Schema="dbo" store:Type="Tables" />
     <AssociationSet Name="FK_Cashier_Store" Association="Self.FK_Cashier_Store">
       <End Role="Store" EntitySet="Store" />
       <End Role="Cashier" EntitySet="Cashier" />
     </AssociationSet>
-    <AssociationSet Name="FK_Order_PaymentMetod" Association="Self.FK_Order_PaymentMetod">
-      <End Role="PaymentMetod" EntitySet="PaymentMetod" />
-      <End Role="Order" EntitySet="Order" />
-    </AssociationSet>
     <AssociationSet Name="FK_Order_WorkShift" Association="Self.FK_Order_WorkShift">
       <End Role="WorkShift" EntitySet="WorkShift" />
       <End Role="Order" EntitySet="Order" />
     </AssociationSet>
+    <AssociationSet Name="FK_PaymentOrder_Order" Association="Self.FK_PaymentOrder_Order">
+      <End Role="Order" EntitySet="Order" />
+      <End Role="PaymentOrder" EntitySet="PaymentOrder" />
+    </AssociationSet>
+    <AssociationSet Name="FK_PaymentOrder_PaymentMetod" Association="Self.FK_PaymentOrder_PaymentMetod">
+      <End Role="PaymentMetod" EntitySet="PaymentMetod" />
+      <End Role="PaymentOrder" EntitySet="PaymentOrder" />
+    </AssociationSet>
     <AssociationSet Name="FK_ProductInOrder_Order" Association="Self.FK_ProductInOrder_Order">
       <End Role="Order" EntitySet="Order" />
       <End Role="ProductInOrder" EntitySet="ProductInOrder" />
     </AssociationSet>
-    <AssociationSet Name="FK_ProductInOrder_Product" Association="Self.FK_ProductInOrder_Product">
-      <End Role="Product" EntitySet="Product" />
+    <AssociationSet Name="FK_ProductInOrder_ProductInStore" Association="Self.FK_ProductInOrder_ProductInStore">
+      <End Role="ProductInStore" EntitySet="ProductInStore" />
       <End Role="ProductInOrder" EntitySet="ProductInOrder" />
     </AssociationSet>
+    <AssociationSet Name="FK_ProductInStore_Product" Association="Self.FK_ProductInStore_Product">
+      <End Role="Product" EntitySet="Product" />
+      <End Role="ProductInStore" EntitySet="ProductInStore" />
+    </AssociationSet>
+    <AssociationSet Name="FK_ProductInStore_Store" Association="Self.FK_ProductInStore_Store">
+      <End Role="Store" EntitySet="Store" />
+      <End Role="ProductInStore" EntitySet="ProductInStore" />
+    </AssociationSet>
     <AssociationSet Name="FK_WorkShift_Cashier" Association="Self.FK_WorkShift_Cashier">
       <End Role="Cashier" EntitySet="Cashier" />
       <End Role="WorkShift" EntitySet="WorkShift" />

+ 6 - 6
StoreAllProject.sln

@@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 VisualStudioVersion = 16.0.31019.35
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CentralServer", "CentralServer\CentralServer.csproj", "{A8239E54-1EC2-4E1B-A7D0-371979E36CD5}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StoreServer", "StoreServer\StoreServer.csproj", "{2EF40209-56F6-4989-A225-3F800A9725ED}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cashier", "Cashier\Cashier.csproj", "{C831CDB6-72AF-4CB7-BFA2-0A1019F214C4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{A8239E54-1EC2-4E1B-A7D0-371979E36CD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{A8239E54-1EC2-4E1B-A7D0-371979E36CD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{A8239E54-1EC2-4E1B-A7D0-371979E36CD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{A8239E54-1EC2-4E1B-A7D0-371979E36CD5}.Release|Any CPU.Build.0 = Release|Any CPU
 		{2EF40209-56F6-4989-A225-3F800A9725ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{2EF40209-56F6-4989-A225-3F800A9725ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{2EF40209-56F6-4989-A225-3F800A9725ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{2EF40209-56F6-4989-A225-3F800A9725ED}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C831CDB6-72AF-4CB7-BFA2-0A1019F214C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C831CDB6-72AF-4CB7-BFA2-0A1019F214C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C831CDB6-72AF-4CB7-BFA2-0A1019F214C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C831CDB6-72AF-4CB7-BFA2-0A1019F214C4}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 21 - 4
StoreServer/App.config

@@ -1,6 +1,23 @@
-<?xml version="1.0" encoding="utf-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
-    </startup>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
+  </startup>
+  <connectionStrings>
+    <add name="gr672_pgvEntities" connectionString="metadata=res://*/ModelStore.csdl|res://*/ModelStore.ssdl|res://*/ModelStore.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=mssql;initial catalog=gr672_pgv;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+  <entityFramework>
+    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+      <parameters>
+        <parameter value="mssqllocaldb" />
+      </parameters>
+    </defaultConnectionFactory>
+    <providers>
+      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+    </providers>
+  </entityFramework>
 </configuration>

+ 3 - 3
CentralServer/Cashier.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -17,7 +17,7 @@ namespace CentralServer
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Cashier()
         {
-            this.WorkShifts = new HashSet<WorkShift>();
+            this.WorkShift = new HashSet<WorkShift>();
         }
     
         public int CashierID { get; set; }
@@ -25,6 +25,6 @@ namespace CentralServer
     
         public virtual Store Store { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<WorkShift> WorkShifts { get; set; }
+        public virtual ICollection<WorkShift> WorkShift { get; set; }
     }
 }

+ 2 - 3
StoreServer/RootDataOfCashier.cs

@@ -6,9 +6,8 @@ using System.Threading.Tasks;
 
 namespace StoreServer
 {
-    public class RootDataOfCashier
+    public class DB
     {
-        public int CashierID { get; set; }
-        public string IsStart { get; set; }
+       public static gr672_pgvEntities db = new gr672_pgvEntities();
     }
 }

+ 3 - 3
CentralServer/Employee.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -17,7 +17,7 @@ namespace CentralServer
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Employee()
         {
-            this.WorkShifts = new HashSet<WorkShift>();
+            this.EmployeeInStore = new HashSet<EmployeeInStore>();
         }
     
         public int EmployeeID { get; set; }
@@ -27,6 +27,6 @@ namespace CentralServer
         public string Code { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<WorkShift> WorkShifts { get; set; }
+        public virtual ICollection<EmployeeInStore> EmployeeInStore { get; set; }
     }
 }

+ 10 - 7
CentralServer/Store.cs

@@ -7,23 +7,26 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
     
-    public partial class Store
+    public partial class EmployeeInStore
     {
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public Store()
+        public EmployeeInStore()
         {
-            this.Cashiers = new HashSet<Cashier>();
+            this.WorkShift = new HashSet<WorkShift>();
         }
     
-        public int StoreID { get; set; }
-        public string Address { get; set; }
+        public int IDStore { get; set; }
+        public int IDEmployee { get; set; }
+        public int IDEmployeeInStore { get; set; }
     
+        public virtual Employee Employee { get; set; }
+        public virtual Store Store { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Cashier> Cashiers { get; set; }
+        public virtual ICollection<WorkShift> WorkShift { get; set; }
     }
 }

+ 19 - 0
StoreServer/EmployeePartial.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StoreServer
+{
+    public partial class Employee
+    {
+        public string FullName
+        {
+            get
+            {
+                return $"{LastName} {Name[0]} {MiddleName[0]}";
+            }
+        }
+    }
+}

+ 5 - 1
StoreServer/Helper.cs

@@ -13,6 +13,10 @@ namespace StoreServer
         {
             MessageBox.Show(message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
         }
-        public static RootDataOfStore FindStore;
+        public static void InformationMessage(string message)
+        {
+            MessageBox.Show(message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Information);
+        }
+        public static Store FindStore;
     }
 }

+ 1 - 1
StoreServer/MainWindow.xaml

@@ -5,7 +5,7 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:StoreServer"
         mc:Ignorable="d"
-        Title="{Binding ElementName=MainFrame, Path=Content.Title}" Height="450" Width="800">
+        Title="{Binding ElementName=MainFrame, Path=Content.Title}" Height="450" Width="800" WindowStartupLocation="CenterScreen" MinHeight="450" MinWidth="800">
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="70"/>

+ 6 - 3
StoreServer/MainWindow.xaml.cs

@@ -1,6 +1,9 @@
-using System;
+using Newtonsoft.Json;
+using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
+using System.Net;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
@@ -26,8 +29,8 @@ namespace StoreServer
             ManagerFrame.MainFrame = this.MainFrame;
             ManagerFrame.MainFrame.Navigate(new StartWorkPage());
         }
-
-        private void MainFrame_ContentRendered(object sender, EventArgs e)
+            
+            private void MainFrame_ContentRendered(object sender, EventArgs e)
         {
             BtnBack.Visibility = ManagerFrame.MainFrame.CanGoBack ? Visibility.Visible : Visibility.Collapsed;
         }

+ 12 - 9
CentralServer/StoreModel.Context.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Data.Entity;
@@ -25,13 +25,16 @@ namespace CentralServer
             throw new UnintentionalCodeFirstException();
         }
     
-        public virtual DbSet<Employee> Employees { get; set; }
-        public virtual DbSet<Order> Orders { get; set; }
-        public virtual DbSet<PaymentMetod> PaymentMetods { get; set; }
-        public virtual DbSet<Product> Products { get; set; }
-        public virtual DbSet<ProductInOrder> ProductInOrders { get; set; }
-        public virtual DbSet<Store> Stores { get; set; }
-        public virtual DbSet<WorkShift> WorkShifts { get; set; }
-        public virtual DbSet<Cashier> Cashiers { get; set; }
+        public virtual DbSet<Employee> Employee { get; set; }
+        public virtual DbSet<Order> Order { get; set; }
+        public virtual DbSet<PaymentMetod> PaymentMetod { get; set; }
+        public virtual DbSet<PaymentOrder> PaymentOrder { get; set; }
+        public virtual DbSet<Product> Product { get; set; }
+        public virtual DbSet<ProductInOrder> ProductInOrder { get; set; }
+        public virtual DbSet<ProductInStore> ProductInStore { get; set; }
+        public virtual DbSet<Store> Store { get; set; }
+        public virtual DbSet<WorkShift> WorkShift { get; set; }
+        public virtual DbSet<Cashier> Cashier { get; set; }
+        public virtual DbSet<EmployeeInStore> EmployeeInStore { get; set; }
     }
 }

+ 1 - 1
CentralServer/StoreModel.Context.tt

@@ -2,7 +2,7 @@
 <#@ include file="EF6.Utility.CS.ttinclude"#><#@
  output extension=".cs"#><#
 
-const string inputFile = @"StoreModel.edmx";
+const string inputFile = @"ModelStore.edmx";
 var textTransform = DynamicTextTransformation.Create(this);
 var code = new CodeGenerationTools(this);
 var ef = new MetadataTools(this);

+ 1 - 1
CentralServer/StoreModel.Designer.cs

@@ -1,4 +1,4 @@
-// T4 code generation is enabled for model 'C:\Users\gr672_pgv\source\repos\StoreAllProject\CentralServer\StoreModel.edmx'. 
+// T4 code generation is enabled for model 'C:\Users\gr672_pgv\source\repos\StoreAllProject\StoreServer\ModelStore.edmx'. 
 // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
 // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
 // is open in the designer.

CentralServer/StoreModel.cs → StoreServer/ModelStore.cs


+ 392 - 141
CentralServer/StoreModel.edmx

@@ -22,6 +22,14 @@
           <Property Name="MiddleName" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Code" Type="nvarchar" MaxLength="5" Nullable="false" />
         </EntityType>
+        <EntityType Name="EmployeeInStore">
+          <Key>
+            <PropertyRef Name="IDEmployeeInStore" />
+          </Key>
+          <Property Name="IDStore" Type="int" Nullable="false" />
+          <Property Name="IDEmployee" Type="int" Nullable="false" />
+          <Property Name="IDEmployeeInStore" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+        </EntityType>
         <EntityType Name="Order">
           <Key>
             <PropertyRef Name="OrderID" />
@@ -30,7 +38,6 @@
           <Property Name="Date" Type="date" Nullable="false" />
           <Property Name="IDWorkShift" Type="int" Nullable="false" />
           <Property Name="State" Type="bit" Nullable="false" />
-          <Property Name="IDPaymentMetod" Type="int" />
         </EntityType>
         <EntityType Name="PaymentMetod">
           <Key>
@@ -39,6 +46,14 @@
           <Property Name="PaymentMetodID" Type="int" Nullable="false" />
           <Property Name="PaymentMetodName" Type="nvarchar" MaxLength="50" Nullable="false" />
         </EntityType>
+        <EntityType Name="PaymentOrder">
+          <Key>
+            <PropertyRef Name="PaymentID" />
+          </Key>
+          <Property Name="PaymentID" Type="int" Nullable="false" />
+          <Property Name="IDPaymentMetod" Type="int" Nullable="false" />
+          <Property Name="IDOrder" Type="int" Nullable="false" />
+        </EntityType>
         <EntityType Name="Product">
           <Key>
             <PropertyRef Name="ProductID" />
@@ -59,6 +74,15 @@
           <Property Name="IDProduct" Type="int" Nullable="false" />
           <Property Name="AmountProduct" Type="int" Nullable="false" />
         </EntityType>
+        <EntityType Name="ProductInStore">
+          <Key>
+            <PropertyRef Name="ProductInStoreID" />
+          </Key>
+          <Property Name="ProductInStoreID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="IDStore" Type="int" Nullable="false" />
+          <Property Name="IDProduct" Type="int" Nullable="false" />
+          <Property Name="RemainsProduct" Type="int" Nullable="false" />
+        </EntityType>
         <EntityType Name="Store">
           <Key>
             <PropertyRef Name="StoreID" />
@@ -88,15 +112,27 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_Order_PaymentMetod">
-          <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="0..1" />
-          <End Role="Order" Type="Self.Order" Multiplicity="*" />
+        <Association Name="FK_EmployeeInStore_Employee">
+          <End Role="Employee" Type="Self.Employee" Multiplicity="1" />
+          <End Role="EmployeeInStore" Type="Self.EmployeeInStore" Multiplicity="*" />
           <ReferentialConstraint>
-            <Principal Role="PaymentMetod">
-              <PropertyRef Name="PaymentMetodID" />
+            <Principal Role="Employee">
+              <PropertyRef Name="EmployeeID" />
             </Principal>
-            <Dependent Role="Order">
-              <PropertyRef Name="IDPaymentMetod" />
+            <Dependent Role="EmployeeInStore">
+              <PropertyRef Name="IDEmployee" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_EmployeeInStore_Store">
+          <End Role="Store" Type="Self.Store" Multiplicity="1" />
+          <End Role="EmployeeInStore" Type="Self.EmployeeInStore" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Store">
+              <PropertyRef Name="StoreID" />
+            </Principal>
+            <Dependent Role="EmployeeInStore">
+              <PropertyRef Name="IDStore" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
@@ -112,6 +148,30 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_PaymentOrder_Order">
+          <End Role="Order" Type="Self.Order" Multiplicity="1" />
+          <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Order">
+              <PropertyRef Name="OrderID" />
+            </Principal>
+            <Dependent Role="PaymentOrder">
+              <PropertyRef Name="IDOrder" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_PaymentOrder_PaymentMetod">
+          <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="1" />
+          <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="PaymentMetod">
+              <PropertyRef Name="PaymentMetodID" />
+            </Principal>
+            <Dependent Role="PaymentOrder">
+              <PropertyRef Name="IDPaymentMetod" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_ProductInOrder_Order">
           <End Role="Order" Type="Self.Order" Multiplicity="1" />
           <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
@@ -124,18 +184,42 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_ProductInOrder_Product">
-          <End Role="Product" Type="Self.Product" Multiplicity="1" />
+        <Association Name="FK_ProductInOrder_ProductInStore">
+          <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="1" />
           <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
           <ReferentialConstraint>
+            <Principal Role="ProductInStore">
+              <PropertyRef Name="ProductInStoreID" />
+            </Principal>
+            <Dependent Role="ProductInOrder">
+              <PropertyRef Name="IDProduct" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_ProductInStore_Product">
+          <End Role="Product" Type="Self.Product" Multiplicity="1" />
+          <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
+          <ReferentialConstraint>
             <Principal Role="Product">
               <PropertyRef Name="ProductID" />
             </Principal>
-            <Dependent Role="ProductInOrder">
+            <Dependent Role="ProductInStore">
               <PropertyRef Name="IDProduct" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_ProductInStore_Store">
+          <End Role="Store" Type="Self.Store" Multiplicity="1" />
+          <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Store">
+              <PropertyRef Name="StoreID" />
+            </Principal>
+            <Dependent Role="ProductInStore">
+              <PropertyRef Name="IDStore" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_WorkShift_Cashier">
           <End Role="Cashier" Type="Self.Cashier" Multiplicity="1" />
           <End Role="WorkShift" Type="Self.WorkShift" Multiplicity="*" />
@@ -148,12 +232,12 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_WorkShift_Employee">
-          <End Role="Employee" Type="Self.Employee" Multiplicity="1" />
+        <Association Name="FK_WorkShift_EmployeeInStore">
+          <End Role="EmployeeInStore" Type="Self.EmployeeInStore" Multiplicity="1" />
           <End Role="WorkShift" Type="Self.WorkShift" Multiplicity="*" />
           <ReferentialConstraint>
-            <Principal Role="Employee">
-              <PropertyRef Name="EmployeeID" />
+            <Principal Role="EmployeeInStore">
+              <PropertyRef Name="IDEmployeeInStore" />
             </Principal>
             <Dependent Role="WorkShift">
               <PropertyRef Name="IDEmployee" />
@@ -163,38 +247,61 @@
         <EntityContainer Name="gr672_pgvModelStoreContainer">
           <EntitySet Name="Cashier" EntityType="Self.Cashier" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Employee" EntityType="Self.Employee" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="EmployeeInStore" EntityType="Self.EmployeeInStore" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Order" EntityType="Self.Order" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="PaymentMetod" EntityType="Self.PaymentMetod" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="PaymentOrder" EntityType="Self.PaymentOrder" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Product" EntityType="Self.Product" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="ProductInOrder" EntityType="Self.ProductInOrder" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="ProductInStore" EntityType="Self.ProductInStore" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Store" EntityType="Self.Store" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="WorkShift" EntityType="Self.WorkShift" Schema="dbo" store:Type="Tables" />
           <AssociationSet Name="FK_Cashier_Store" Association="Self.FK_Cashier_Store">
             <End Role="Store" EntitySet="Store" />
             <End Role="Cashier" EntitySet="Cashier" />
           </AssociationSet>
-          <AssociationSet Name="FK_Order_PaymentMetod" Association="Self.FK_Order_PaymentMetod">
-            <End Role="PaymentMetod" EntitySet="PaymentMetod" />
-            <End Role="Order" EntitySet="Order" />
+          <AssociationSet Name="FK_EmployeeInStore_Employee" Association="Self.FK_EmployeeInStore_Employee">
+            <End Role="Employee" EntitySet="Employee" />
+            <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
+          </AssociationSet>
+          <AssociationSet Name="FK_EmployeeInStore_Store" Association="Self.FK_EmployeeInStore_Store">
+            <End Role="Store" EntitySet="Store" />
+            <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
           </AssociationSet>
           <AssociationSet Name="FK_Order_WorkShift" Association="Self.FK_Order_WorkShift">
             <End Role="WorkShift" EntitySet="WorkShift" />
             <End Role="Order" EntitySet="Order" />
           </AssociationSet>
+          <AssociationSet Name="FK_PaymentOrder_Order" Association="Self.FK_PaymentOrder_Order">
+            <End Role="Order" EntitySet="Order" />
+            <End Role="PaymentOrder" EntitySet="PaymentOrder" />
+          </AssociationSet>
+          <AssociationSet Name="FK_PaymentOrder_PaymentMetod" Association="Self.FK_PaymentOrder_PaymentMetod">
+            <End Role="PaymentMetod" EntitySet="PaymentMetod" />
+            <End Role="PaymentOrder" EntitySet="PaymentOrder" />
+          </AssociationSet>
           <AssociationSet Name="FK_ProductInOrder_Order" Association="Self.FK_ProductInOrder_Order">
             <End Role="Order" EntitySet="Order" />
             <End Role="ProductInOrder" EntitySet="ProductInOrder" />
           </AssociationSet>
-          <AssociationSet Name="FK_ProductInOrder_Product" Association="Self.FK_ProductInOrder_Product">
-            <End Role="Product" EntitySet="Product" />
+          <AssociationSet Name="FK_ProductInOrder_ProductInStore" Association="Self.FK_ProductInOrder_ProductInStore">
+            <End Role="ProductInStore" EntitySet="ProductInStore" />
             <End Role="ProductInOrder" EntitySet="ProductInOrder" />
           </AssociationSet>
+          <AssociationSet Name="FK_ProductInStore_Product" Association="Self.FK_ProductInStore_Product">
+            <End Role="Product" EntitySet="Product" />
+            <End Role="ProductInStore" EntitySet="ProductInStore" />
+          </AssociationSet>
+          <AssociationSet Name="FK_ProductInStore_Store" Association="Self.FK_ProductInStore_Store">
+            <End Role="Store" EntitySet="Store" />
+            <End Role="ProductInStore" EntitySet="ProductInStore" />
+          </AssociationSet>
           <AssociationSet Name="FK_WorkShift_Cashier" Association="Self.FK_WorkShift_Cashier">
             <End Role="Cashier" EntitySet="Cashier" />
             <End Role="WorkShift" EntitySet="WorkShift" />
           </AssociationSet>
-          <AssociationSet Name="FK_WorkShift_Employee" Association="Self.FK_WorkShift_Employee">
-            <End Role="Employee" EntitySet="Employee" />
+          <AssociationSet Name="FK_WorkShift_EmployeeInStore" Association="Self.FK_WorkShift_EmployeeInStore">
+            <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
             <End Role="WorkShift" EntitySet="WorkShift" />
           </AssociationSet>
         </EntityContainer>
@@ -202,54 +309,16 @@
     <!-- CSDL content -->
     <edmx:ConceptualModels>
       <Schema Namespace="gr672_pgvModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
-        <EntityContainer Name="gr672_pgvEntities" annotation:LazyLoadingEnabled="true">
-          <EntitySet Name="Employees" EntityType="gr672_pgvModel.Employee" />
-          <EntitySet Name="Orders" EntityType="gr672_pgvModel.Order" />
-          <EntitySet Name="PaymentMetods" EntityType="gr672_pgvModel.PaymentMetod" />
-          <EntitySet Name="Products" EntityType="gr672_pgvModel.Product" />
-          <EntitySet Name="ProductInOrders" EntityType="gr672_pgvModel.ProductInOrder" />
-          <EntitySet Name="Stores" EntityType="gr672_pgvModel.Store" />
-          <EntitySet Name="WorkShifts" EntityType="gr672_pgvModel.WorkShift" />
-          <AssociationSet Name="FK_WorkShift_Employee" Association="gr672_pgvModel.FK_WorkShift_Employee">
-            <End Role="Employee" EntitySet="Employees" />
-            <End Role="WorkShift" EntitySet="WorkShifts" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Order_PaymentMetod" Association="gr672_pgvModel.FK_Order_PaymentMetod">
-            <End Role="PaymentMetod" EntitySet="PaymentMetods" />
-            <End Role="Order" EntitySet="Orders" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Order_WorkShift" Association="gr672_pgvModel.FK_Order_WorkShift">
-            <End Role="WorkShift" EntitySet="WorkShifts" />
-            <End Role="Order" EntitySet="Orders" />
-          </AssociationSet>
-          <AssociationSet Name="FK_ProductInOrder_Order" Association="gr672_pgvModel.FK_ProductInOrder_Order">
-            <End Role="Order" EntitySet="Orders" />
-            <End Role="ProductInOrder" EntitySet="ProductInOrders" />
-          </AssociationSet>
-          <AssociationSet Name="FK_ProductInOrder_Product" Association="gr672_pgvModel.FK_ProductInOrder_Product">
-            <End Role="Product" EntitySet="Products" />
-            <End Role="ProductInOrder" EntitySet="ProductInOrders" />
-          </AssociationSet>
-          <EntitySet Name="Cashiers" EntityType="gr672_pgvModel.Cashier" />
-          <AssociationSet Name="FK_Cashier_Store" Association="gr672_pgvModel.FK_Cashier_Store">
-            <End Role="Store" EntitySet="Stores" />
-            <End Role="Cashier" EntitySet="Cashiers" />
-          </AssociationSet>
-          <AssociationSet Name="FK_WorkShift_Cashier" Association="gr672_pgvModel.FK_WorkShift_Cashier">
-            <End Role="Cashier" EntitySet="Cashiers" />
-            <End Role="WorkShift" EntitySet="WorkShifts" />
-          </AssociationSet>
-        </EntityContainer>
         <EntityType Name="Employee">
           <Key>
             <PropertyRef Name="EmployeeID" />
           </Key>
           <Property Name="EmployeeID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="LastName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="Name" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="MiddleName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="Code" Type="String" Nullable="false" MaxLength="5" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="WorkShifts" Relationship="gr672_pgvModel.FK_WorkShift_Employee" FromRole="Employee" ToRole="WorkShift" />
+          <Property Name="LastName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Code" Type="String" MaxLength="5" FixedLength="false" Unicode="true" Nullable="false" />
+          <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_EmployeeInStore_Employee" FromRole="Employee" ToRole="EmployeeInStore" />
         </EntityType>
         <EntityType Name="Order">
           <Key>
@@ -259,30 +328,39 @@
           <Property Name="Date" Type="DateTime" Nullable="false" Precision="0" />
           <Property Name="IDWorkShift" Type="Int32" Nullable="false" />
           <Property Name="State" Type="Boolean" Nullable="false" />
-          <Property Name="IDPaymentMetod" Type="Int32" />
-          <NavigationProperty Name="PaymentMetod" Relationship="gr672_pgvModel.FK_Order_PaymentMetod" FromRole="Order" ToRole="PaymentMetod" />
-          <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_Order_WorkShift" FromRole="Order" ToRole="WorkShift" />
-          <NavigationProperty Name="ProductInOrders" Relationship="gr672_pgvModel.FK_ProductInOrder_Order" FromRole="Order" ToRole="ProductInOrder" />
+          <NavigationProperty Name="WorkShift" Relationship="Self.FK_Order_WorkShift" FromRole="Order" ToRole="WorkShift" />
+          <NavigationProperty Name="PaymentOrder" Relationship="Self.FK_PaymentOrder_Order" FromRole="Order" ToRole="PaymentOrder" />
+          <NavigationProperty Name="ProductInOrder" Relationship="Self.FK_ProductInOrder_Order" FromRole="Order" ToRole="ProductInOrder" />
         </EntityType>
         <EntityType Name="PaymentMetod">
           <Key>
             <PropertyRef Name="PaymentMetodID" />
           </Key>
           <Property Name="PaymentMetodID" Type="Int32" Nullable="false" />
-          <Property Name="PaymentMetodName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="Orders" Relationship="gr672_pgvModel.FK_Order_PaymentMetod" FromRole="PaymentMetod" ToRole="Order" />
+          <Property Name="PaymentMetodName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <NavigationProperty Name="PaymentOrder" Relationship="Self.FK_PaymentOrder_PaymentMetod" FromRole="PaymentMetod" ToRole="PaymentOrder" />
+        </EntityType>
+        <EntityType Name="PaymentOrder">
+          <Key>
+            <PropertyRef Name="PaymentID" />
+          </Key>
+          <Property Name="PaymentID" Type="Int32" Nullable="false" />
+          <Property Name="IDPaymentMetod" Type="Int32" Nullable="false" />
+          <Property Name="IDOrder" Type="Int32" Nullable="false" />
+          <NavigationProperty Name="Order" Relationship="Self.FK_PaymentOrder_Order" FromRole="PaymentOrder" ToRole="Order" />
+          <NavigationProperty Name="PaymentMetod" Relationship="Self.FK_PaymentOrder_PaymentMetod" FromRole="PaymentOrder" ToRole="PaymentMetod" />
         </EntityType>
         <EntityType Name="Product">
           <Key>
             <PropertyRef Name="ProductID" />
           </Key>
           <Property Name="ProductID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="NameProduct" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
+          <Property Name="NameProduct" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
           <Property Name="Weight" Type="Int32" Nullable="false" />
           <Property Name="Packaging" Type="Int32" Nullable="false" />
-          <Property Name="PriceOfOne" Type="Decimal" Nullable="false" Precision="19" Scale="4" />
-          <Property Name="BarCode" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="ProductInOrders" Relationship="gr672_pgvModel.FK_ProductInOrder_Product" FromRole="Product" ToRole="ProductInOrder" />
+          <Property Name="PriceOfOne" Type="Decimal" Precision="19" Scale="4" Nullable="false" />
+          <Property Name="BarCode" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
+          <NavigationProperty Name="ProductInStore" Relationship="Self.FK_ProductInStore_Product" FromRole="Product" ToRole="ProductInStore" />
         </EntityType>
         <EntityType Name="ProductInOrder">
           <Key>
@@ -292,16 +370,30 @@
           <Property Name="IDOrder" Type="Int32" Nullable="false" />
           <Property Name="IDProduct" Type="Int32" Nullable="false" />
           <Property Name="AmountProduct" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="Order" Relationship="gr672_pgvModel.FK_ProductInOrder_Order" FromRole="ProductInOrder" ToRole="Order" />
-          <NavigationProperty Name="Product" Relationship="gr672_pgvModel.FK_ProductInOrder_Product" FromRole="ProductInOrder" ToRole="Product" />
+          <NavigationProperty Name="Order" Relationship="Self.FK_ProductInOrder_Order" FromRole="ProductInOrder" ToRole="Order" />
+          <NavigationProperty Name="ProductInStore" Relationship="Self.FK_ProductInOrder_ProductInStore" FromRole="ProductInOrder" ToRole="ProductInStore" />
+        </EntityType>
+        <EntityType Name="ProductInStore">
+          <Key>
+            <PropertyRef Name="ProductInStoreID" />
+          </Key>
+          <Property Name="ProductInStoreID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="IDStore" Type="Int32" Nullable="false" />
+          <Property Name="IDProduct" Type="Int32" Nullable="false" />
+          <Property Name="RemainsProduct" Type="Int32" Nullable="false" />
+          <NavigationProperty Name="Product" Relationship="Self.FK_ProductInStore_Product" FromRole="ProductInStore" ToRole="Product" />
+          <NavigationProperty Name="ProductInOrder" Relationship="Self.FK_ProductInOrder_ProductInStore" FromRole="ProductInStore" ToRole="ProductInOrder" />
+          <NavigationProperty Name="Store" Relationship="Self.FK_ProductInStore_Store" FromRole="ProductInStore" ToRole="Store" />
         </EntityType>
         <EntityType Name="Store">
           <Key>
             <PropertyRef Name="StoreID" />
           </Key>
           <Property Name="StoreID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="Address" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="Cashiers" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Store" ToRole="Cashier" />
+          <Property Name="Address" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" Nullable="false" />
+          <NavigationProperty Name="ProductInStore" Relationship="Self.FK_ProductInStore_Store" FromRole="Store" ToRole="ProductInStore" />
+          <NavigationProperty Name="Cashier" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Store" ToRole="Cashier" />
+          <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_EmployeeInStore_Store" FromRole="Store" ToRole="EmployeeInStore" />
         </EntityType>
         <EntityType Name="WorkShift">
           <Key>
@@ -312,49 +404,37 @@
           <Property Name="IDEmployee" Type="Int32" Nullable="false" />
           <Property Name="StartDateAndTimeWork" Type="DateTime" Nullable="false" Precision="3" />
           <Property Name="EndDateAndTimeWork" Type="DateTime" Precision="3" />
-          <NavigationProperty Name="Employee" Relationship="gr672_pgvModel.FK_WorkShift_Employee" FromRole="WorkShift" ToRole="Employee" />
-          <NavigationProperty Name="Orders" Relationship="gr672_pgvModel.FK_Order_WorkShift" FromRole="WorkShift" ToRole="Order" />
+          <NavigationProperty Name="Order" Relationship="Self.FK_Order_WorkShift" FromRole="WorkShift" ToRole="Order" />
           <NavigationProperty Name="Cashier" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="WorkShift" ToRole="Cashier" />
+          <NavigationProperty Name="EmployeeInStore" Relationship="gr672_pgvModel.FK_WorkShift_EmployeeInStore" FromRole="WorkShift" ToRole="EmployeeInStore" />
         </EntityType>
-        <Association Name="FK_WorkShift_Employee">
-          <End Type="gr672_pgvModel.Employee" Role="Employee" Multiplicity="1" />
-          <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="Employee">
-              <PropertyRef Name="EmployeeID" />
-            </Principal>
-            <Dependent Role="WorkShift">
-              <PropertyRef Name="IDEmployee" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
-        <Association Name="FK_Order_PaymentMetod">
-          <End Type="gr672_pgvModel.PaymentMetod" Role="PaymentMetod" Multiplicity="0..1" />
-          <End Type="gr672_pgvModel.Order" Role="Order" Multiplicity="*" />
+        <Association Name="FK_Order_WorkShift">
+          <End Role="WorkShift" Type="Self.WorkShift" Multiplicity="1" />
+          <End Role="Order" Type="Self.Order" Multiplicity="*" />
           <ReferentialConstraint>
-            <Principal Role="PaymentMetod">
-              <PropertyRef Name="PaymentMetodID" />
+            <Principal Role="WorkShift">
+              <PropertyRef Name="WorkShiftID" />
             </Principal>
             <Dependent Role="Order">
-              <PropertyRef Name="IDPaymentMetod" />
+              <PropertyRef Name="IDWorkShift" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_Order_WorkShift">
-          <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="1" />
-          <End Type="gr672_pgvModel.Order" Role="Order" Multiplicity="*" />
+        <Association Name="FK_PaymentOrder_Order">
+          <End Role="Order" Type="Self.Order" Multiplicity="1" />
+          <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
           <ReferentialConstraint>
-            <Principal Role="WorkShift">
-              <PropertyRef Name="WorkShiftID" />
+            <Principal Role="Order">
+              <PropertyRef Name="OrderID" />
             </Principal>
-            <Dependent Role="Order">
-              <PropertyRef Name="IDWorkShift" />
+            <Dependent Role="PaymentOrder">
+              <PropertyRef Name="IDOrder" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_ProductInOrder_Order">
-          <End Type="gr672_pgvModel.Order" Role="Order" Multiplicity="1" />
-          <End Type="gr672_pgvModel.ProductInOrder" Role="ProductInOrder" Multiplicity="*" />
+          <End Role="Order" Type="Self.Order" Multiplicity="1" />
+          <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Order">
               <PropertyRef Name="OrderID" />
@@ -364,18 +444,115 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_ProductInOrder_Product">
-          <End Type="gr672_pgvModel.Product" Role="Product" Multiplicity="1" />
-          <End Type="gr672_pgvModel.ProductInOrder" Role="ProductInOrder" Multiplicity="*" />
+        <Association Name="FK_PaymentOrder_PaymentMetod">
+          <End Role="PaymentMetod" Type="Self.PaymentMetod" Multiplicity="1" />
+          <End Role="PaymentOrder" Type="Self.PaymentOrder" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="PaymentMetod">
+              <PropertyRef Name="PaymentMetodID" />
+            </Principal>
+            <Dependent Role="PaymentOrder">
+              <PropertyRef Name="IDPaymentMetod" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_ProductInStore_Product">
+          <End Role="Product" Type="Self.Product" Multiplicity="1" />
+          <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Product">
               <PropertyRef Name="ProductID" />
             </Principal>
+            <Dependent Role="ProductInStore">
+              <PropertyRef Name="IDProduct" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_ProductInOrder_ProductInStore">
+          <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="1" />
+          <End Role="ProductInOrder" Type="Self.ProductInOrder" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="ProductInStore">
+              <PropertyRef Name="ProductInStoreID" />
+            </Principal>
             <Dependent Role="ProductInOrder">
               <PropertyRef Name="IDProduct" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_ProductInStore_Store">
+          <End Role="Store" Type="Self.Store" Multiplicity="1" />
+          <End Role="ProductInStore" Type="Self.ProductInStore" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Store">
+              <PropertyRef Name="StoreID" />
+            </Principal>
+            <Dependent Role="ProductInStore">
+              <PropertyRef Name="IDStore" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <EntityContainer Name="gr672_pgvEntities" annotation:LazyLoadingEnabled="true">
+          <EntitySet Name="Employee" EntityType="Self.Employee" />
+          <EntitySet Name="Order" EntityType="Self.Order" />
+          <EntitySet Name="PaymentMetod" EntityType="Self.PaymentMetod" />
+          <EntitySet Name="PaymentOrder" EntityType="Self.PaymentOrder" />
+          <EntitySet Name="Product" EntityType="Self.Product" />
+          <EntitySet Name="ProductInOrder" EntityType="Self.ProductInOrder" />
+          <EntitySet Name="ProductInStore" EntityType="Self.ProductInStore" />
+          <EntitySet Name="Store" EntityType="Self.Store" />
+          <EntitySet Name="WorkShift" EntityType="Self.WorkShift" />
+          <AssociationSet Name="FK_Order_WorkShift" Association="Self.FK_Order_WorkShift">
+            <End Role="WorkShift" EntitySet="WorkShift" />
+            <End Role="Order" EntitySet="Order" />
+          </AssociationSet>
+          <AssociationSet Name="FK_PaymentOrder_Order" Association="Self.FK_PaymentOrder_Order">
+            <End Role="Order" EntitySet="Order" />
+            <End Role="PaymentOrder" EntitySet="PaymentOrder" />
+          </AssociationSet>
+          <AssociationSet Name="FK_ProductInOrder_Order" Association="Self.FK_ProductInOrder_Order">
+            <End Role="Order" EntitySet="Order" />
+            <End Role="ProductInOrder" EntitySet="ProductInOrder" />
+          </AssociationSet>
+          <AssociationSet Name="FK_PaymentOrder_PaymentMetod" Association="Self.FK_PaymentOrder_PaymentMetod">
+            <End Role="PaymentMetod" EntitySet="PaymentMetod" />
+            <End Role="PaymentOrder" EntitySet="PaymentOrder" />
+          </AssociationSet>
+          <AssociationSet Name="FK_ProductInStore_Product" Association="Self.FK_ProductInStore_Product">
+            <End Role="Product" EntitySet="Product" />
+            <End Role="ProductInStore" EntitySet="ProductInStore" />
+          </AssociationSet>
+          <AssociationSet Name="FK_ProductInOrder_ProductInStore" Association="Self.FK_ProductInOrder_ProductInStore">
+            <End Role="ProductInStore" EntitySet="ProductInStore" />
+            <End Role="ProductInOrder" EntitySet="ProductInOrder" />
+          </AssociationSet>
+          <AssociationSet Name="FK_ProductInStore_Store" Association="Self.FK_ProductInStore_Store">
+            <End Role="Store" EntitySet="Store" />
+            <End Role="ProductInStore" EntitySet="ProductInStore" />
+          </AssociationSet>
+          <EntitySet Name="Cashier" EntityType="gr672_pgvModel.Cashier" />
+          <AssociationSet Name="FK_Cashier_Store" Association="gr672_pgvModel.FK_Cashier_Store">
+            <End Role="Store" EntitySet="Store" />
+            <End Role="Cashier" EntitySet="Cashier" />
+          </AssociationSet>
+          <AssociationSet Name="FK_WorkShift_Cashier" Association="gr672_pgvModel.FK_WorkShift_Cashier">
+            <End Role="Cashier" EntitySet="Cashier" />
+            <End Role="WorkShift" EntitySet="WorkShift" />
+          </AssociationSet>
+          <EntitySet Name="EmployeeInStore" EntityType="gr672_pgvModel.EmployeeInStore" />
+          <AssociationSet Name="FK_EmployeeInStore_Employee" Association="gr672_pgvModel.FK_EmployeeInStore_Employee">
+            <End Role="Employee" EntitySet="Employee" />
+            <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
+          </AssociationSet>
+          <AssociationSet Name="FK_EmployeeInStore_Store" Association="gr672_pgvModel.FK_EmployeeInStore_Store">
+            <End Role="Store" EntitySet="Store" />
+            <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
+          </AssociationSet>
+          <AssociationSet Name="FK_WorkShift_EmployeeInStore" Association="gr672_pgvModel.FK_WorkShift_EmployeeInStore">
+            <End Role="EmployeeInStore" EntitySet="EmployeeInStore" />
+            <End Role="WorkShift" EntitySet="WorkShift" />
+          </AssociationSet>
+        </EntityContainer>
         <EntityType Name="Cashier">
           <Key>
             <PropertyRef Name="CashierID" />
@@ -383,7 +560,7 @@
           <Property Name="CashierID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="IDStore" Type="Int32" Nullable="false" />
           <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_Cashier_Store" FromRole="Cashier" ToRole="Store" />
-          <NavigationProperty Name="WorkShifts" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="Cashier" ToRole="WorkShift" />
+          <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_WorkShift_Cashier" FromRole="Cashier" ToRole="WorkShift" />
         </EntityType>
         <Association Name="FK_Cashier_Store">
           <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
@@ -409,83 +586,148 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityType Name="EmployeeInStore">
+          <Key>
+            <PropertyRef Name="IDEmployeeInStore" />
+          </Key>
+          <Property Name="IDStore" Type="Int32" Nullable="false" />
+          <Property Name="IDEmployee" Type="Int32" Nullable="false" />
+          <Property Name="IDEmployeeInStore" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <NavigationProperty Name="Employee" Relationship="gr672_pgvModel.FK_EmployeeInStore_Employee" FromRole="EmployeeInStore" ToRole="Employee" />
+          <NavigationProperty Name="Store" Relationship="gr672_pgvModel.FK_EmployeeInStore_Store" FromRole="EmployeeInStore" ToRole="Store" />
+          <NavigationProperty Name="WorkShift" Relationship="gr672_pgvModel.FK_WorkShift_EmployeeInStore" FromRole="EmployeeInStore" ToRole="WorkShift" />
+        </EntityType>
+        <Association Name="FK_EmployeeInStore_Employee">
+          <End Type="gr672_pgvModel.Employee" Role="Employee" Multiplicity="1" />
+          <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Employee">
+              <PropertyRef Name="EmployeeID" />
+            </Principal>
+            <Dependent Role="EmployeeInStore">
+              <PropertyRef Name="IDEmployee" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_EmployeeInStore_Store">
+          <End Type="gr672_pgvModel.Store" Role="Store" Multiplicity="1" />
+          <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Store">
+              <PropertyRef Name="StoreID" />
+            </Principal>
+            <Dependent Role="EmployeeInStore">
+              <PropertyRef Name="IDStore" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_WorkShift_EmployeeInStore">
+          <End Type="gr672_pgvModel.EmployeeInStore" Role="EmployeeInStore" Multiplicity="1" />
+          <End Type="gr672_pgvModel.WorkShift" Role="WorkShift" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="EmployeeInStore">
+              <PropertyRef Name="IDEmployeeInStore" />
+            </Principal>
+            <Dependent Role="WorkShift">
+              <PropertyRef Name="IDEmployee" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
       </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
     <edmx:Mappings>
       <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
         <EntityContainerMapping StorageEntityContainer="gr672_pgvModelStoreContainer" CdmEntityContainer="gr672_pgvEntities">
-          <EntitySetMapping Name="Employees">
+          <EntitySetMapping Name="Employee">
             <EntityTypeMapping TypeName="gr672_pgvModel.Employee">
               <MappingFragment StoreEntitySet="Employee">
-                <ScalarProperty Name="Code" ColumnName="Code" />
-                <ScalarProperty Name="MiddleName" ColumnName="MiddleName" />
-                <ScalarProperty Name="Name" ColumnName="Name" />
-                <ScalarProperty Name="LastName" ColumnName="LastName" />
                 <ScalarProperty Name="EmployeeID" ColumnName="EmployeeID" />
+                <ScalarProperty Name="LastName" ColumnName="LastName" />
+                <ScalarProperty Name="Name" ColumnName="Name" />
+                <ScalarProperty Name="MiddleName" ColumnName="MiddleName" />
+                <ScalarProperty Name="Code" ColumnName="Code" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Orders">
+          <EntitySetMapping Name="Order">
             <EntityTypeMapping TypeName="gr672_pgvModel.Order">
               <MappingFragment StoreEntitySet="Order">
-                <ScalarProperty Name="IDPaymentMetod" ColumnName="IDPaymentMetod" />
-                <ScalarProperty Name="State" ColumnName="State" />
-                <ScalarProperty Name="IDWorkShift" ColumnName="IDWorkShift" />
-                <ScalarProperty Name="Date" ColumnName="Date" />
                 <ScalarProperty Name="OrderID" ColumnName="OrderID" />
+                <ScalarProperty Name="Date" ColumnName="Date" />
+                <ScalarProperty Name="IDWorkShift" ColumnName="IDWorkShift" />
+                <ScalarProperty Name="State" ColumnName="State" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="PaymentMetods">
+          <EntitySetMapping Name="PaymentMetod">
             <EntityTypeMapping TypeName="gr672_pgvModel.PaymentMetod">
               <MappingFragment StoreEntitySet="PaymentMetod">
-                <ScalarProperty Name="PaymentMetodName" ColumnName="PaymentMetodName" />
                 <ScalarProperty Name="PaymentMetodID" ColumnName="PaymentMetodID" />
+                <ScalarProperty Name="PaymentMetodName" ColumnName="PaymentMetodName" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="PaymentOrder">
+            <EntityTypeMapping TypeName="gr672_pgvModel.PaymentOrder">
+              <MappingFragment StoreEntitySet="PaymentOrder">
+                <ScalarProperty Name="PaymentID" ColumnName="PaymentID" />
+                <ScalarProperty Name="IDPaymentMetod" ColumnName="IDPaymentMetod" />
+                <ScalarProperty Name="IDOrder" ColumnName="IDOrder" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Products">
+          <EntitySetMapping Name="Product">
             <EntityTypeMapping TypeName="gr672_pgvModel.Product">
               <MappingFragment StoreEntitySet="Product">
-                <ScalarProperty Name="BarCode" ColumnName="BarCode" />
-                <ScalarProperty Name="PriceOfOne" ColumnName="PriceOfOne" />
-                <ScalarProperty Name="Packaging" ColumnName="Packaging" />
-                <ScalarProperty Name="Weight" ColumnName="Weight" />
-                <ScalarProperty Name="NameProduct" ColumnName="NameProduct" />
                 <ScalarProperty Name="ProductID" ColumnName="ProductID" />
+                <ScalarProperty Name="NameProduct" ColumnName="NameProduct" />
+                <ScalarProperty Name="Weight" ColumnName="Weight" />
+                <ScalarProperty Name="Packaging" ColumnName="Packaging" />
+                <ScalarProperty Name="PriceOfOne" ColumnName="PriceOfOne" />
+                <ScalarProperty Name="BarCode" ColumnName="BarCode" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="ProductInOrders">
+          <EntitySetMapping Name="ProductInOrder">
             <EntityTypeMapping TypeName="gr672_pgvModel.ProductInOrder">
               <MappingFragment StoreEntitySet="ProductInOrder">
+                <ScalarProperty Name="IDOrder" ColumnName="IDOrder" />
+                <ScalarProperty Name="IDProduct" ColumnName="IDProduct" />
                 <ScalarProperty Name="AmountProduct" ColumnName="AmountProduct" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="ProductInStore">
+            <EntityTypeMapping TypeName="gr672_pgvModel.ProductInStore">
+              <MappingFragment StoreEntitySet="ProductInStore">
+                <ScalarProperty Name="ProductInStoreID" ColumnName="ProductInStoreID" />
+                <ScalarProperty Name="IDStore" ColumnName="IDStore" />
                 <ScalarProperty Name="IDProduct" ColumnName="IDProduct" />
-                <ScalarProperty Name="IDOrder" ColumnName="IDOrder" />
+                <ScalarProperty Name="RemainsProduct" ColumnName="RemainsProduct" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Stores">
+          <EntitySetMapping Name="Store">
             <EntityTypeMapping TypeName="gr672_pgvModel.Store">
               <MappingFragment StoreEntitySet="Store">
-                <ScalarProperty Name="Address" ColumnName="Address" />
                 <ScalarProperty Name="StoreID" ColumnName="StoreID" />
+                <ScalarProperty Name="Address" ColumnName="Address" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="WorkShifts">
+          <EntitySetMapping Name="WorkShift">
             <EntityTypeMapping TypeName="gr672_pgvModel.WorkShift">
               <MappingFragment StoreEntitySet="WorkShift">
-                <ScalarProperty Name="EndDateAndTimeWork" ColumnName="EndDateAndTimeWork" />
-                <ScalarProperty Name="StartDateAndTimeWork" ColumnName="StartDateAndTimeWork" />
-                <ScalarProperty Name="IDEmployee" ColumnName="IDEmployee" />
-                <ScalarProperty Name="IDCashier" ColumnName="IDCashier" />
                 <ScalarProperty Name="WorkShiftID" ColumnName="WorkShiftID" />
+                <ScalarProperty Name="IDCashier" ColumnName="IDCashier" />
+                <ScalarProperty Name="IDEmployee" ColumnName="IDEmployee" />
+                <ScalarProperty Name="StartDateAndTimeWork" ColumnName="StartDateAndTimeWork" />
+                <ScalarProperty Name="EndDateAndTimeWork" ColumnName="EndDateAndTimeWork" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Cashiers">
+          <EntitySetMapping Name="Cashier">
             <EntityTypeMapping TypeName="gr672_pgvModel.Cashier">
               <MappingFragment StoreEntitySet="Cashier">
                 <ScalarProperty Name="IDStore" ColumnName="IDStore" />
@@ -493,6 +735,15 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="EmployeeInStore">
+            <EntityTypeMapping TypeName="gr672_pgvModel.EmployeeInStore">
+              <MappingFragment StoreEntitySet="EmployeeInStore">
+                <ScalarProperty Name="IDEmployeeInStore" ColumnName="IDEmployeeInStore" />
+                <ScalarProperty Name="IDEmployee" ColumnName="IDEmployee" />
+                <ScalarProperty Name="IDStore" ColumnName="IDStore" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
         </EntityContainerMapping>
       </Mapping>
     </edmx:Mappings>
@@ -507,7 +758,7 @@
     <Options>
       <DesignerInfoPropertySet>
         <DesignerProperty Name="ValidateOnBuild" Value="true" />
-        <DesignerProperty Name="EnablePluralization" Value="true" />
+        <DesignerProperty Name="EnablePluralization" Value="false" />
         <DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
         <DesignerProperty Name="UseLegacyProvider" Value="false" />
         <DesignerProperty Name="CodeGenerationStrategy" Value="None" />

+ 34 - 0
StoreServer/ModelStore.edmx.diagram

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
+ <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
+  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
+    <!-- Diagram content (shape and connector positions) -->
+    <edmx:Diagrams>
+      <Diagram DiagramId="c8b1193c51794b04adc15fd133582a32" Name="Diagram1">
+        <EntityTypeShape EntityType="gr672_pgvModel.Employee" Width="1.5" PointX="0.75" PointY="7.125" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.Order" Width="1.5" PointX="7.5" PointY="4" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.PaymentMetod" Width="1.5" PointX="7.5" PointY="1.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.PaymentOrder" Width="1.5" PointX="9.75" PointY="4.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.Product" Width="1.5" PointX="0.75" PointY="1" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.ProductInOrder" Width="1.5" PointX="9.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.ProductInStore" Width="1.5" PointX="3" PointY="1" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.Store" Width="1.5" PointX="0.75" PointY="4.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_pgvModel.WorkShift" Width="1.5" PointX="5.25" PointY="4" IsExpanded="true" />
+        <AssociationConnector Association="gr672_pgvModel.FK_Order_WorkShift" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_pgvModel.FK_PaymentOrder_Order" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_pgvModel.FK_ProductInOrder_Order" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_pgvModel.FK_PaymentOrder_PaymentMetod" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_pgvModel.FK_ProductInStore_Product" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_pgvModel.FK_ProductInOrder_ProductInStore" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_pgvModel.FK_ProductInStore_Store" ManuallyRouted="false" />
+        <EntityTypeShape EntityType="gr672_pgvModel.Cashier" Width="1.5" PointX="3" PointY="7.5" />
+        <AssociationConnector Association="gr672_pgvModel.FK_Cashier_Store" />
+        <AssociationConnector Association="gr672_pgvModel.FK_WorkShift_Cashier" />
+        <EntityTypeShape EntityType="gr672_pgvModel.EmployeeInStore" Width="1.5" PointX="6" PointY="7.75" />
+        <AssociationConnector Association="gr672_pgvModel.FK_EmployeeInStore_Employee" />
+        <AssociationConnector Association="gr672_pgvModel.FK_EmployeeInStore_Store" />
+        <AssociationConnector Association="gr672_pgvModel.FK_WorkShift_EmployeeInStore" />
+      </Diagram>
+    </edmx:Diagrams>
+  </edmx:Designer>
+</edmx:Edmx>

+ 1 - 1
CentralServer/StoreModel.tt

@@ -2,7 +2,7 @@
 <#@ include file="EF6.Utility.CS.ttinclude"#><#@ 
  output extension=".cs"#><#
 
-const string inputFile = @"StoreModel.edmx";
+const string inputFile = @"ModelStore.edmx";
 var textTransform = DynamicTextTransformation.Create(this);
 var code = new CodeGenerationTools(this);
 var ef = new MetadataTools(this);

+ 6 - 3
StoreServer/MonitoringCashierPage.xaml

@@ -9,10 +9,13 @@
       Title="Состояние касс">
 
     <Grid>
-        <DataGrid x:Name="ListCashier">
+        <DataGrid x:Name="ListCashier" AutoGenerateColumns="False">
             <DataGrid.Columns>
-                <DataGridTextColumn Header="Номер кассы" Binding="{Binding CashierID}"></DataGridTextColumn>
-                <DataGridTextColumn Header="Статус" Binding="{Binding IsStart}"></DataGridTextColumn>
+                <DataGridTextColumn Header="Номер кассы" Binding="{Binding Cashier.CashierID}"></DataGridTextColumn>
+                <DataGridTextColumn Header="Статус" Binding="{Binding IsStartCashier}"></DataGridTextColumn>
+                <DataGridTextColumn Header="Кассир" Binding="{Binding EmployeeInStore.Employee.FullName}"></DataGridTextColumn>
+                <DataGridTextColumn Header="Состояние смены" Binding="{Binding IsStartCashier}"></DataGridTextColumn>
+                
             </DataGrid.Columns>
         </DataGrid>
     </Grid>

+ 71 - 7
StoreServer/MonitoringCashierPage.xaml.cs

@@ -23,25 +23,44 @@ namespace StoreServer
     /// </summary>
     public partial class MonitoringCashierPage : Page
     {
+        public List<WorkShift> WorkShiftOnCashier = new List<WorkShift>();                                     
         public MonitoringCashierPage()
         {
             InitializeComponent();
+            foreach (var item in Helper.FindStore.Cashier)
+            {
+                WorkShiftOnCashier.Add(new WorkShift
+                {
+                    StartDateAndTimeWork = null,
+                    EndDateAndTimeWork = null,
+                    Cashier = item,
+                    EmployeeInStore = null
+                });
+            }
+            ListCashier.ItemsSource = WorkShiftOnCashier;
+            StartSocketServer();
+            StartHttpServer();
         }
 
-        public void GetDataOfStartCashier(RootDataOfCashier FindCashier)
+        public void StartWorkCashier(int CashierID, EmployeeInStore AuthEmployee)
         {
-            
+            var CurrentWorkShift = WorkShiftOnCashier.FirstOrDefault(x => x.Cashier.CashierID == CashierID);
+            CurrentWorkShift.StartDateAndTimeWork = DateTime.Now;
+            CurrentWorkShift.EmployeeInStore = AuthEmployee;
+            ListCashier.ItemsSource = null;
+            ListCashier.ItemsSource = WorkShiftOnCashier;
         }
-        public async void StartServer()
-        {
 
-            IPEndPoint iPEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), Helper.FindStore.StoreID);
+        public async void StartSocketServer()
+        {
+            string IDStore = Helper.FindStore.StoreID.ToString();
+            IPEndPoint iPEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), Convert.ToInt32("102" + IDStore));
             Socket Listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
             Listener.Bind(iPEndPoint);
             Listener.Listen(10);
             while (true)
             {
-                Socket SocketClient = Listener.Accept();
+                Socket SocketClient = await Listener.AcceptAsync();
                 StringBuilder stringBuilder = new StringBuilder();
                 byte[] data = new byte[256];
                 int bytes = 0;
@@ -50,9 +69,54 @@ namespace StoreServer
                     bytes = SocketClient.Receive(data, data.Length,0);
                     stringBuilder = stringBuilder.Append(Encoding.UTF8.GetString(data, 0, bytes));
                 } while (SocketClient.Available >0);
+                string Message = stringBuilder.ToString();
+                if (Message.Contains("Code cashier="))
+                {
+                    int NumberCashier = Convert.ToInt32(Message.Split(';')[0].Split('=')[1]);
+                    var FindCashier = DB.db.Cashier.FirstOrDefault(x => x.IDStore == Helper.FindStore.StoreID && x.CashierID == NumberCashier);
+                    if (FindCashier == null)
+                    {
+                        byte[] buffer = Encoding.UTF8.GetBytes("Магазин не поддерживает кассу с таким номером");
+                        SocketClient.Send(buffer);
+                        SocketClient.Shutdown(SocketShutdown.Both);
+                        SocketClient.Close();
+                    }
+                    else
+                    {
+                        string CodeEmployee = Message.Split('=')[2];
+                        var FindEmployee = DB.db.EmployeeInStore.FirstOrDefault(x => x.Employee.Code == CodeEmployee && x.IDStore == Helper.FindStore.StoreID);
+                        if (FindEmployee == null)
+                        {
+                            byte[] buffer = Encoding.UTF8.GetBytes("Сотрудник не найден");
+                            SocketClient.Send(buffer);
+                            SocketClient.Shutdown(SocketShutdown.Both);
+                            SocketClient.Close();
+                        }
+                        else
+                        {
+
+                            StartWorkCashier(FindCashier.CashierID, FindEmployee);
+                            byte[] buffer = Encoding.UTF8.GetBytes("Добро пожаловать");
+                            SocketClient.Send(buffer);
+                            SocketClient.Shutdown(SocketShutdown.Both);
+                            SocketClient.Close();
+                        }
+                    }
 
-                RootDataOfCashier rootDataOfCashier = JsonConvert.DeserializeObject<RootDataOfCashier>(stringBuilder.ToString());
+                }
             }
         } 
+
+        public async void StartHttpServer()
+        {
+            HttpListener listener = new HttpListener();
+            listener.Prefixes.Add("http://127.0.0.2:" + Helper.FindStore.StoreID.ToString() + "/");
+            listener.Start();
+            while (true)
+            {
+                HttpListenerContext context = await listener.GetContextAsync();
+                HttpListenerRequest request = context.Request;
+            }
+        }
     }
 }

+ 6 - 5
CentralServer/Order.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -17,18 +17,19 @@ namespace CentralServer
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Order()
         {
-            this.ProductInOrders = new HashSet<ProductInOrder>();
+            this.PaymentOrder = new HashSet<PaymentOrder>();
+            this.ProductInOrder = new HashSet<ProductInOrder>();
         }
     
         public int OrderID { get; set; }
         public System.DateTime Date { get; set; }
         public int IDWorkShift { get; set; }
         public bool State { get; set; }
-        public Nullable<int> IDPaymentMetod { get; set; }
     
-        public virtual PaymentMetod PaymentMetod { get; set; }
         public virtual WorkShift WorkShift { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<ProductInOrder> ProductInOrders { get; set; }
+        public virtual ICollection<PaymentOrder> PaymentOrder { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<ProductInOrder> ProductInOrder { get; set; }
     }
 }

+ 3 - 3
CentralServer/PaymentMetod.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -17,13 +17,13 @@ namespace CentralServer
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public PaymentMetod()
         {
-            this.Orders = new HashSet<Order>();
+            this.PaymentOrder = new HashSet<PaymentOrder>();
         }
     
         public int PaymentMetodID { get; set; }
         public string PaymentMetodName { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Order> Orders { get; set; }
+        public virtual ICollection<PaymentOrder> PaymentOrder { get; set; }
     }
 }

+ 24 - 0
StoreServer/PaymentOrder.cs

@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated from a template.
+//
+//     Manual changes to this file may cause unexpected behavior in your application.
+//     Manual changes to this file will be overwritten if the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace StoreServer
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class PaymentOrder
+    {
+        public int PaymentID { get; set; }
+        public int IDPaymentMetod { get; set; }
+        public int IDOrder { get; set; }
+    
+        public virtual Order Order { get; set; }
+        public virtual PaymentMetod PaymentMetod { get; set; }
+    }
+}

+ 3 - 3
CentralServer/Product.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -17,7 +17,7 @@ namespace CentralServer
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Product()
         {
-            this.ProductInOrders = new HashSet<ProductInOrder>();
+            this.ProductInStore = new HashSet<ProductInStore>();
         }
     
         public int ProductID { get; set; }
@@ -28,6 +28,6 @@ namespace CentralServer
         public string BarCode { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<ProductInOrder> ProductInOrders { get; set; }
+        public virtual ICollection<ProductInStore> ProductInStore { get; set; }
     }
 }

+ 2 - 2
CentralServer/ProductInOrder.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -19,6 +19,6 @@ namespace CentralServer
         public int AmountProduct { get; set; }
     
         public virtual Order Order { get; set; }
-        public virtual Product Product { get; set; }
+        public virtual ProductInStore ProductInStore { get; set; }
     }
 }

+ 33 - 0
StoreServer/ProductInStore.cs

@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated from a template.
+//
+//     Manual changes to this file may cause unexpected behavior in your application.
+//     Manual changes to this file will be overwritten if the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace StoreServer
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class ProductInStore
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public ProductInStore()
+        {
+            this.ProductInOrder = new HashSet<ProductInOrder>();
+        }
+    
+        public int ProductInStoreID { get; set; }
+        public int IDStore { get; set; }
+        public int IDProduct { get; set; }
+        public int RemainsProduct { get; set; }
+    
+        public virtual Product Product { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<ProductInOrder> ProductInOrder { get; set; }
+        public virtual Store Store { get; set; }
+    }
+}

+ 0 - 16
StoreServer/RootDataOfStore.cs

@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace StoreServer
-{
-    public class RootDataOfStore
-    {
-        public int StoreID { get; set; }
-        public string Address { get; set; }
-
-        public List<RootDataOfCashier> Cashiers { get; set; }
-    }
-}

+ 10 - 6
StoreServer/StartWorkPage.xaml

@@ -9,15 +9,19 @@
       Title="Начало работы">
 
     <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition/>
             <RowDefinition/>
         </Grid.RowDefinitions>
-        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
-            <TextBlock Margin="0,0,20,0">Введите ID магазина:</TextBlock>
-            <TextBox Width="80" Name="TxtIDStore" Margin="0,0,20,0"></TextBox>
-            <Button x:Name="BtnFind" Content="Начать" Width="200" Click="BtnFind_Click"></Button>
-        </StackPanel>
-        <Button x:Name="BtnOfflineWork" Click="BtnOfflineWork_Click" Content="Работать оффлайн"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="60" Height="40" Width="200"></Button>
+
+        <TextBlock Margin="5" HorizontalAlignment="Right" VerticalAlignment="Bottom">ID магазина:</TextBlock>
+        <Button Grid.Row="1" Grid.ColumnSpan="2" Height="30" x:Name="BtnFind" Content="Начать" Margin="300,20,300,0" VerticalAlignment="Top" Click="BtnFind_Click"></Button>
+        <TextBox Grid.Column="1" Name="TxtIDStore" VerticalAlignment="Bottom"  Margin="7,0,250,7"/>
+
+
     </Grid>
 </Page>

+ 8 - 29
StoreServer/StartWorkPage.xaml.cs

@@ -27,35 +27,7 @@ namespace StoreServer
             InitializeComponent();
         }
 
-        private void BtnOfflineWork_Click(object sender, RoutedEventArgs e)
-        {
-
-        }
-
-        public async void GetDataOfStore(string StoreID)
-        {
-            try
-            {
-                HttpClient client = new HttpClient();
-                var response = await client.GetAsync($"http://127.0.0.1:8888/getDataOfStore?={StoreID}");
-                var rBody = await response.Content.ReadAsStringAsync();
-                if (rBody.Contains("Магазин не найден"))
-                {
-                    Helper.ErrorMessage($"{rBody}");
-                    return;
-                }
-                RootDataOfStore FindStore = JsonConvert.DeserializeObject<RootDataOfStore>(rBody);
-                Helper.FindStore = FindStore;
-                ManagerFrame.MainFrame.Navigate(new MonitoringCashierPage());
 
-            }
-            catch (Exception)
-            {
-                Helper.ErrorMessage("Нет ответа от сервера");
-            }
-
-
-        }
         private void BtnFind_Click(object sender, RoutedEventArgs e)
         {
             if (string.IsNullOrEmpty(TxtIDStore.Text) || TxtIDStore.Text.All(char.IsDigit) == false) 
@@ -63,7 +35,14 @@ namespace StoreServer
                 Helper.ErrorMessage("Не корректный ID");
                 return;
             }
-            GetDataOfStore(TxtIDStore.Text);
+            var FindStore = DB.db.Store.Find(Convert.ToInt32(TxtIDStore.Text));
+            if (FindStore == null)
+            {
+                Helper.ErrorMessage("Магазин не найден");
+                return;
+            }
+            Helper.FindStore = FindStore;
+            ManagerFrame.MainFrame.Navigate(new MonitoringCashierPage());
         }
     }
 }

+ 35 - 0
StoreServer/Store.cs

@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated from a template.
+//
+//     Manual changes to this file may cause unexpected behavior in your application.
+//     Manual changes to this file will be overwritten if the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace StoreServer
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class Store
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public Store()
+        {
+            this.ProductInStore = new HashSet<ProductInStore>();
+            this.Cashier = new HashSet<Cashier>();
+            this.EmployeeInStore = new HashSet<EmployeeInStore>();
+        }
+    
+        public int StoreID { get; set; }
+        public string Address { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<ProductInStore> ProductInStore { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<Cashier> Cashier { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<EmployeeInStore> EmployeeInStore { get; set; }
+    }
+}

+ 82 - 2
StoreServer/StoreServer.csproj

@@ -35,11 +35,20 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
+    </Reference>
+    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+    </Reference>
     <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.ComponentModel.DataAnnotations" />
     <Reference Include="System.Data" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Security" />
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Core" />
@@ -58,15 +67,64 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="Cashier.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="DB.cs" />
+    <Compile Include="Employee.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="EmployeeInStore.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="EmployeePartial.cs" />
     <Compile Include="Helper.cs" />
+    <Compile Include="ModelStore.Context.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ModelStore.Context.tt</DependentUpon>
+    </Compile>
+    <Compile Include="ModelStore.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="ModelStore.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>ModelStore.edmx</DependentUpon>
+    </Compile>
     <Compile Include="MonitoringCashierPage.xaml.cs">
       <DependentUpon>MonitoringCashierPage.xaml</DependentUpon>
     </Compile>
-    <Compile Include="RootDataOfCashier.cs" />
-    <Compile Include="RootDataOfStore.cs" />
+    <Compile Include="Order.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="PaymentMetod.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="PaymentOrder.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Product.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="ProductInOrder.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="ProductInStore.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
     <Compile Include="StartWorkPage.xaml.cs">
       <DependentUpon>StartWorkPage.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Store.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="WorkShift.cs">
+      <DependentUpon>ModelStore.tt</DependentUpon>
+    </Compile>
+    <Compile Include="WorkShiftPartial.cs" />
     <Page Include="MainWindow.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -107,6 +165,13 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
+    <EntityDeploy Include="ModelStore.edmx">
+      <Generator>EntityModelCodeGenerator</Generator>
+      <LastGenOutput>ModelStore.Designer.cs</LastGenOutput>
+    </EntityDeploy>
+    <None Include="ModelStore.edmx.diagram">
+      <DependentUpon>ModelStore.edmx</DependentUpon>
+    </None>
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
@@ -116,5 +181,20 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="ModelStore.Context.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <LastGenOutput>ModelStore.Context.cs</LastGenOutput>
+      <DependentUpon>ModelStore.edmx</DependentUpon>
+    </Content>
+    <Content Include="ModelStore.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <DependentUpon>ModelStore.edmx</DependentUpon>
+      <LastGenOutput>ModelStore.cs</LastGenOutput>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 5 - 5
CentralServer/WorkShift.cs

@@ -7,7 +7,7 @@
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace CentralServer
+namespace StoreServer
 {
     using System;
     using System.Collections.Generic;
@@ -17,18 +17,18 @@ namespace CentralServer
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public WorkShift()
         {
-            this.Orders = new HashSet<Order>();
+            this.Order = new HashSet<Order>();
         }
     
         public int WorkShiftID { get; set; }
         public int IDCashier { get; set; }
         public int IDEmployee { get; set; }
-        public System.DateTime StartDateAndTimeWork { get; set; }
+        public Nullable<System.DateTime> StartDateAndTimeWork { get; set; }
         public Nullable<System.DateTime> EndDateAndTimeWork { get; set; }
     
-        public virtual Employee Employee { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Order> Orders { get; set; }
+        public virtual ICollection<Order> Order { get; set; }
         public virtual Cashier Cashier { get; set; }
+        public virtual EmployeeInStore EmployeeInStore { get; set; }
     }
 }

+ 21 - 0
StoreServer/WorkShiftPartial.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StoreServer
+{
+   public partial class WorkShift
+   {
+        public string IsStartCashier
+        {
+            get
+            {
+                if (StartDateAndTimeWork == null) return "Не запущена";
+                if (StartDateAndTimeWork != null && EndDateAndTimeWork != null) return "Закончена"; 
+                return "Работает";
+            }
+        }
+   }
+}

BIN
StoreServer/bin/Debug/EntityFramework.SqlServer.dll


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2093 - 0
StoreServer/bin/Debug/EntityFramework.SqlServer.xml


BIN
StoreServer/bin/Debug/EntityFramework.dll


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 53236 - 0
StoreServer/bin/Debug/EntityFramework.xml


BIN
StoreServer/bin/Debug/StoreServer.exe


+ 21 - 4
StoreServer/bin/Debug/StoreServer.exe.config

@@ -1,6 +1,23 @@
-<?xml version="1.0" encoding="utf-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
-    </startup>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
+  </startup>
+  <connectionStrings>
+    <add name="gr672_pgvEntities" connectionString="metadata=res://*/ModelStore.csdl|res://*/ModelStore.ssdl|res://*/ModelStore.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=mssql;initial catalog=gr672_pgv;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+  <entityFramework>
+    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+      <parameters>
+        <parameter value="mssqllocaldb" />
+      </parameters>
+    </defaultConnectionFactory>
+    <providers>
+      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
+    </providers>
+  </entityFramework>
 </configuration>

+ 0 - 0
StoreServer/bin/Debug/StoreServer.pdb


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است