Kaynağa Gözat

vdwervgbege

mr.solder5 5 yıl önce
ebeveyn
işleme
8d963f3ca8

+ 1 - 4
CopyCenter/App.config

@@ -7,9 +7,6 @@
   <startup>
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
   </startup>
-  <connectionStrings>
-    <add name="gr672_liiEntities" connectionString="metadata=res://*/DataBase.csdl|res://*/DataBase.ssdl|res://*/DataBase.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DESKTOP-57848NR;initial catalog=gr672_lii;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
-  </connectionStrings>
   <entityFramework>
     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
       <parameters>
@@ -20,4 +17,4 @@
       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
     </providers>
   </entityFramework>
-</configuration>
+<connectionStrings><add name="gr672_liiEntities" connectionString="metadata=res://*/DataBase.csdl|res://*/DataBase.ssdl|res://*/DataBase.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=DESKTOP-57848NR;initial catalog=gr672_lii;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings></configuration>

+ 2 - 1
CopyCenter/AuthorizationWindow.xaml

@@ -20,6 +20,7 @@
         <TextBlock Text="Пароль" Grid.Row="1"/>
         <TextBox Name="login" Grid.Column="1" Grid.Row="0"/>
         <PasswordBox Name="password" Grid.Column="1"  Grid.Row="1"/>
-        <Button Grid.Row="2" Grid.Column="0" Content="Войти" Click="AuthorizationClick" FontFamily="Comic Sans MS" Grid.ColumnSpan="2"/>
+        <Button Grid.Row="2" Grid.Column="0" Content="Войти" Click="AuthorizationClick" FontFamily="Comic Sans MS"/>
+        <Button Grid.Row="2" Grid.Column="1" Content="Зарегистрироваться" Click="Registration_Click" FontFamily="Comic Sans MS" Margin="6,5,5,5"/>
     </Grid>
 </Window>

+ 7 - 1
CopyCenter/AuthorizationWindow.xaml.cs

@@ -33,7 +33,7 @@ namespace CopyCenter
                 MessageBox.Show("Введено неправильное значение");
                 return;
             }
-            if (db.User.Select(item => item.Login + " " + item.Password).Contains(login.Text + " " + password.Password))
+            if (db.Users.Select(item => item.Login + " " + item.Password).Contains(login.Text + " " + password.Password))
             {
                 MessageBox.Show("Добро пожаловать, вы авторизированы!");
                 MenuWindow mw = new MenuWindow();
@@ -46,5 +46,11 @@ namespace CopyCenter
             }
         }
 
+        private void Registration_Click(object sender, RoutedEventArgs e)
+        {
+            RegistrationWindow rw = new RegistrationWindow();
+            rw.Show();
+            this.Close();
+        }
     }
 }

+ 3 - 3
CopyCenter/Card.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 

+ 5 - 5
CopyCenter/CategoryService.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -17,13 +17,13 @@ namespace CopyCenter
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public CategoryService()
         {
-            this.Service = new HashSet<Service>();
+            this.Services = new HashSet<Service>();
         }
     
         public int idCategory { get; set; }
         public string NameCategory { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Service> Service { get; set; }
+        public virtual ICollection<Service> Services { get; set; }
     }
 }

+ 7 - 7
CopyCenter/Client.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -17,8 +17,8 @@ namespace CopyCenter
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Client()
         {
-            this.Card = new HashSet<Card>();
-            this.Order = new HashSet<Order>();
+            this.Cards = new HashSet<Card>();
+            this.Orders = new HashSet<Order>();
         }
     
         public int idClient { get; set; }
@@ -26,8 +26,8 @@ namespace CopyCenter
         public string TypeClient { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Card> Card { get; set; }
+        public virtual ICollection<Card> Cards { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Order> Order { get; set; }
+        public virtual ICollection<Order> Orders { get; set; }
     }
 }

+ 7 - 7
CopyCenter/ClientsWindow.xaml.cs

@@ -38,28 +38,28 @@ namespace CopyCenter
             Client client = new Client();
             client.NameClient = Name.Text;
             client.TypeClient = TypeClient.Text;
-            db.Client.Add(client);
+            db.Clients.Add(client);
             db.SaveChanges();
-            ClientsList.ItemsSource = db.Client.ToList();
+            ClientsList.ItemsSource = db.Clients.ToList();
         }
 
         private void Delete(object sender, RoutedEventArgs e)
         {
             Client dRow = new Client();
-            dRow = db.Client.Where(w => w.NameClient == Name.Text).FirstOrDefault();
-            db.Client.Remove(dRow);
+            dRow = db.Clients.Where(w => w.NameClient == Name.Text).FirstOrDefault();
+            db.Clients.Remove(dRow);
             db.SaveChanges();
-            ClientsList.ItemsSource = db.Client.ToList();
+            ClientsList.ItemsSource = db.Clients.ToList();
         }
 
         private void Update(object sender, RoutedEventArgs e)
         {
             Client uRow = new Client();
-            uRow = db.Client.Where(w => w.NameClient == Name.Text).FirstOrDefault();
+            uRow = db.Clients.Where(w => w.NameClient == Name.Text).FirstOrDefault();
             uRow.NameClient = Name.Text;
             uRow.TypeClient = TypeClient.Text;
             db.SaveChanges();
-            ClientsList.ItemsSource = db.Client.ToList();
+            ClientsList.ItemsSource = db.Clients.ToList();
         }
     }
 }

+ 29 - 20
CopyCenter/CopyCenter.csproj

@@ -82,6 +82,21 @@
     <Compile Include="ClientsWindow.xaml.cs">
       <DependentUpon>ClientsWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="DataBase.Context.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DataBase.Context.tt</DependentUpon>
+    </Compile>
+    <Compile Include="DataBase.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DataBase.tt</DependentUpon>
+    </Compile>
+    <Compile Include="DataBase.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>DataBase.edmx</DependentUpon>
+    </Compile>
     <Compile Include="Discount.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
@@ -97,34 +112,22 @@
     <Compile Include="Payment.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
+    <Compile Include="RegistrationWindow.xaml.cs">
+      <DependentUpon>RegistrationWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Service.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
     <Compile Include="ServicesWindow.xaml.cs">
       <DependentUpon>ServicesWindow.xaml</DependentUpon>
     </Compile>
-    <Compile Include="User.cs">
-      <DependentUpon>DataBase.tt</DependentUpon>
-    </Compile>
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="DataBase.Context.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>DataBase.Context.tt</DependentUpon>
-    </Compile>
-    <Compile Include="DataBase.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
+    <Compile Include="User.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
-    <Compile Include="DataBase.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>DataBase.edmx</DependentUpon>
-    </Compile>
     <Page Include="AuthorizationWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -145,6 +148,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="RegistrationWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="ServicesWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -191,10 +198,15 @@
   <ItemGroup>
     <Resource Include="exit_PNG29.png" />
     <Resource Include="04e31393e803da57d190cf03e6fb0090.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <ItemGroup>
     <Content Include="DataBase.Context.tt">
       <Generator>TextTemplatingFileGenerator</Generator>
-      <LastGenOutput>DataBase.Context.cs</LastGenOutput>
       <DependentUpon>DataBase.edmx</DependentUpon>
+      <LastGenOutput>DataBase.Context.cs</LastGenOutput>
     </Content>
     <Content Include="DataBase.tt">
       <Generator>TextTemplatingFileGenerator</Generator>
@@ -202,8 +214,5 @@
       <LastGenOutput>DataBase.cs</LastGenOutput>
     </Content>
   </ItemGroup>
-  <ItemGroup>
-    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
-  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 11 - 11
CopyCenter/DataBase.Context.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -25,13 +25,13 @@ namespace CopyCenter
             throw new UnintentionalCodeFirstException();
         }
     
-        public virtual DbSet<Card> Card { get; set; }
-        public virtual DbSet<CategoryService> CategoryService { get; set; }
-        public virtual DbSet<Client> Client { get; set; }
-        public virtual DbSet<Discount> Discount { get; set; }
-        public virtual DbSet<Order> Order { get; set; }
-        public virtual DbSet<Payment> Payment { get; set; }
-        public virtual DbSet<Service> Service { get; set; }
-        public virtual DbSet<User> User { get; set; }
+        public virtual DbSet<Card> Cards { get; set; }
+        public virtual DbSet<CategoryService> CategoryServices { get; set; }
+        public virtual DbSet<Client> Clients { get; set; }
+        public virtual DbSet<Discount> Discounts { get; set; }
+        public virtual DbSet<Order> Orders { get; set; }
+        public virtual DbSet<Payment> Payments { get; set; }
+        public virtual DbSet<Service> Services { get; set; }
+        public virtual DbSet<User> Users { get; set; }
     }
 }

+ 9 - 9
CopyCenter/DataBase.Designer.cs

@@ -1,10 +1,10 @@
-// Создание кода T4 для модели "C:\Users\gr672_lii\Source\Repos\CopyCenter\CopyCenter\DataBase.edmx" включено. 
-// Чтобы включить формирование кода прежних версий, измените значение свойства "Стратегия создания кода" конструктора
-// на "Legacy ObjectContext". Это свойство доступно в окне "Свойства", если модель
-// открыта в конструкторе.
+// T4 code generation is enabled for model 'C:\Users\locadm\Source\Repos\CopyCenter7\CopyCenter\DataBase.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.
 
-// Если не сформированы контекст и классы сущности, возможная причина в том, что вы создали пустую модель, но
-// еще не выбрали версию Entity Framework для использования. Чтобы сформировать класс контекста и классы сущностей
-// для своей модели, откройте модель в конструкторе, щелкните правой кнопкой область конструктора и
-// выберите "Обновить модель из базы данных", "Сформировать базу данных из модели" или "Добавить элемент формирования
-// кода...".
+// If no context and entity classes have been generated, it may be because you created an empty model but
+// have not yet chosen which version of Entity Framework to use. To generate a context class and entity
+// classes for your model, open the model in the designer, right-click on the designer surface, and
+// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
+// Item...'.

+ 3 - 3
CopyCenter/DataBase.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 

+ 122 - 124
CopyCenter/DataBase.edmx

@@ -4,7 +4,7 @@
   <edmx:Runtime>
     <!-- SSDL content -->
     <edmx:StorageModels>
-    <Schema Namespace="Хранилище gr672_liiModel" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
+      <Schema Namespace="gr672_liiModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
         <EntityType Name="Card">
           <Key>
             <PropertyRef Name="idCard" />
@@ -80,7 +80,6 @@
           <Property Name="FirstName" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="MiddleName" Type="nvarchar" MaxLength="50" />
           <Property Name="ContactNumber" Type="int" Nullable="false" />
-          <Property Name="Role" Type="nvarchar" MaxLength="50" Nullable="false" />
         </EntityType>
         <Association Name="FK_Card_Client">
           <End Role="Client" Type="Self.Client" Multiplicity="1" />
@@ -166,7 +165,7 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <EntityContainer Name="Хранилище gr672_liiModelContainer">
+        <EntityContainer Name="gr672_liiModelStoreContainer">
           <EntitySet Name="Card" EntityType="Self.Card" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="CategoryService" EntityType="Self.CategoryService" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Client" EntityType="Self.Client" Schema="dbo" store:Type="Tables" />
@@ -204,75 +203,38 @@
             <End Role="Service" EntitySet="Service" />
           </AssociationSet>
         </EntityContainer>
-      </Schema></edmx:StorageModels>
+      </Schema>
+    </edmx:StorageModels>
     <!-- CSDL content -->
     <edmx:ConceptualModels>
       <Schema Namespace="gr672_liiModel" 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_liiEntities" annotation:LazyLoadingEnabled="true">
-          <EntitySet Name="Card" EntityType="gr672_liiModel.Card" />
-          <EntitySet Name="CategoryService" EntityType="gr672_liiModel.CategoryService" />
-          <EntitySet Name="Client" EntityType="gr672_liiModel.Client" />
-          <EntitySet Name="Discount" EntityType="gr672_liiModel.Discount" />
-          <EntitySet Name="Order" EntityType="gr672_liiModel.Order" />
-          <EntitySet Name="Payment" EntityType="gr672_liiModel.Payment" />
-          <EntitySet Name="Service" EntityType="gr672_liiModel.Service" />
-          <EntitySet Name="User" EntityType="gr672_liiModel.User" />
-          <AssociationSet Name="FK_Card_Client" Association="gr672_liiModel.FK_Card_Client">
-            <End Role="Client" EntitySet="Client" />
-            <End Role="Card" EntitySet="Card" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Service_CategoryService" Association="gr672_liiModel.FK_Service_CategoryService">
-            <End Role="CategoryService" EntitySet="CategoryService" />
-            <End Role="Service" EntitySet="Service" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Order_Client" Association="gr672_liiModel.FK_Order_Client">
-            <End Role="Client" EntitySet="Client" />
-            <End Role="Order" EntitySet="Order" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Discount_Order" Association="gr672_liiModel.FK_Discount_Order">
-            <End Role="Order" EntitySet="Order" />
-            <End Role="Discount" EntitySet="Discount" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Order_Payment" Association="gr672_liiModel.FK_Order_Payment">
-            <End Role="Payment" EntitySet="Payment" />
-            <End Role="Order" EntitySet="Order" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Order_Service" Association="gr672_liiModel.FK_Order_Service">
-            <End Role="Service" EntitySet="Service" />
-            <End Role="Order" EntitySet="Order" />
-          </AssociationSet>
-          <AssociationSet Name="FK_Order_User" Association="gr672_liiModel.FK_Order_User">
-            <End Role="User" EntitySet="User" />
-            <End Role="Order" EntitySet="Order" />
-          </AssociationSet>
-        </EntityContainer>
         <EntityType Name="Card">
           <Key>
             <PropertyRef Name="idCard" />
           </Key>
           <Property Name="idCard" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="NumberCard" Type="Int32" Nullable="false" />
-          <Property Name="TypeCard" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
+          <Property Name="TypeCard" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
           <Property Name="idClient" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="Client" Relationship="gr672_liiModel.FK_Card_Client" FromRole="Card" ToRole="Client" />
+          <NavigationProperty Name="Client" Relationship="Self.FK_Card_Client" FromRole="Card" ToRole="Client" />
         </EntityType>
         <EntityType Name="CategoryService">
           <Key>
             <PropertyRef Name="idCategory" />
           </Key>
           <Property Name="idCategory" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="NameCategory" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="Service" Relationship="gr672_liiModel.FK_Service_CategoryService" FromRole="CategoryService" ToRole="Service" />
+          <Property Name="NameCategory" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <NavigationProperty Name="Services" Relationship="Self.FK_Service_CategoryService" FromRole="CategoryService" ToRole="Service" />
         </EntityType>
         <EntityType Name="Client">
           <Key>
             <PropertyRef Name="idClient" />
           </Key>
           <Property Name="idClient" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="NameClient" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="TypeClient" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="Card" Relationship="gr672_liiModel.FK_Card_Client" FromRole="Client" ToRole="Card" />
-          <NavigationProperty Name="Order" Relationship="gr672_liiModel.FK_Order_Client" FromRole="Client" ToRole="Order" />
+          <Property Name="NameClient" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="TypeClient" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <NavigationProperty Name="Cards" Relationship="Self.FK_Card_Client" FromRole="Client" ToRole="Card" />
+          <NavigationProperty Name="Orders" Relationship="Self.FK_Order_Client" FromRole="Client" ToRole="Order" />
         </EntityType>
         <EntityType Name="Discount">
           <Key>
@@ -281,7 +243,7 @@
           <Property Name="idDiscount" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="Procent" Type="Int32" Nullable="false" />
           <Property Name="idOrder" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="Order" Relationship="gr672_liiModel.FK_Discount_Order" FromRole="Discount" ToRole="Order" />
+          <NavigationProperty Name="Order" Relationship="Self.FK_Discount_Order" FromRole="Discount" ToRole="Order" />
         </EntityType>
         <EntityType Name="Order">
           <Key>
@@ -289,18 +251,18 @@
           </Key>
           <Property Name="idOrder" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="NumberOrder" Type="Int32" Nullable="false" />
-          <Property Name="ViewOrder" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
+          <Property Name="ViewOrder" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
           <Property Name="OrderDate" Type="DateTime" Nullable="false" Precision="0" />
           <Property Name="CostOrder" Type="Int32" Nullable="false" />
           <Property Name="idClient" Type="Int32" Nullable="false" />
           <Property Name="idService" Type="Int32" Nullable="false" />
           <Property Name="idUser" Type="Int32" Nullable="false" />
           <Property Name="idPayment" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="Client" Relationship="gr672_liiModel.FK_Order_Client" FromRole="Order" ToRole="Client" />
-          <NavigationProperty Name="Discount" Relationship="gr672_liiModel.FK_Discount_Order" FromRole="Order" ToRole="Discount" />
-          <NavigationProperty Name="Payment" Relationship="gr672_liiModel.FK_Order_Payment" FromRole="Order" ToRole="Payment" />
-          <NavigationProperty Name="Service" Relationship="gr672_liiModel.FK_Order_Service" FromRole="Order" ToRole="Service" />
-          <NavigationProperty Name="User" Relationship="gr672_liiModel.FK_Order_User" FromRole="Order" ToRole="User" />
+          <NavigationProperty Name="Client" Relationship="Self.FK_Order_Client" FromRole="Order" ToRole="Client" />
+          <NavigationProperty Name="Discounts" Relationship="Self.FK_Discount_Order" FromRole="Order" ToRole="Discount" />
+          <NavigationProperty Name="Payment" Relationship="Self.FK_Order_Payment" FromRole="Order" ToRole="Payment" />
+          <NavigationProperty Name="Service" Relationship="Self.FK_Order_Service" FromRole="Order" ToRole="Service" />
+          <NavigationProperty Name="User" Relationship="Self.FK_Order_User" FromRole="Order" ToRole="User" />
         </EntityType>
         <EntityType Name="Payment">
           <Key>
@@ -309,37 +271,36 @@
           <Property Name="idPayment" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="NumberPayment" Type="Int32" Nullable="false" />
           <Property Name="DatePayment" Type="DateTime" Nullable="false" Precision="0" />
-          <NavigationProperty Name="Order" Relationship="gr672_liiModel.FK_Order_Payment" FromRole="Payment" ToRole="Order" />
+          <NavigationProperty Name="Orders" Relationship="Self.FK_Order_Payment" FromRole="Payment" ToRole="Order" />
         </EntityType>
         <EntityType Name="Service">
           <Key>
             <PropertyRef Name="idService" />
           </Key>
           <Property Name="idService" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="NameService" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="PriceService" Type="Decimal" Nullable="false" Precision="19" Scale="4" />
-          <Property Name="DescriptionService" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
+          <Property Name="NameService" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="PriceService" Type="Decimal" Precision="19" Scale="4" Nullable="false" />
+          <Property Name="DescriptionService" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
           <Property Name="idCategory" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="CategoryService" Relationship="gr672_liiModel.FK_Service_CategoryService" FromRole="Service" ToRole="CategoryService" />
-          <NavigationProperty Name="Order" Relationship="gr672_liiModel.FK_Order_Service" FromRole="Service" ToRole="Order" />
+          <NavigationProperty Name="CategoryService" Relationship="Self.FK_Service_CategoryService" FromRole="Service" ToRole="CategoryService" />
+          <NavigationProperty Name="Orders" Relationship="Self.FK_Order_Service" FromRole="Service" ToRole="Order" />
         </EntityType>
         <EntityType Name="User">
           <Key>
             <PropertyRef Name="idUser" />
           </Key>
           <Property Name="idUser" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="Login" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="Password" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="LastName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="FirstName" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="true" />
+          <Property Name="Login" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="LastName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="FirstName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
+          <Property Name="MiddleName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
           <Property Name="ContactNumber" Type="Int32" Nullable="false" />
-          <Property Name="Role" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
-          <NavigationProperty Name="Order" Relationship="gr672_liiModel.FK_Order_User" FromRole="User" ToRole="Order" />
+          <NavigationProperty Name="Orders" Relationship="Self.FK_Order_User" FromRole="User" ToRole="Order" />
         </EntityType>
         <Association Name="FK_Card_Client">
-          <End Type="gr672_liiModel.Client" Role="Client" Multiplicity="1" />
-          <End Type="gr672_liiModel.Card" Role="Card" Multiplicity="*" />
+          <End Role="Client" Type="Self.Client" Multiplicity="1" />
+          <End Role="Card" Type="Self.Card" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Client">
               <PropertyRef Name="idClient" />
@@ -350,8 +311,8 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_Service_CategoryService">
-          <End Type="gr672_liiModel.CategoryService" Role="CategoryService" Multiplicity="1" />
-          <End Type="gr672_liiModel.Service" Role="Service" Multiplicity="*" />
+          <End Role="CategoryService" Type="Self.CategoryService" Multiplicity="1" />
+          <End Role="Service" Type="Self.Service" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="CategoryService">
               <PropertyRef Name="idCategory" />
@@ -362,8 +323,8 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_Order_Client">
-          <End Type="gr672_liiModel.Client" Role="Client" Multiplicity="1" />
-          <End Type="gr672_liiModel.Order" Role="Order" Multiplicity="*" />
+          <End Role="Client" Type="Self.Client" Multiplicity="1" />
+          <End Role="Order" Type="Self.Order" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Client">
               <PropertyRef Name="idClient" />
@@ -374,8 +335,8 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_Discount_Order">
-          <End Type="gr672_liiModel.Order" Role="Order" Multiplicity="1" />
-          <End Type="gr672_liiModel.Discount" Role="Discount" Multiplicity="*" />
+          <End Role="Order" Type="Self.Order" Multiplicity="1" />
+          <End Role="Discount" Type="Self.Discount" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Order">
               <PropertyRef Name="idOrder" />
@@ -386,8 +347,8 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_Order_Payment">
-          <End Type="gr672_liiModel.Payment" Role="Payment" Multiplicity="1" />
-          <End Type="gr672_liiModel.Order" Role="Order" Multiplicity="*" />
+          <End Role="Payment" Type="Self.Payment" Multiplicity="1" />
+          <End Role="Order" Type="Self.Order" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Payment">
               <PropertyRef Name="idPayment" />
@@ -398,8 +359,8 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_Order_Service">
-          <End Type="gr672_liiModel.Service" Role="Service" Multiplicity="1" />
-          <End Type="gr672_liiModel.Order" Role="Order" Multiplicity="*" />
+          <End Role="Service" Type="Self.Service" Multiplicity="1" />
+          <End Role="Order" Type="Self.Order" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="Service">
               <PropertyRef Name="idService" />
@@ -410,8 +371,8 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_Order_User">
-          <End Type="gr672_liiModel.User" Role="User" Multiplicity="1" />
-          <End Type="gr672_liiModel.Order" Role="Order" Multiplicity="*" />
+          <End Role="User" Type="Self.User" Multiplicity="1" />
+          <End Role="Order" Type="Self.Order" Multiplicity="*" />
           <ReferentialConstraint>
             <Principal Role="User">
               <PropertyRef Name="idUser" />
@@ -421,94 +382,131 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityContainer Name="gr672_liiEntities" annotation:LazyLoadingEnabled="true">
+          <EntitySet Name="Cards" EntityType="Self.Card" />
+          <EntitySet Name="CategoryServices" EntityType="Self.CategoryService" />
+          <EntitySet Name="Clients" EntityType="Self.Client" />
+          <EntitySet Name="Discounts" EntityType="Self.Discount" />
+          <EntitySet Name="Orders" EntityType="Self.Order" />
+          <EntitySet Name="Payments" EntityType="Self.Payment" />
+          <EntitySet Name="Services" EntityType="Self.Service" />
+          <EntitySet Name="Users" EntityType="Self.User" />
+          <AssociationSet Name="FK_Card_Client" Association="Self.FK_Card_Client">
+            <End Role="Client" EntitySet="Clients" />
+            <End Role="Card" EntitySet="Cards" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Service_CategoryService" Association="Self.FK_Service_CategoryService">
+            <End Role="CategoryService" EntitySet="CategoryServices" />
+            <End Role="Service" EntitySet="Services" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Order_Client" Association="Self.FK_Order_Client">
+            <End Role="Client" EntitySet="Clients" />
+            <End Role="Order" EntitySet="Orders" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Discount_Order" Association="Self.FK_Discount_Order">
+            <End Role="Order" EntitySet="Orders" />
+            <End Role="Discount" EntitySet="Discounts" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Order_Payment" Association="Self.FK_Order_Payment">
+            <End Role="Payment" EntitySet="Payments" />
+            <End Role="Order" EntitySet="Orders" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Order_Service" Association="Self.FK_Order_Service">
+            <End Role="Service" EntitySet="Services" />
+            <End Role="Order" EntitySet="Orders" />
+          </AssociationSet>
+          <AssociationSet Name="FK_Order_User" Association="Self.FK_Order_User">
+            <End Role="User" EntitySet="Users" />
+            <End Role="Order" EntitySet="Orders" />
+          </AssociationSet>
+        </EntityContainer>
       </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_liiModelContainer" CdmEntityContainer="gr672_liiEntities">
-          <EntitySetMapping Name="Card">
+        <EntityContainerMapping StorageEntityContainer="gr672_liiModelStoreContainer" CdmEntityContainer="gr672_liiEntities">
+          <EntitySetMapping Name="Cards">
             <EntityTypeMapping TypeName="gr672_liiModel.Card">
               <MappingFragment StoreEntitySet="Card">
-                <ScalarProperty Name="idClient" ColumnName="idClient" />
-                <ScalarProperty Name="TypeCard" ColumnName="TypeCard" />
-                <ScalarProperty Name="NumberCard" ColumnName="NumberCard" />
                 <ScalarProperty Name="idCard" ColumnName="idCard" />
+                <ScalarProperty Name="NumberCard" ColumnName="NumberCard" />
+                <ScalarProperty Name="TypeCard" ColumnName="TypeCard" />
+                <ScalarProperty Name="idClient" ColumnName="idClient" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="CategoryService">
+          <EntitySetMapping Name="CategoryServices">
             <EntityTypeMapping TypeName="gr672_liiModel.CategoryService">
               <MappingFragment StoreEntitySet="CategoryService">
-                <ScalarProperty Name="NameCategory" ColumnName="NameCategory" />
                 <ScalarProperty Name="idCategory" ColumnName="idCategory" />
+                <ScalarProperty Name="NameCategory" ColumnName="NameCategory" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Client">
+          <EntitySetMapping Name="Clients">
             <EntityTypeMapping TypeName="gr672_liiModel.Client">
               <MappingFragment StoreEntitySet="Client">
-                <ScalarProperty Name="TypeClient" ColumnName="TypeClient" />
-                <ScalarProperty Name="NameClient" ColumnName="NameClient" />
                 <ScalarProperty Name="idClient" ColumnName="idClient" />
+                <ScalarProperty Name="NameClient" ColumnName="NameClient" />
+                <ScalarProperty Name="TypeClient" ColumnName="TypeClient" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Discount">
+          <EntitySetMapping Name="Discounts">
             <EntityTypeMapping TypeName="gr672_liiModel.Discount">
               <MappingFragment StoreEntitySet="Discount">
-                <ScalarProperty Name="idOrder" ColumnName="idOrder" />
-                <ScalarProperty Name="Procent" ColumnName="Procent" />
                 <ScalarProperty Name="idDiscount" ColumnName="idDiscount" />
+                <ScalarProperty Name="Procent" ColumnName="Procent" />
+                <ScalarProperty Name="idOrder" ColumnName="idOrder" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Order">
+          <EntitySetMapping Name="Orders">
             <EntityTypeMapping TypeName="gr672_liiModel.Order">
               <MappingFragment StoreEntitySet="Order">
-                <ScalarProperty Name="idPayment" ColumnName="idPayment" />
-                <ScalarProperty Name="idUser" ColumnName="idUser" />
-                <ScalarProperty Name="idService" ColumnName="idService" />
-                <ScalarProperty Name="idClient" ColumnName="idClient" />
-                <ScalarProperty Name="CostOrder" ColumnName="CostOrder" />
-                <ScalarProperty Name="OrderDate" ColumnName="OrderDate" />
-                <ScalarProperty Name="ViewOrder" ColumnName="ViewOrder" />
-                <ScalarProperty Name="NumberOrder" ColumnName="NumberOrder" />
                 <ScalarProperty Name="idOrder" ColumnName="idOrder" />
+                <ScalarProperty Name="NumberOrder" ColumnName="NumberOrder" />
+                <ScalarProperty Name="ViewOrder" ColumnName="ViewOrder" />
+                <ScalarProperty Name="OrderDate" ColumnName="OrderDate" />
+                <ScalarProperty Name="CostOrder" ColumnName="CostOrder" />
+                <ScalarProperty Name="idClient" ColumnName="idClient" />
+                <ScalarProperty Name="idService" ColumnName="idService" />
+                <ScalarProperty Name="idUser" ColumnName="idUser" />
+                <ScalarProperty Name="idPayment" ColumnName="idPayment" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Payment">
+          <EntitySetMapping Name="Payments">
             <EntityTypeMapping TypeName="gr672_liiModel.Payment">
               <MappingFragment StoreEntitySet="Payment">
-                <ScalarProperty Name="DatePayment" ColumnName="DatePayment" />
-                <ScalarProperty Name="NumberPayment" ColumnName="NumberPayment" />
                 <ScalarProperty Name="idPayment" ColumnName="idPayment" />
+                <ScalarProperty Name="NumberPayment" ColumnName="NumberPayment" />
+                <ScalarProperty Name="DatePayment" ColumnName="DatePayment" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Service">
+          <EntitySetMapping Name="Services">
             <EntityTypeMapping TypeName="gr672_liiModel.Service">
               <MappingFragment StoreEntitySet="Service">
-                <ScalarProperty Name="idCategory" ColumnName="idCategory" />
-                <ScalarProperty Name="DescriptionService" ColumnName="DescriptionService" />
-                <ScalarProperty Name="PriceService" ColumnName="PriceService" />
-                <ScalarProperty Name="NameService" ColumnName="NameService" />
                 <ScalarProperty Name="idService" ColumnName="idService" />
+                <ScalarProperty Name="NameService" ColumnName="NameService" />
+                <ScalarProperty Name="PriceService" ColumnName="PriceService" />
+                <ScalarProperty Name="DescriptionService" ColumnName="DescriptionService" />
+                <ScalarProperty Name="idCategory" ColumnName="idCategory" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="User">
+          <EntitySetMapping Name="Users">
             <EntityTypeMapping TypeName="gr672_liiModel.User">
               <MappingFragment StoreEntitySet="User">
-                <ScalarProperty Name="Role" ColumnName="Role" />
-                <ScalarProperty Name="ContactNumber" ColumnName="ContactNumber" />
-                <ScalarProperty Name="MiddleName" ColumnName="MiddleName" />
-                <ScalarProperty Name="FirstName" ColumnName="FirstName" />
-                <ScalarProperty Name="LastName" ColumnName="LastName" />
-                <ScalarProperty Name="Password" ColumnName="Password" />
-                <ScalarProperty Name="Login" ColumnName="Login" />
                 <ScalarProperty Name="idUser" ColumnName="idUser" />
+                <ScalarProperty Name="Login" ColumnName="Login" />
+                <ScalarProperty Name="Password" ColumnName="Password" />
+                <ScalarProperty Name="LastName" ColumnName="LastName" />
+                <ScalarProperty Name="FirstName" ColumnName="FirstName" />
+                <ScalarProperty Name="MiddleName" ColumnName="MiddleName" />
+                <ScalarProperty Name="ContactNumber" ColumnName="ContactNumber" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
@@ -526,10 +524,10 @@
     <Options>
       <DesignerInfoPropertySet>
         <DesignerProperty Name="ValidateOnBuild" Value="true" />
-        <DesignerProperty Name="EnablePluralization" Value="false" />
+        <DesignerProperty Name="EnablePluralization" Value="true" />
         <DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
         <DesignerProperty Name="UseLegacyProvider" Value="false" />
-        <DesignerProperty Name="CodeGenerationStrategy" Value="Нет" />
+        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
       </DesignerInfoPropertySet>
     </Options>
     <!-- Diagram content (shape and connector positions) -->

+ 16 - 16
CopyCenter/DataBase.edmx.diagram

@@ -4,22 +4,22 @@
   <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
-      <Diagram DiagramId="6fd677cfeb9943bcb0063ba440d527c7" Name="Diagram1" ZoomLevel="82">
-        <EntityTypeShape EntityType="gr672_liiModel.Card" Width="1.5" PointX="4.375" PointY="0.625" />
-        <EntityTypeShape EntityType="gr672_liiModel.CategoryService" Width="1.5" PointX="1.125" PointY="10.375" />
-        <EntityTypeShape EntityType="gr672_liiModel.Client" Width="1.5" PointX="1.375" PointY="3.875" />
-        <EntityTypeShape EntityType="gr672_liiModel.Discount" Width="1.5" PointX="10" PointY="2" />
-        <EntityTypeShape EntityType="gr672_liiModel.Order" Width="1.5" PointX="6.375" PointY="4" />
-        <EntityTypeShape EntityType="gr672_liiModel.Payment" Width="1.5" PointX="7.875" PointY="8.25" />
-        <EntityTypeShape EntityType="gr672_liiModel.Service" Width="1.5" PointX="4.125" PointY="9.875" />
-        <EntityTypeShape EntityType="gr672_liiModel.User" Width="1.5" PointX="11" PointY="8.875" />
-        <AssociationConnector Association="gr672_liiModel.FK_Card_Client" />
-        <AssociationConnector Association="gr672_liiModel.FK_Service_CategoryService" />
-        <AssociationConnector Association="gr672_liiModel.FK_Order_Client" />
-        <AssociationConnector Association="gr672_liiModel.FK_Discount_Order" />
-        <AssociationConnector Association="gr672_liiModel.FK_Order_Payment" />
-        <AssociationConnector Association="gr672_liiModel.FK_Order_Service" />
-        <AssociationConnector Association="gr672_liiModel.FK_Order_User" />
+      <Diagram DiagramId="305f8f805f074dee85deaf07cf5492c4" Name="Diagram1">
+        <EntityTypeShape EntityType="gr672_liiModel.Card" Width="1.5" PointX="3" PointY="3.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.CategoryService" Width="1.5" PointX="1.5" PointY="9.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.Client" Width="1.5" PointX="0.75" PointY="3.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.Discount" Width="1.5" PointX="8.25" PointY="3.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.Order" Width="1.5" PointX="6" PointY="2.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.Payment" Width="1.5" PointX="3.75" PointY="6.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.Service" Width="1.5" PointX="3.75" PointY="9.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="gr672_liiModel.User" Width="1.5" PointX="3.75" PointY="12.5" IsExpanded="true" />
+        <AssociationConnector Association="gr672_liiModel.FK_Card_Client" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_liiModel.FK_Service_CategoryService" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_liiModel.FK_Order_Client" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_liiModel.FK_Discount_Order" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_liiModel.FK_Order_Payment" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_liiModel.FK_Order_Service" ManuallyRouted="false" />
+        <AssociationConnector Association="gr672_liiModel.FK_Order_User" ManuallyRouted="false" />
       </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 3 - 3
CopyCenter/Discount.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 

+ 5 - 5
CopyCenter/Order.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -17,7 +17,7 @@ namespace CopyCenter
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Order()
         {
-            this.Discount = new HashSet<Discount>();
+            this.Discounts = new HashSet<Discount>();
         }
     
         public int idOrder { get; set; }
@@ -32,7 +32,7 @@ namespace CopyCenter
     
         public virtual Client Client { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Discount> Discount { get; set; }
+        public virtual ICollection<Discount> Discounts { get; set; }
         public virtual Payment Payment { get; set; }
         public virtual Service Service { get; set; }
         public virtual User User { get; set; }

+ 5 - 5
CopyCenter/Payment.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -17,7 +17,7 @@ namespace CopyCenter
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Payment()
         {
-            this.Order = new HashSet<Order>();
+            this.Orders = new HashSet<Order>();
         }
     
         public int idPayment { get; set; }
@@ -25,6 +25,6 @@ namespace CopyCenter
         public System.DateTime DatePayment { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Order> Order { get; set; }
+        public virtual ICollection<Order> Orders { get; set; }
     }
 }

+ 39 - 0
CopyCenter/RegistrationWindow.xaml

@@ -0,0 +1,39 @@
+<Window x:Class="CopyCenter.RegistrationWindow"
+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:CopyCenter"
+          mc:Ignorable="d"
+    Title="Регистрация" Height="400" Width="400" WindowStartupLocation="CenterScreen" FontFamily="Century Gothic">
+    <Grid>
+        <Grid.RowDefinitions>
+        <RowDefinition/>
+        <RowDefinition/>
+        <RowDefinition/>
+        <RowDefinition/>
+        <RowDefinition/>
+        <RowDefinition/>
+        <RowDefinition/>
+    </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+        <ColumnDefinition/>
+        <ColumnDefinition/>
+    </Grid.ColumnDefinitions>
+            <TextBlock Text="Логин"/>
+        <TextBlock Text="Пароль" Grid.Row="1"/>
+        <TextBlock Text="Фамилия" Grid.Row="2"/>
+        <TextBlock Text="Имя" Grid.Row="3"/>
+        <TextBlock Text="Отчество" Grid.Row="4"/>
+        <TextBlock Text="Контактный номер" Grid.Row="5"/>
+        <TextBox x:Name="login" Grid.Column="1"/>
+        <PasswordBox Name="password" Grid.Column="1" Grid.Row="1"/>
+        <TextBox Name="lastname" Grid.Column="1" Grid.Row="2"/>
+        <TextBox x:Name="firstname" Grid.Column="1" Grid.Row="3"/>
+        <TextBox x:Name="middlename" Grid.Column="1" Grid.Row="4"/>
+        <TextBox x:Name="contactnumber" Grid.Column="1" Grid.Row="5"/>
+        <Button Grid.Row="6" Grid.Column="0" Content="Зарегистрироваться" Click="Registration_Click" FontFamily="Comic Sans MS"/>
+        <Button Grid.Row="6" Grid.Column="1" Content="Отмена" Click="Cancel" FontFamily="Comic Sans MS"/>
+    </Grid>
+
+</Window>

+ 65 - 0
CopyCenter/RegistrationWindow.xaml.cs

@@ -0,0 +1,65 @@
+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.Shapes;
+
+namespace CopyCenter
+{
+    /// <summary>
+    /// Interaction logic for RegistrationWindow.xaml
+    /// </summary>
+    public partial class RegistrationWindow : Window
+    {
+        gr672_liiEntities db;
+        public RegistrationWindow()
+        {
+            InitializeComponent();
+            db = new gr672_liiEntities();
+        }
+
+        private void Registration_Click(object sender, RoutedEventArgs e)
+        {
+            if (login.Text == "" || password.Password == "" || lastname.Text == "" || firstname.Text == "" || middlename.Text == "" || contactnumber.Text == "")
+            {
+              MessageBox.Show("Введено неверное значение");
+              return;
+            }
+            if (db.Users.Select(item => item.Login).Contains(login.Text))
+            {
+               MessageBox.Show("Такой логин уже существует в системе");
+                return;
+            }
+            User newUser = new User()
+            {
+                Login = login.Text,
+                Password = password.Password,
+                LastName = lastname.Text,
+                FirstName = firstname.Text,
+                MiddleName = middlename.Text,
+                ContactNumber = Convert.ToInt32(contactnumber.Text)
+            };
+            db.Users.Add(newUser);
+            db.SaveChanges();
+            MessageBox.Show("Вы успешно зарегистрировались");
+            AuthorizationWindow aw = new AuthorizationWindow();
+            aw.Show();
+            this.Close();
+        }
+
+        private void Cancel(object sender, RoutedEventArgs e)
+        {
+            AuthorizationWindow aw = new AuthorizationWindow();
+            aw.Show();
+            this.Close();
+        }
+    }
+}

+ 5 - 5
CopyCenter/Service.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -17,7 +17,7 @@ namespace CopyCenter
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Service()
         {
-            this.Order = new HashSet<Order>();
+            this.Orders = new HashSet<Order>();
         }
     
         public int idService { get; set; }
@@ -28,6 +28,6 @@ namespace CopyCenter
     
         public virtual CategoryService CategoryService { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Order> Order { get; set; }
+        public virtual ICollection<Order> Orders { get; set; }
     }
 }

+ 7 - 7
CopyCenter/ServicesWindow.xaml.cs

@@ -40,21 +40,21 @@ namespace CopyCenter
             service.PriceService = Convert.ToInt32(Price.Text);
             service.DescriptionService = Description.Text;
             service.idCategory = Convert.ToInt32(idCategory.Text);
-            db.Service.Add(service);
+            db.Services.Add(service);
             db.SaveChanges();
-            ServicesList.ItemsSource = db.Service.ToList();
+            ServicesList.ItemsSource = db.Services.ToList();
         }
 
         private void Update(object sender, RoutedEventArgs e)
         {
             Service uRow = new Service();
-            uRow = db.Service.Where(w => w.NameService == Name.Text).FirstOrDefault();
+            uRow = db.Services.Where(w => w.NameService == Name.Text).FirstOrDefault();
             uRow.NameService = Name.Text;
             uRow.PriceService = Convert.ToInt32(Price.Text);
             uRow.DescriptionService = Description.Text;
             uRow.idCategory = Convert.ToInt32(idCategory.Text);
             db.SaveChanges();
-            ServicesList.ItemsSource = db.Service.ToList();
+            ServicesList.ItemsSource = db.Services.ToList();
         }
         private void Window_Loaded(object sender, RoutedEventArgs e)
         {
@@ -64,10 +64,10 @@ namespace CopyCenter
         private void Delete(object sender, RoutedEventArgs e)
         {
             Service dRow = new Service();
-            dRow = db.Service.Where(w => w.NameService == Name.Text).FirstOrDefault();
-            db.Service.Remove(dRow);
+            dRow = db.Services.Where(w => w.NameService == Name.Text).FirstOrDefault();
+            db.Services.Remove(dRow);
             db.SaveChanges();
-            ServicesList.ItemsSource = db.Service.ToList();
+            ServicesList.ItemsSource = db.Services.ToList();
         }
     }
 }

+ 5 - 6
CopyCenter/User.cs

@@ -1,9 +1,9 @@
 //------------------------------------------------------------------------------
 // <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>
 //------------------------------------------------------------------------------
 
@@ -17,7 +17,7 @@ namespace CopyCenter
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public User()
         {
-            this.Order = new HashSet<Order>();
+            this.Orders = new HashSet<Order>();
         }
     
         public int idUser { get; set; }
@@ -27,9 +27,8 @@ namespace CopyCenter
         public string FirstName { get; set; }
         public string MiddleName { get; set; }
         public int ContactNumber { get; set; }
-        public string Role { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<Order> Order { get; set; }
+        public virtual ICollection<Order> Orders { get; set; }
     }
 }