瀏覽代碼

Сделан вывод всех элементов по отдельности (в выводе турнирной сетки делать по аналогии)

максим карбышев 3 年之前
父節點
當前提交
2785bde7ce
共有 36 個文件被更改,包括 852 次插入241 次删除
  1. 8 4
      CybersportTournament/AddWindows/AddRoundWindow.xaml
  2. 20 1
      CybersportTournament/AddWindows/AddRoundWindow.xaml.cs
  3. 4 1
      CybersportTournament/App.config
  4. 33 2
      CybersportTournament/CybersportTournament.csproj
  5. 2 1
      CybersportTournament/CybersportTournamentModel.Context.cs
  6. 1 1
      CybersportTournament/CybersportTournamentModel.Designer.cs
  7. 147 77
      CybersportTournament/CybersportTournamentModel.edmx
  8. 29 27
      CybersportTournament/CybersportTournamentModel.edmx.diagram
  9. 33 0
      CybersportTournament/ElementsWindows/GameWindow.xaml
  10. 51 0
      CybersportTournament/ElementsWindows/GameWindow.xaml.cs
  11. 38 0
      CybersportTournament/ElementsWindows/MatchWindow.xaml
  12. 52 0
      CybersportTournament/ElementsWindows/MatchWindow.xaml.cs
  13. 8 6
      CybersportTournament/ElementsWindows/PlayerWindow.xaml
  14. 47 11
      CybersportTournament/ElementsWindows/PlayerWindow.xaml.cs
  15. 33 0
      CybersportTournament/ElementsWindows/TeamWindow.xaml
  16. 53 0
      CybersportTournament/ElementsWindows/TeamWindow.xaml.cs
  17. 64 0
      CybersportTournament/ElementsWindows/TournamentWindow.xaml
  18. 53 0
      CybersportTournament/ElementsWindows/TournamentWindow.xaml.cs
  19. 3 0
      CybersportTournament/Games.cs
  20. 5 0
      CybersportTournament/ListWindows/GamesListWindow.xaml
  21. 12 8
      CybersportTournament/ListWindows/GamesListWindow.xaml.cs
  22. 18 2
      CybersportTournament/ListWindows/MatchesListWindow.xaml
  23. 45 11
      CybersportTournament/ListWindows/MatchesListWindow.xaml.cs
  24. 5 0
      CybersportTournament/ListWindows/PlayersListWindow.xaml
  25. 13 0
      CybersportTournament/ListWindows/PlayersListWindow.xaml.cs
  26. 8 3
      CybersportTournament/ListWindows/TeamsListWindow.xaml
  27. 12 34
      CybersportTournament/ListWindows/TeamsListWindow.xaml.cs
  28. 8 3
      CybersportTournament/ListWindows/TournamrntsListWindow.xaml
  29. 14 37
      CybersportTournament/ListWindows/TournamrntsListWindow.xaml.cs
  30. 1 1
      CybersportTournament/MainWindow.xaml.cs
  31. 24 0
      CybersportTournament/MapsGame.cs
  32. 1 0
      CybersportTournament/Match.cs
  33. 1 0
      CybersportTournament/Rounds.cs
  34. 0 8
      CybersportTournament/TeamsList.cs
  35. 3 0
      CybersportTournament/Tournaments.cs
  36. 3 3
      CybersportTournament/MatchesResults.cs

+ 8 - 4
CybersportTournament/AddWindows/AddRoundWindow.xaml

@@ -7,10 +7,14 @@
         mc:Ignorable="d"
         Title="AddRoundWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
     <Grid>
-        <Label Content="Матч:" HorizontalAlignment="Left" Margin="127,318,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <ComboBox Name="MatchesBox" HorizontalAlignment="Left" Margin="307,318,0,0" VerticalAlignment="Top" Height="60" Width="550" FontSize="36"/>
-        <Label Content="Раунд:" HorizontalAlignment="Left" Margin="127,400,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <TextBox Name="RoundBox" HorizontalAlignment="Left" Margin="307,400,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="60" Width="550" FontSize="36" TextChanged="RoundBoxTextChanged"/>
+        <Label Content="Матч:" HorizontalAlignment="Left" Margin="127,268,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <ComboBox Name="MatchesBox" HorizontalAlignment="Left" Margin="307,270,0,0" VerticalAlignment="Top" Height="60" Width="550" FontSize="36"/>
+        <Label Content="Раунд:" HorizontalAlignment="Left" Margin="127,350,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <TextBox Name="RoundBox" HorizontalAlignment="Left" Margin="307,350,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="60" Width="550" FontSize="36" TextChanged="RoundBoxTextChanged"/>
+        <Label Content="Длительность:" HorizontalAlignment="Left" Margin="59,432,0,0" VerticalAlignment="Top" Height="60" Width="248" Foreground="White" FontSize="36"/>
+        <TextBox Name="Period" HorizontalAlignment="Left" Margin="307,432,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="60" Width="550" FontSize="36" TextChanged="RoundBoxTextChanged"/>
+        <Label Content="Результат:" HorizontalAlignment="Left" Margin="127,514,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <TextBox Name="Result" HorizontalAlignment="Left" Margin="307,514,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="60" Width="550" FontSize="36" TextChanged="RoundBoxTextChanged"/>
         <Button Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <Button Name="AddButton" Content="Добавить" HorizontalAlignment="Center" Margin="0,746,0,0" VerticalAlignment="Top" Height="60" Width="180" FontSize="36" Click="AddButtonClick" />
     </Grid>

+ 20 - 1
CybersportTournament/AddWindows/AddRoundWindow.xaml.cs

@@ -1,4 +1,5 @@
 using ConnectionClass;
+using CybersportTournament.ElementsWindows;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -11,6 +12,7 @@ namespace CybersportTournament.AddWindows
     /// </summary>
     public partial class AddRoundWindow : Window
     {
+        int idMatch;
         List<char> numbers = new List<char> { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' };
         public AddRoundWindow()
         {
@@ -18,6 +20,14 @@ namespace CybersportTournament.AddWindows
             MatchesBox.ItemsSource = Connection.db.Match.Select(item => item.Name).ToList();
         }
 
+        public AddRoundWindow(int IDMatch)
+        {
+            InitializeComponent();
+            idMatch = IDMatch;
+            MatchesBox.ItemsSource = Connection.db.Match.Where(item => item.ID == IDMatch).Select(item => item.Name).ToList();
+            MatchesBox.SelectedItem = Connection.db.Match.Where(item => item.ID == IDMatch).Select(item => item.Name).FirstOrDefault();
+        }
+
         private void AddButtonClick(object sender, RoutedEventArgs e)
         {
             #region Добавление раунд
@@ -32,6 +42,15 @@ namespace CybersportTournament.AddWindows
             {
                 Name = Convert.ToInt32(RoundBox.Text)
             };
+            if (Period.Text != null)
+            {
+                int index = Period.Text.IndexOf(":");
+                round.Period = new TimeSpan(Convert.ToInt32(Period.Text.Substring(0, index)), Convert.ToInt32(Period.Text.Substring(index + 1, Period.Text.Length - index - 1)), 0);
+            }    
+            if (Result.Text != null)
+            {
+                round.Result = Result.Text;
+            }
             Connection.db.Rounds.Add(round);
             Connection.db.SaveChanges();
 
@@ -45,7 +64,7 @@ namespace CybersportTournament.AddWindows
             Connection.db.SaveChanges();
 
 
-            MainWindow mw = new MainWindow();
+            MatchWindow mw = new MatchWindow(idMatch);
             mw.Show();
             this.Close();
             #endregion

+ 4 - 1
CybersportTournament/App.config

@@ -17,4 +17,7 @@
       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
     </providers>
   </entityFramework>
-<connectionStrings><add name="CybersportTournamentEntities" connectionString="metadata=res://*/CybersportTournamentModel.csdl|res://*/CybersportTournamentModel.ssdl|res://*/CybersportTournamentModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=mssql;initial catalog=gr692_kme;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /></connectionStrings></configuration>
+  <connectionStrings>
+    <add name="CybersportTournamentEntities" connectionString="metadata=res://*/CybersportTournamentModel.csdl|res://*/CybersportTournamentModel.ssdl|res://*/CybersportTournamentModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=TRIPS;initial catalog=CybersportTournaments;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+</configuration>

+ 33 - 2
CybersportTournament/CybersportTournament.csproj

@@ -97,9 +97,21 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>CybersportTournamentModel.edmx</DependentUpon>
     </Compile>
+    <Compile Include="ElementsWindows\GameWindow.xaml.cs">
+      <DependentUpon>GameWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ElementsWindows\MatchWindow.xaml.cs">
+      <DependentUpon>MatchWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="ElementsWindows\PlayerWindow.xaml.cs">
       <DependentUpon>PlayerWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="ElementsWindows\TeamWindow.xaml.cs">
+      <DependentUpon>TeamWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="ElementsWindows\TournamentWindow.xaml.cs">
+      <DependentUpon>TournamentWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Games.cs">
       <DependentUpon>CybersportTournamentModel.tt</DependentUpon>
     </Compile>
@@ -118,10 +130,10 @@
     <Compile Include="ListWindows\TournamrntsListWindow.xaml.cs">
       <DependentUpon>TournamrntsListWindow.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Match.cs">
+    <Compile Include="MapsGame.cs">
       <DependentUpon>CybersportTournamentModel.tt</DependentUpon>
     </Compile>
-    <Compile Include="MatchesResults.cs">
+    <Compile Include="Match.cs">
       <DependentUpon>CybersportTournamentModel.tt</DependentUpon>
     </Compile>
     <Compile Include="MatchList.cs">
@@ -164,6 +176,9 @@
     <Compile Include="Tournaments.cs">
       <DependentUpon>CybersportTournamentModel.tt</DependentUpon>
     </Compile>
+    <Compile Include="TournamentsResults.cs">
+      <DependentUpon>CybersportTournamentModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="User.cs" />
     <Compile Include="MainWindow.xaml.cs">
       <DependentUpon>MainWindow.xaml</DependentUpon>
@@ -208,10 +223,26 @@
       <DependentUpon>AuthorizationWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
+    <Page Include="ElementsWindows\GameWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ElementsWindows\MatchWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="ElementsWindows\PlayerWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="ElementsWindows\TeamWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="ElementsWindows\TournamentWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="ErrorWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 2 - 1
CybersportTournament/CybersportTournamentModel.Context.cs

@@ -26,8 +26,8 @@ namespace CybersportTournament
         }
     
         public virtual DbSet<Games> Games { get; set; }
+        public virtual DbSet<MapsGame> MapsGame { get; set; }
         public virtual DbSet<Match> Match { get; set; }
-        public virtual DbSet<MatchesResults> MatchesResults { get; set; }
         public virtual DbSet<MatchList> MatchList { get; set; }
         public virtual DbSet<Persons> Persons { get; set; }
         public virtual DbSet<Players> Players { get; set; }
@@ -38,6 +38,7 @@ namespace CybersportTournament
         public virtual DbSet<Teams> Teams { get; set; }
         public virtual DbSet<TeamsList> TeamsList { get; set; }
         public virtual DbSet<Tournaments> Tournaments { get; set; }
+        public virtual DbSet<TournamentsResults> TournamentsResults { get; set; }
         public virtual DbSet<Users> Users { get; set; }
     }
 }

+ 1 - 1
CybersportTournament/CybersportTournamentModel.Designer.cs

@@ -1,4 +1,4 @@
-// Создание кода T4 для модели "Z:\ТИС\Курсач\Прога\CybersportTournament\CybersportTournamentModel.edmx" включено. 
+// Создание кода T4 для модели "C:\Users\79609\source\repos\CybersportTournament\CybersportTournament\CybersportTournamentModel.edmx" включено. 
 // Чтобы включить формирование кода прежних версий, измените значение свойства "Стратегия создания кода" конструктора
 // на "Legacy ObjectContext". Это свойство доступно в окне "Свойства", если модель
 // открыта в конструкторе.

+ 147 - 77
CybersportTournament/CybersportTournamentModel.edmx

@@ -4,7 +4,7 @@
   <edmx:Runtime>
     <!-- SSDL content -->
     <edmx:StorageModels>
-    <Schema Namespace="Хранилище gr692_kmeModel" 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="Хранилище CybersportTournamentsModel" 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="Games">
           <Key>
             <PropertyRef Name="ID" />
@@ -12,25 +12,27 @@
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="Name" Type="varchar" MaxLength="50" Nullable="false" />
           <Property Name="Link" Type="varchar(max)" />
-          <Property Name="Logo" Type="varbinary(max)" />
+          <Property Name="Logo" Type="image" />
         </EntityType>
-        <EntityType Name="Match">
+        <EntityType Name="MapsGame">
           <Key>
             <PropertyRef Name="ID" />
           </Key>
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
-          <Property Name="Name" Type="nvarchar" MaxLength="100" />
-          <Property Name="Time" Type="datetime" Nullable="false" />
-          <Property Name="Period" Type="time" Precision="7" />
-          <Property Name="Result" Type="varchar" MaxLength="10" />
+          <Property Name="IDGame" Type="int" Nullable="false" />
+          <Property Name="Name" Type="varchar" MaxLength="50" Nullable="false" />
+          <Property Name="Image" Type="image" />
         </EntityType>
-        <EntityType Name="MatchesResults">
+        <EntityType Name="Match">
           <Key>
             <PropertyRef Name="ID" />
           </Key>
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
-          <Property Name="IDTeamList" Type="int" Nullable="false" />
-          <Property Name="Name" Type="varchar" MaxLength="20" Nullable="false" />
+          <Property Name="Name" Type="nvarchar" MaxLength="100" />
+          <Property Name="Time" Type="date" Nullable="false" />
+          <Property Name="Period" Type="time" Precision="7" />
+          <Property Name="Result" Type="varchar" MaxLength="10" />
+          <Property Name="Number" Type="int" Nullable="false" />
         </EntityType>
         <EntityType Name="MatchList">
           <Key>
@@ -58,7 +60,7 @@
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="IDPerson" Type="int" Nullable="false" />
           <Property Name="Nickname" Type="varchar" MaxLength="50" Nullable="false" />
-          <Property Name="Photo" Type="varbinary(max)" />
+          <Property Name="Photo" Type="image" />
         </EntityType>
         <EntityType Name="PlayersList">
           <Key>
@@ -75,6 +77,7 @@
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="Name" Type="int" Nullable="false" />
           <Property Name="Period" Type="time" Precision="7" />
+          <Property Name="Result" Type="varchar" MaxLength="15" />
         </EntityType>
         <EntityType Name="RoundsList">
           <Key>
@@ -100,7 +103,7 @@
           </Key>
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="Name" Type="varchar" MaxLength="50" Nullable="false" />
-          <Property Name="Logo" Type="varbinary(max)" />
+          <Property Name="Logo" Type="image" />
         </EntityType>
         <EntityType Name="TeamsList">
           <Key>
@@ -118,8 +121,16 @@
           <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="IDGame" Type="int" Nullable="false" />
           <Property Name="Name" Type="varchar" MaxLength="50" Nullable="false" />
-          <Property Name="PrizeFund" Type="decimal" Precision="19" Scale="4" />
-          <Property Name="Logo" Type="varbinary(max)" />
+          <Property Name="PrizeFund" Type="money" />
+          <Property Name="Logo" Type="image" />
+        </EntityType>
+        <EntityType Name="TournamentsResults">
+          <Key>
+            <PropertyRef Name="ID" />
+          </Key>
+          <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="IDTournament" Type="int" Nullable="false" />
+          <Property Name="Name" Type="varchar" MaxLength="20" Nullable="false" />
         </EntityType>
         <EntityType Name="Users">
           <Key>
@@ -130,15 +141,15 @@
           <Property Name="Login" Type="varchar" MaxLength="50" Nullable="false" />
           <Property Name="Password" Type="varchar" MaxLength="50" Nullable="false" />
         </EntityType>
-        <Association Name="FK_MatchesResults_TeamsList">
-          <End Role="TeamsList" Type="Self.TeamsList" Multiplicity="1" />
-          <End Role="MatchesResults" Type="Self.MatchesResults" Multiplicity="*" />
+        <Association Name="FK_MapsGame_Games">
+          <End Role="Games" Type="Self.Games" Multiplicity="1" />
+          <End Role="MapsGame" Type="Self.MapsGame" Multiplicity="*" />
           <ReferentialConstraint>
-            <Principal Role="TeamsList">
+            <Principal Role="Games">
               <PropertyRef Name="ID" />
             </Principal>
-            <Dependent Role="MatchesResults">
-              <PropertyRef Name="IDTeamList" />
+            <Dependent Role="MapsGame">
+              <PropertyRef Name="IDGame" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
@@ -262,6 +273,18 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_TournamentsResults_Tournaments">
+          <End Role="Tournaments" Type="Self.Tournaments" Multiplicity="1" />
+          <End Role="TournamentsResults" Type="Self.TournamentsResults" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Tournaments">
+              <PropertyRef Name="ID" />
+            </Principal>
+            <Dependent Role="TournamentsResults">
+              <PropertyRef Name="IDTournament" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_Users_Persons">
           <End Role="Persons" Type="Self.Persons" Multiplicity="1" />
           <End Role="Users" Type="Self.Users" Multiplicity="*" />
@@ -274,10 +297,10 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <EntityContainer Name="Хранилище gr692_kmeModelContainer">
+        <EntityContainer Name="Хранилище CybersportTournamentsModelContainer">
           <EntitySet Name="Games" EntityType="Self.Games" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="MapsGame" EntityType="Self.MapsGame" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Match" EntityType="Self.Match" Schema="dbo" store:Type="Tables" />
-          <EntitySet Name="MatchesResults" EntityType="Self.MatchesResults" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="MatchList" EntityType="Self.MatchList" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Persons" EntityType="Self.Persons" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Players" EntityType="Self.Players" Schema="dbo" store:Type="Tables" />
@@ -288,10 +311,11 @@
           <EntitySet Name="Teams" EntityType="Self.Teams" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="TeamsList" EntityType="Self.TeamsList" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Tournaments" EntityType="Self.Tournaments" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="TournamentsResults" EntityType="Self.TournamentsResults" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Users" EntityType="Self.Users" Schema="dbo" store:Type="Tables" />
-          <AssociationSet Name="FK_MatchesResults_TeamsList" Association="Self.FK_MatchesResults_TeamsList">
-            <End Role="TeamsList" EntitySet="TeamsList" />
-            <End Role="MatchesResults" EntitySet="MatchesResults" />
+          <AssociationSet Name="FK_MapsGame_Games" Association="Self.FK_MapsGame_Games">
+            <End Role="Games" EntitySet="Games" />
+            <End Role="MapsGame" EntitySet="MapsGame" />
           </AssociationSet>
           <AssociationSet Name="FK_MatchList_Match" Association="Self.FK_MatchList_Match">
             <End Role="Match" EntitySet="Match" />
@@ -333,6 +357,10 @@
             <End Role="Games" EntitySet="Games" />
             <End Role="Tournaments" EntitySet="Tournaments" />
           </AssociationSet>
+          <AssociationSet Name="FK_TournamentsResults_Tournaments" Association="Self.FK_TournamentsResults_Tournaments">
+            <End Role="Tournaments" EntitySet="Tournaments" />
+            <End Role="TournamentsResults" EntitySet="TournamentsResults" />
+          </AssociationSet>
           <AssociationSet Name="FK_Users_Persons" Association="Self.FK_Users_Persons">
             <End Role="Persons" EntitySet="Persons" />
             <End Role="Users" EntitySet="Users" />
@@ -341,7 +369,7 @@
       </Schema></edmx:StorageModels>
     <!-- CSDL content -->
     <edmx:ConceptualModels>
-      <Schema Namespace="gr692_kmeModel" 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">
+      <Schema Namespace="CybersportTournamentsModel" 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">
         <EntityType Name="Games">
           <Key>
             <PropertyRef Name="ID" />
@@ -350,28 +378,31 @@
           <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="false" Nullable="false" />
           <Property Name="Link" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
           <Property Name="Logo" Type="Binary" MaxLength="Max" FixedLength="false" />
+          <NavigationProperty Name="MapsGame" Relationship="Self.FK_MapsGame_Games" FromRole="Games" ToRole="MapsGame" />
           <NavigationProperty Name="Tournaments" Relationship="Self.FK_Tournaments_Games" FromRole="Games" ToRole="Tournaments" />
         </EntityType>
+        <EntityType Name="MapsGame">
+          <Key>
+            <PropertyRef Name="ID" />
+          </Key>
+          <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="IDGame" Type="Int32" Nullable="false" />
+          <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="false" Nullable="false" />
+          <Property Name="Image" Type="Binary" MaxLength="Max" FixedLength="false" />
+          <NavigationProperty Name="Games" Relationship="Self.FK_MapsGame_Games" FromRole="MapsGame" ToRole="Games" />
+        </EntityType>
         <EntityType Name="Match">
           <Key>
             <PropertyRef Name="ID" />
           </Key>
           <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
           <Property Name="Name" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
-          <Property Name="Time" Type="DateTime" Nullable="false" Precision="3" />
+          <Property Name="Time" Type="DateTime" Nullable="false" Precision="0" />
           <Property Name="Period" Type="Time" Precision="7" />
           <Property Name="Result" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
           <NavigationProperty Name="MatchList" Relationship="Self.FK_MatchList_Match" FromRole="Match" ToRole="MatchList" />
           <NavigationProperty Name="RoundsList" Relationship="Self.FK_RoundsList_Match" FromRole="Match" ToRole="RoundsList" />
-        </EntityType>
-        <EntityType Name="MatchesResults">
-          <Key>
-            <PropertyRef Name="ID" />
-          </Key>
-          <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="IDTeamList" Type="Int32" Nullable="false" />
-          <Property Name="Name" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
-          <NavigationProperty Name="TeamsList" Relationship="Self.FK_MatchesResults_TeamsList" FromRole="MatchesResults" ToRole="TeamsList" />
+          <Property Name="Number" Type="Int32" Nullable="false" />
         </EntityType>
         <EntityType Name="MatchList">
           <Key>
@@ -425,6 +456,7 @@
           <Property Name="Name" Type="Int32" Nullable="false" />
           <Property Name="Period" Type="Time" Precision="7" />
           <NavigationProperty Name="RoundsList" Relationship="Self.FK_RoundsList_Rounds" FromRole="Rounds" ToRole="RoundsList" />
+          <Property Name="Result" Type="String" MaxLength="15" FixedLength="false" Unicode="false" />
         </EntityType>
         <EntityType Name="RoundsList">
           <Key>
@@ -464,7 +496,6 @@
           <Property Name="IDTournament" Type="Int32" Nullable="false" />
           <Property Name="IDTeam" Type="Int32" Nullable="false" />
           <Property Name="NumberTeamList" Type="Int32" Nullable="false" />
-          <NavigationProperty Name="MatchesResults" Relationship="Self.FK_MatchesResults_TeamsList" FromRole="TeamsList" ToRole="MatchesResults" />
           <NavigationProperty Name="Teams" Relationship="Self.FK_TeamsList_Teams" FromRole="TeamsList" ToRole="Teams" />
           <NavigationProperty Name="Tournaments" Relationship="Self.FK_TeamsList_Tournaments" FromRole="TeamsList" ToRole="Tournaments" />
         </EntityType>
@@ -480,6 +511,16 @@
           <NavigationProperty Name="Games" Relationship="Self.FK_Tournaments_Games" FromRole="Tournaments" ToRole="Games" />
           <NavigationProperty Name="MatchList" Relationship="Self.FK_MatchList_Tournaments" FromRole="Tournaments" ToRole="MatchList" />
           <NavigationProperty Name="TeamsList" Relationship="Self.FK_TeamsList_Tournaments" FromRole="Tournaments" ToRole="TeamsList" />
+          <NavigationProperty Name="TournamentsResults" Relationship="Self.FK_TournamentsResults_Tournaments" FromRole="Tournaments" ToRole="TournamentsResults" />
+        </EntityType>
+        <EntityType Name="TournamentsResults">
+          <Key>
+            <PropertyRef Name="ID" />
+          </Key>
+          <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="IDTournament" Type="Int32" Nullable="false" />
+          <Property Name="Name" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
+          <NavigationProperty Name="Tournaments" Relationship="Self.FK_TournamentsResults_Tournaments" FromRole="TournamentsResults" ToRole="Tournaments" />
         </EntityType>
         <EntityType Name="Users">
           <Key>
@@ -491,6 +532,18 @@
           <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="false" Nullable="false" />
           <NavigationProperty Name="Persons" Relationship="Self.FK_Users_Persons" FromRole="Users" ToRole="Persons" />
         </EntityType>
+        <Association Name="FK_MapsGame_Games">
+          <End Role="Games" Type="Self.Games" Multiplicity="1" />
+          <End Role="MapsGame" Type="Self.MapsGame" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Games">
+              <PropertyRef Name="ID" />
+            </Principal>
+            <Dependent Role="MapsGame">
+              <PropertyRef Name="IDGame" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_Tournaments_Games">
           <End Role="Games" Type="Self.Games" Multiplicity="1" />
           <End Role="Tournaments" Type="Self.Tournaments" Multiplicity="*" />
@@ -527,18 +580,6 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="FK_MatchesResults_TeamsList">
-          <End Role="TeamsList" Type="Self.TeamsList" Multiplicity="1" />
-          <End Role="MatchesResults" Type="Self.MatchesResults" Multiplicity="*" />
-          <ReferentialConstraint>
-            <Principal Role="TeamsList">
-              <PropertyRef Name="ID" />
-            </Principal>
-            <Dependent Role="MatchesResults">
-              <PropertyRef Name="IDTeamList" />
-            </Dependent>
-          </ReferentialConstraint>
-        </Association>
         <Association Name="FK_MatchList_Tournaments">
           <End Role="Tournaments" Type="Self.Tournaments" Multiplicity="1" />
           <End Role="MatchList" Type="Self.MatchList" Multiplicity="*" />
@@ -635,10 +676,22 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_TournamentsResults_Tournaments">
+          <End Role="Tournaments" Type="Self.Tournaments" Multiplicity="1" />
+          <End Role="TournamentsResults" Type="Self.TournamentsResults" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Tournaments">
+              <PropertyRef Name="ID" />
+            </Principal>
+            <Dependent Role="TournamentsResults">
+              <PropertyRef Name="IDTournament" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <EntityContainer Name="CybersportTournamentEntities" annotation:LazyLoadingEnabled="true">
           <EntitySet Name="Games" EntityType="Self.Games" />
+          <EntitySet Name="MapsGame" EntityType="Self.MapsGame" />
           <EntitySet Name="Match" EntityType="Self.Match" />
-          <EntitySet Name="MatchesResults" EntityType="Self.MatchesResults" />
           <EntitySet Name="MatchList" EntityType="Self.MatchList" />
           <EntitySet Name="Persons" EntityType="Self.Persons" />
           <EntitySet Name="Players" EntityType="Self.Players" />
@@ -649,7 +702,12 @@
           <EntitySet Name="Teams" EntityType="Self.Teams" />
           <EntitySet Name="TeamsList" EntityType="Self.TeamsList" />
           <EntitySet Name="Tournaments" EntityType="Self.Tournaments" />
+          <EntitySet Name="TournamentsResults" EntityType="Self.TournamentsResults" />
           <EntitySet Name="Users" EntityType="Self.Users" />
+          <AssociationSet Name="FK_MapsGame_Games" Association="Self.FK_MapsGame_Games">
+            <End Role="Games" EntitySet="Games" />
+            <End Role="MapsGame" EntitySet="MapsGame" />
+          </AssociationSet>
           <AssociationSet Name="FK_Tournaments_Games" Association="Self.FK_Tournaments_Games">
             <End Role="Games" EntitySet="Games" />
             <End Role="Tournaments" EntitySet="Tournaments" />
@@ -662,10 +720,6 @@
             <End Role="Match" EntitySet="Match" />
             <End Role="RoundsList" EntitySet="RoundsList" />
           </AssociationSet>
-          <AssociationSet Name="FK_MatchesResults_TeamsList" Association="Self.FK_MatchesResults_TeamsList">
-            <End Role="TeamsList" EntitySet="TeamsList" />
-            <End Role="MatchesResults" EntitySet="MatchesResults" />
-          </AssociationSet>
           <AssociationSet Name="FK_MatchList_Tournaments" Association="Self.FK_MatchList_Tournaments">
             <End Role="Tournaments" EntitySet="Tournaments" />
             <End Role="MatchList" EntitySet="MatchList" />
@@ -698,15 +752,19 @@
             <End Role="Tournaments" EntitySet="Tournaments" />
             <End Role="TeamsList" EntitySet="TeamsList" />
           </AssociationSet>
+          <AssociationSet Name="FK_TournamentsResults_Tournaments" Association="Self.FK_TournamentsResults_Tournaments">
+            <End Role="Tournaments" EntitySet="Tournaments" />
+            <End Role="TournamentsResults" EntitySet="TournamentsResults" />
+          </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="Хранилище gr692_kmeModelContainer" CdmEntityContainer="CybersportTournamentEntities">
+        <EntityContainerMapping StorageEntityContainer="Хранилище CybersportTournamentsModelContainer" CdmEntityContainer="CybersportTournamentEntities">
           <EntitySetMapping Name="Games">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Games">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Games">
               <MappingFragment StoreEntitySet="Games">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="Name" ColumnName="Name" />
@@ -715,28 +773,30 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="Match">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Match">
-              <MappingFragment StoreEntitySet="Match">
+          <EntitySetMapping Name="MapsGame">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.MapsGame">
+              <MappingFragment StoreEntitySet="MapsGame">
                 <ScalarProperty Name="ID" ColumnName="ID" />
+                <ScalarProperty Name="IDGame" ColumnName="IDGame" />
                 <ScalarProperty Name="Name" ColumnName="Name" />
-                <ScalarProperty Name="Time" ColumnName="Time" />
-                <ScalarProperty Name="Period" ColumnName="Period" />
-                <ScalarProperty Name="Result" ColumnName="Result" />
+                <ScalarProperty Name="Image" ColumnName="Image" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <EntitySetMapping Name="MatchesResults">
-            <EntityTypeMapping TypeName="gr692_kmeModel.MatchesResults">
-              <MappingFragment StoreEntitySet="MatchesResults">
+          <EntitySetMapping Name="Match">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Match">
+              <MappingFragment StoreEntitySet="Match">
+                <ScalarProperty Name="Number" ColumnName="Number" />
                 <ScalarProperty Name="ID" ColumnName="ID" />
-                <ScalarProperty Name="IDTeamList" ColumnName="IDTeamList" />
                 <ScalarProperty Name="Name" ColumnName="Name" />
+                <ScalarProperty Name="Time" ColumnName="Time" />
+                <ScalarProperty Name="Period" ColumnName="Period" />
+                <ScalarProperty Name="Result" ColumnName="Result" />
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="MatchList">
-            <EntityTypeMapping TypeName="gr692_kmeModel.MatchList">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.MatchList">
               <MappingFragment StoreEntitySet="MatchList">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDMatch" ColumnName="IDMatch" />
@@ -745,7 +805,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="Persons">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Persons">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Persons">
               <MappingFragment StoreEntitySet="Persons">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="SecondName" ColumnName="SecondName" />
@@ -757,7 +817,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="Players">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Players">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Players">
               <MappingFragment StoreEntitySet="Players">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDPerson" ColumnName="IDPerson" />
@@ -767,7 +827,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="PlayersList">
-            <EntityTypeMapping TypeName="gr692_kmeModel.PlayersList">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.PlayersList">
               <MappingFragment StoreEntitySet="PlayersList">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDPlayer" ColumnName="IDPlayer" />
@@ -776,8 +836,9 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="Rounds">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Rounds">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Rounds">
               <MappingFragment StoreEntitySet="Rounds">
+                <ScalarProperty Name="Result" ColumnName="Result" />
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="Name" ColumnName="Name" />
                 <ScalarProperty Name="Period" ColumnName="Period" />
@@ -785,7 +846,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="RoundsList">
-            <EntityTypeMapping TypeName="gr692_kmeModel.RoundsList">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.RoundsList">
               <MappingFragment StoreEntitySet="RoundsList">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDRound" ColumnName="IDRound" />
@@ -794,7 +855,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="sysdiagrams">
-            <EntityTypeMapping TypeName="gr692_kmeModel.sysdiagrams">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.sysdiagrams">
               <MappingFragment StoreEntitySet="sysdiagrams">
                 <ScalarProperty Name="name" ColumnName="name" />
                 <ScalarProperty Name="principal_id" ColumnName="principal_id" />
@@ -805,7 +866,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="Teams">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Teams">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Teams">
               <MappingFragment StoreEntitySet="Teams">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="Name" ColumnName="Name" />
@@ -814,7 +875,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="TeamsList">
-            <EntityTypeMapping TypeName="gr692_kmeModel.TeamsList">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.TeamsList">
               <MappingFragment StoreEntitySet="TeamsList">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDTournament" ColumnName="IDTournament" />
@@ -824,7 +885,7 @@
             </EntityTypeMapping>
           </EntitySetMapping>
           <EntitySetMapping Name="Tournaments">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Tournaments">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Tournaments">
               <MappingFragment StoreEntitySet="Tournaments">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDGame" ColumnName="IDGame" />
@@ -834,8 +895,17 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="TournamentsResults">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.TournamentsResults">
+              <MappingFragment StoreEntitySet="TournamentsResults">
+                <ScalarProperty Name="ID" ColumnName="ID" />
+                <ScalarProperty Name="IDTournament" ColumnName="IDTournament" />
+                <ScalarProperty Name="Name" ColumnName="Name" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
           <EntitySetMapping Name="Users">
-            <EntityTypeMapping TypeName="gr692_kmeModel.Users">
+            <EntityTypeMapping TypeName="CybersportTournamentsModel.Users">
               <MappingFragment StoreEntitySet="Users">
                 <ScalarProperty Name="ID" ColumnName="ID" />
                 <ScalarProperty Name="IDPerson" ColumnName="IDPerson" />

+ 29 - 27
CybersportTournament/CybersportTournamentModel.edmx.diagram

@@ -4,33 +4,35 @@
   <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
-      <Diagram DiagramId="b4646898ac884620a420dce1c9fb96e4" Name="Diagram1" ZoomLevel="83">
-        <EntityTypeShape EntityType="gr692_kmeModel.Games" Width="1.5" PointX="0.75" PointY="5.25" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Match" Width="1.5" PointX="3" PointY="10.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.MatchesResults" Width="1.5" PointX="7.5" PointY="3.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.MatchList" Width="1.5" PointX="5.25" PointY="6.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Persons" Width="1.5" PointX="7.75" PointY="8.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Players" Width="1.5" PointX="10" PointY="7.375" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.PlayersList" Width="1.5" PointX="12.25" PointY="4.125" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Rounds" Width="1.5" PointX="3" PointY="13.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.RoundsList" Width="1.5" PointX="5.25" PointY="10.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.sysdiagrams" Width="1.5" PointX="7.75" PointY="13" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Teams" Width="1.5" PointX="3" PointY="0.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.TeamsList" Width="1.5" PointX="5.25" PointY="3.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Tournaments" Width="1.5" PointX="3" PointY="6.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="gr692_kmeModel.Users" Width="1.5" PointX="10" PointY="10.25" IsExpanded="true" />
-        <AssociationConnector Association="gr692_kmeModel.FK_Tournaments_Games" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_MatchList_Match" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_RoundsList_Match" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_MatchesResults_TeamsList" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_MatchList_Tournaments" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_Players_Persons" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_Users_Persons" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_PlayersList_Players" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_PlayersList_Teams" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_RoundsList_Rounds" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_TeamsList_Teams" ManuallyRouted="false" />
-        <AssociationConnector Association="gr692_kmeModel.FK_TeamsList_Tournaments" ManuallyRouted="false" />
+      <Diagram DiagramId="f63be43c751644e1ab2561022016819b" Name="Diagram1">
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Games" Width="1.5" PointX="0.75" PointY="5.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.MapsGame" Width="1.5" PointX="3" PointY="3.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Match" Width="1.5" PointX="3" PointY="10.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.MatchList" Width="1.5" PointX="5.25" PointY="6.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Persons" Width="1.5" PointX="7.75" PointY="2.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Players" Width="1.5" PointX="10" PointY="1.125" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.PlayersList" Width="1.5" PointX="12.25" PointY="1" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Rounds" Width="1.5" PointX="3" PointY="15.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.RoundsList" Width="1.5" PointX="5.25" PointY="9.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.sysdiagrams" Width="1.5" PointX="7.75" PointY="6.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Teams" Width="1.5" PointX="3" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.TeamsList" Width="1.5" PointX="5.25" PointY="3.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Tournaments" Width="1.5" PointX="3" PointY="6.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.TournamentsResults" Width="1.5" PointX="5.25" PointY="12.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="CybersportTournamentsModel.Users" Width="1.5" PointX="10" PointY="4" IsExpanded="true" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_MapsGame_Games" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_Tournaments_Games" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_MatchList_Match" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_RoundsList_Match" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_MatchList_Tournaments" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_Players_Persons" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_Users_Persons" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_PlayersList_Players" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_PlayersList_Teams" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_RoundsList_Rounds" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_TeamsList_Teams" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_TeamsList_Tournaments" ManuallyRouted="false" />
+        <AssociationConnector Association="CybersportTournamentsModel.FK_TournamentsResults_Tournaments" ManuallyRouted="false" />
       </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 33 - 0
CybersportTournament/ElementsWindows/GameWindow.xaml

@@ -0,0 +1,33 @@
+<Window x:Class="CybersportTournament.ElementsWindows.GameWindow"
+        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:CybersportTournament.ElementsWindows"
+        mc:Ignorable="d"
+        Title="GameWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
+    <Grid>
+        <Button Name="BackButton" Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
+        <Label Content="Название:" HorizontalAlignment="Left" Margin="140,176,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <Label Name="Name" HorizontalAlignment="Left" Margin="322,176,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Image Name="Logo" HorizontalAlignment="Left" Margin="1129,133,0,0" Width="150" Height="150" VerticalAlignment="Top"/>
+        <DataGrid Name="TournamentsList" AutoGenerateColumns="False" Height="500" Margin="0,314,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
+                   RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="PlayersListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
+            <DataGrid.Columns>
+                <DataGridTextColumn Binding="{Binding Name}" Header="Tournament"  Width="500" IsReadOnly="True"/>
+                <DataGridTemplateColumn Header="Logo" Width="500">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <Image Source="{Binding Logo}" Height="150"/>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+            </DataGrid.Columns>
+        </DataGrid>
+    </Grid>
+</Window>

+ 51 - 0
CybersportTournament/ElementsWindows/GameWindow.xaml.cs

@@ -0,0 +1,51 @@
+using System.IO;
+using System.Windows;
+using System.Windows.Media.Imaging;
+using CybersportTournament.ListWindows;
+using ConnectionClass;
+using System.Linq;
+namespace CybersportTournament.ElementsWindows
+{
+    /// <summary>
+    /// Логика взаимодействия для GameWindow.xaml
+    /// </summary>
+    public partial class GameWindow : Window
+    {
+        Games game;
+        public GameWindow(int id)
+        {
+            InitializeComponent();
+            game = Connection.db.Games.Where(item => item.ID == id).FirstOrDefault();
+            Name.Content = game.Name;
+            Logo.Source = NewImage(game);
+            TournamentsList.ItemsSource = Connection.db.Tournaments.Where(item => item.IDGame == id).ToList();
+        }
+
+        private void BackButtonClick(object sender, RoutedEventArgs e)
+        {
+            GamesListWindow glw = new GamesListWindow();
+            glw.Show();
+            this.Close();
+        }
+
+        private BitmapImage NewImage(Games game)
+        {
+            #region Декодирование картинки из бд
+            MemoryStream ms = new MemoryStream(game.Logo);
+            BitmapImage image = new BitmapImage();
+            image.BeginInit();
+            image.StreamSource = ms;
+            image.EndInit();
+            return image;
+            #endregion
+        }
+
+        private void PlayersListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((Tournaments)TournamentsList.SelectedItem).ID;
+            //TournamentWindow tw = new TournamentWindow(id);
+            //tw.Show();
+            this.Hide();
+        }
+    }
+}

+ 38 - 0
CybersportTournament/ElementsWindows/MatchWindow.xaml

@@ -0,0 +1,38 @@
+<Window x:Class="CybersportTournament.ElementsWindows.MatchWindow"
+        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:CybersportTournament.ElementsWindows"
+        mc:Ignorable="d"
+        Title="MatchWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
+    <Grid>
+        <Button Name="BackButton" Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
+        <Label Content="Название:" HorizontalAlignment="Left" Margin="493,80,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <Label Name="Name" HorizontalAlignment="Left" Margin="674,80,0,0" VerticalAlignment="Top" Height="60" Width="600" FontSize="36" Foreground="#FF54E4FF"/>
+        <Label Content="Время:" HorizontalAlignment="Left" Margin="112,176,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <Label Name="Time" HorizontalAlignment="Left" Margin="294,176,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Label Content="Длительность:" HorizontalAlignment="Right" Margin="0,176,564,0" VerticalAlignment="Top" Height="60" Width="248" Foreground="White" FontSize="36"/>
+        <Label Name="Period" HorizontalAlignment="Right" Margin="0,176,112,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Label Content="Команда 1:" HorizontalAlignment="Left" Margin="98,272,0,0" VerticalAlignment="Top" Height="60" Width="194" Foreground="White" FontSize="36"/>
+        <Label Name="Team1" HorizontalAlignment="Left" Margin="294,272,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Label Content="Команда 2:" HorizontalAlignment="Right" Margin="0,272,564,0" VerticalAlignment="Top" Height="60" Width="195" Foreground="White" FontSize="36"/>
+        <Label Name="Team2" HorizontalAlignment="Right" Margin="0,272,112,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Label Content="Результат:" HorizontalAlignment="Left" Margin="493,368,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <Label Name="Result" HorizontalAlignment="Left" Margin="676,368,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <DataGrid Name="RoundsList" AutoGenerateColumns="False" Height="295" Margin="0,455,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
+                   RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="RoundsListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
+            <DataGrid.Columns>
+                <DataGridTextColumn Binding="{Binding Rounds.Name}" Header="Tournament"  Width="500" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Rounds.Period}" Header="Period"  Width="500" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Rounds.Result}" Header="Result"  Width="250" IsReadOnly="True"/>
+            </DataGrid.Columns>
+        </DataGrid>
+        <Button Name="AddRound" Content="Добавить раунд" HorizontalAlignment="Center" Margin="0,787,0,0" VerticalAlignment="Top" Height="39" Width="220" FontSize="25" Click="AddRoundClick"/>
+    </Grid>
+</Window>

+ 52 - 0
CybersportTournament/ElementsWindows/MatchWindow.xaml.cs

@@ -0,0 +1,52 @@
+using ConnectionClass;
+using CybersportTournament.AddWindows;
+using System.Linq;
+using System.Windows;
+
+namespace CybersportTournament.ElementsWindows
+{
+    /// <summary>
+    /// Логика взаимодействия для MatchWindow.xaml
+    /// </summary>
+    public partial class MatchWindow : Window
+    {
+        Match match;
+        public MatchWindow(int id)
+        {
+            InitializeComponent();
+            match = Connection.db.Match.Where(item => item.ID == id).FirstOrDefault();
+            Name.Content = match.Name;
+            Time.Content = match.Time;
+            Period.Content = match.Period;
+            int numberList = match.Number;
+            int idTournament = Connection.db.MatchList.Where(item => item.IDMatch == id).Select(item => item.IDTournament).FirstOrDefault();
+            int firstTeamID = Connection.db.TeamsList.Where(item => item.IDTournament == idTournament && item.NumberTeamList == numberList).Select(item => item.IDTeam).FirstOrDefault();
+            int secondTeamID = Connection.db.TeamsList.Where(item => item.IDTournament == idTournament && item.NumberTeamList == numberList && item.IDTeam != firstTeamID).Select(item => item.IDTeam).FirstOrDefault();
+            Team1.Content = Connection.db.Teams.Where(item => item.ID == firstTeamID).Select(item => item.Name).FirstOrDefault();
+            Team2.Content = Connection.db.Teams.Where(item => item.ID == secondTeamID).Select(item => item.Name).FirstOrDefault();
+            RoundsList.ItemsSource = Connection.db.RoundsList.Where(item => item.IDMatch == id).ToList();
+        }
+
+        private void BackButtonClick(object sender, RoutedEventArgs e)
+        {
+            MainWindow mw = new MainWindow();
+            mw.Show();
+            this.Close();
+        }
+
+        private void RoundsListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((Match)RoundsList.SelectedItem).ID;
+            MatchWindow mw = new MatchWindow(id);
+            mw.Show();
+            this.Hide();
+        }
+
+        private void AddRoundClick(object sender, RoutedEventArgs e)
+        {
+            AddRoundWindow arw = new AddRoundWindow(match.ID);
+            arw.Show();
+            this.Close();
+        }
+    }
+}

+ 8 - 6
CybersportTournament/ElementsWindows/PlayerWindow.xaml

@@ -7,16 +7,18 @@
         mc:Ignorable="d"
         Title="PlayerWindow"  Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
     <Grid>
-        <Button Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
+        <Button Name="BackButton" Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <Label Content="Фамилия:" HorizontalAlignment="Left" Margin="140,122,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <Label Name="SecondName" HorizontalAlignment="Left" Margin="140,181,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36"/>
+        <Label Name="SecondName" HorizontalAlignment="Left" Margin="140,181,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
         <Label Content="Имя:" HorizontalAlignment="Left" Margin="140,263,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <Label Name="FirstName" HorizontalAlignment="Left" Margin="140,324,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36"/>
+        <Label Name="FirstName" HorizontalAlignment="Left" Margin="140,324,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
         <Label Content="Отчество:" HorizontalAlignment="Left" Margin="140,406,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <Label Name="MiddleName" HorizontalAlignment="Left" Margin="140,467,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36"/>
+        <Label Name="MiddleName" HorizontalAlignment="Left" Margin="140,467,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
         <Label Content="Ник:" HorizontalAlignment="Left" Margin="140,549,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <Label Name="Nickname" HorizontalAlignment="Left" Margin="140,610,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36"/>
+        <Label Name="Nickname" HorizontalAlignment="Left" Margin="140,610,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
         <Label Content="Команда:" HorizontalAlignment="Left" Margin="140,692,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
-        <Label Name="Team" HorizontalAlignment="Left" Margin="140,753,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36"/>
+        <Label Name="Team" HorizontalAlignment="Left" Margin="140,753,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Image Name="Photo" HorizontalAlignment="Left" Margin="1033,192,0,0" Width="500" Height="500" VerticalAlignment="Top"/>
+        <Image Name="TeamLogo" HorizontalAlignment="Left" Margin="654,671,0,0" Width="150" Height="150" VerticalAlignment="Top"/>
     </Grid>
 </Window>

+ 47 - 11
CybersportTournament/ElementsWindows/PlayerWindow.xaml.cs

@@ -1,16 +1,9 @@
-using System;
-using System.Collections.Generic;
+using CybersportTournament.ListWindows;
 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 ConnectionClass;
 using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
+using System.IO;
 
 namespace CybersportTournament.ElementsWindows
 {
@@ -19,9 +12,52 @@ namespace CybersportTournament.ElementsWindows
     /// </summary>
     public partial class PlayerWindow : Window
     {
-        public PlayerWindow()
+        Players player;
+        Persons person;
+        Teams team;
+        public PlayerWindow(int playerID)
         {
             InitializeComponent();
+            player = Connection.db.Players.Where(item => item.ID == playerID).FirstOrDefault();
+            person = Connection.db.Persons.Where(item => item.ID == player.IDPerson).FirstOrDefault();
+            team = Connection.db.PlayersList.Where(item => item.IDPlayer == player.ID).Select(item => item.Teams).FirstOrDefault();
+
+            SecondName.Content = person.SecondName;
+            FirstName.Content = person.FirstName;
+            MiddleName.Content = person.MiddleName;
+            Nickname.Content = player.Nickname;
+            Photo.Source = NewImage(player);
+            Team.Content = team.Name;
+            TeamLogo.Source = NewImage(team);
+        }
+
+        private void BackButtonClick(object sender, RoutedEventArgs e)
+        {
+            PlayersListWindow plw = new PlayersListWindow();
+            plw.Show();
+            this.Close();
+        }
+
+        private BitmapImage NewImage(Players player)
+        {
+            #region Декодирование картинки из бд
+            MemoryStream ms = new MemoryStream(player.Photo);
+            BitmapImage image = new BitmapImage();
+            image.BeginInit();
+            image.StreamSource = ms;
+            image.EndInit();
+            return image;
+        }
+
+        private BitmapImage NewImage(Teams team)
+        {
+            MemoryStream ms = new MemoryStream(team.Logo);
+            BitmapImage image = new BitmapImage();
+            image.BeginInit();
+            image.StreamSource = ms;
+            image.EndInit();
+            return image;
+            #endregion
         }
     }
 }

+ 33 - 0
CybersportTournament/ElementsWindows/TeamWindow.xaml

@@ -0,0 +1,33 @@
+<Window x:Class="CybersportTournament.ElementsWindows.TeamWindow"
+        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:CybersportTournament.ElementsWindows"
+        mc:Ignorable="d"
+        Title="TeamWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
+    <Grid>
+        <Button Name="BackButton" Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
+        <Label Content="Название:" HorizontalAlignment="Left" Margin="140,176,0,0" VerticalAlignment="Top" Height="60" Width="180" Foreground="White" FontSize="36"/>
+        <Label Name="Name" HorizontalAlignment="Left" Margin="322,176,0,0" VerticalAlignment="Top" Height="60" Width="450" FontSize="36" Foreground="#FF54E4FF"/>
+        <Image Name="Logo" HorizontalAlignment="Left" Margin="1129,133,0,0" Width="150" Height="150" VerticalAlignment="Top"/>
+        <DataGrid Name="PlayersList" AutoGenerateColumns="False" Height="500" Margin="0,314,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
+                   RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="PlayersListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
+            <DataGrid.Columns>
+                <DataGridTextColumn Binding="{Binding Players.Nickname}" Header="Player"  Width="500" IsReadOnly="True"/>
+                <DataGridTemplateColumn Header="Logo" Width="500">
+                    <DataGridTemplateColumn.CellTemplate>
+                        <DataTemplate>
+                            <Image Source="{Binding Players.Photo}" Height="150"/>
+                        </DataTemplate>
+                    </DataGridTemplateColumn.CellTemplate>
+                </DataGridTemplateColumn>
+            </DataGrid.Columns>
+        </DataGrid>
+    </Grid>
+</Window>

+ 53 - 0
CybersportTournament/ElementsWindows/TeamWindow.xaml.cs

@@ -0,0 +1,53 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Windows;
+using System.Windows.Media.Imaging;
+using ConnectionClass;
+using CybersportTournament.ListWindows;
+
+namespace CybersportTournament.ElementsWindows
+{
+    /// <summary>
+    /// Логика взаимодействия для TeamWindow.xaml
+    /// </summary>
+    public partial class TeamWindow : Window
+    {
+        Teams team;
+        public TeamWindow(int id)
+        {
+            InitializeComponent();
+            team = Connection.db.Teams.Where(item => item.ID == id).FirstOrDefault();
+            Name.Content = team.Name;
+            Logo.Source = NewImage(team);
+            PlayersList.ItemsSource = Connection.db.PlayersList.Where(item => item.IDTeam == id).ToList();
+        }
+
+        private void BackButtonClick(object sender, RoutedEventArgs e)
+        {
+            TeamsListWindow tlw = new TeamsListWindow();
+            tlw.Show();
+            this.Close();
+        }
+
+        private BitmapImage NewImage(Teams team)
+        {
+            #region Декодирование картинки из бд
+            MemoryStream ms = new MemoryStream(team.Logo);
+            BitmapImage image = new BitmapImage();
+            image.BeginInit();
+            image.StreamSource = ms;
+            image.EndInit();
+            return image;
+            #endregion
+        }
+
+        private void PlayersListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((PlayersList)PlayersList.SelectedItem).IDPlayer;
+            PlayerWindow pw = new PlayerWindow(id);
+            pw.Show();
+            this.Hide();
+        }
+    }
+}

+ 64 - 0
CybersportTournament/ElementsWindows/TournamentWindow.xaml

@@ -0,0 +1,64 @@
+<Window x:Class="CybersportTournament.ElementsWindows.TournamentWindow"
+        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:CybersportTournament.ElementsWindows"
+        mc:Ignorable="d"
+        Title="TournamentWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
+    <Grid Margin="0,0,0,0">
+        <Button Name="BackButton" Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
+        <Label Content="Название:" HorizontalAlignment="Left" Margin="129,88,0,0" VerticalAlignment="Top" Height="45" Width="131" Foreground="White" FontSize="25"/>
+        <Label Name="Name" HorizontalAlignment="Left" Margin="264,88,0,0" VerticalAlignment="Top" Height="45" Width="450" FontSize="25" Foreground="#FF54E4FF"/>
+        <Label Content="Игра:" HorizontalAlignment="Left" Margin="183,158,0,0" VerticalAlignment="Top" Height="45" Width="77" Foreground="White" FontSize="25"/>
+        <Label Name="Game" HorizontalAlignment="Left" Margin="262,158,0,0" VerticalAlignment="Top" Height="45" Width="450" FontSize="25" Foreground="#FF54E4FF"/>
+        <Label Content="Призовой фонд:" HorizontalAlignment="Left" Margin="758,158,0,0" VerticalAlignment="Top" Height="45" Width="206" Foreground="White" FontSize="25"/>
+        <Label Name="PrizeFund" HorizontalAlignment="Right" Margin="0,158,183,0" VerticalAlignment="Top" Height="45" Width="450" FontSize="25" Foreground="#FF54E4FF"/>
+        <Image Name="Logo" HorizontalAlignment="Left" Margin="984,34,0,0" Width="540" Height="93" VerticalAlignment="Top"/>
+        <Label Name="FMatchFTeam" Content="" HorizontalAlignment="Left" Margin="78,270,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+               Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0 75,0 75,30 150,30" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,292,0,0"/>
+        <Label Name="FMatchSTeam" Content="" HorizontalAlignment="Left" Margin="78,330,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+               Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,30 75,30 75,0 150,0" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,322,0,0"/>
+        <Label x:Name="SMatchFTeam" Content="" HorizontalAlignment="Left" Margin="78,390,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0, 75,0 75,30, 150,30" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,412,0,0"/>
+        <Label x:Name="SMatchSTeam" Content="" HorizontalAlignment="Left" Margin="78,450,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,30, 75,30 75,0, 150,0" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,442,0,0"/>
+        <Label x:Name="TMatchFTeam" Content="" HorizontalAlignment="Left" Margin="78,510,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0, 75,0 75,30, 150,30" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,532,0,0"/>
+        <Label x:Name="TMatchSTeam" Content="" HorizontalAlignment="Left" Margin="78,570,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,30, 75,30 75,0 150,0" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,562,0,0"/>
+        <Label x:Name="FoMatchFTeam" Content="" HorizontalAlignment="Left" Margin="78,630,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0, 75,0 75,30 150,30" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,652,0,0"/>
+        <Label x:Name="FoMatchSTeam" Content="" HorizontalAlignment="Left" Margin="78,690,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,30, 75,30 75,0 150,0" Height="30" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,682,0,0"/>
+        <Label x:Name="FiMatchFTeam" Content="" HorizontalAlignment="Left" Margin="480,300,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0, 75,0 75,60 150,60" Height="60" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="732,322,0,0"/>
+        <Label x:Name="FiMatchSTeam" Content="" HorizontalAlignment="Left" Margin="480,0,0,0" VerticalAlignment="Center" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,60, 75,60 75,0 150,0" Height="60" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="732,382,0,0"/>
+        <Label x:Name="SiMatchFTeam" Content="" HorizontalAlignment="Left" Margin="480,540,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0, 75,0 75,60 150,60" Height="60" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="732,562,0,0"/>
+        <Label x:Name="SiMatchSTeam" Content="" HorizontalAlignment="Left" Margin="480,660,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,60, 75,60 75,0 150,0" Height="60" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="732,622,0,0"/>
+        <Label x:Name="SeMatchFTeam" Content="" HorizontalAlignment="Left" Margin="883,360,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,0, 75,0 75,120 150,120" Height="120" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="1135,382,0,0"/>
+        <Label x:Name="SeMatchSTeam" Content="" HorizontalAlignment="Left" Margin="883,600,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+        <Polyline Stroke="White" Points="0,120,75,120 75,0 150,0" Height="120" Width="150" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="1135,502,0,0"/>
+        <Label x:Name="Winner" Content="" HorizontalAlignment="Left" Margin="1286,480,0,0" VerticalAlignment="Top" Width="250" Height="45" FontSize="25" 
+            Foreground="#FF54E4FF" HorizontalContentAlignment="Center"/>
+
+    </Grid>
+</Window>

+ 53 - 0
CybersportTournament/ElementsWindows/TournamentWindow.xaml.cs

@@ -0,0 +1,53 @@
+using System.IO;
+using System.Linq;
+using System.Windows;
+using System.Windows.Media.Imaging;
+using ConnectionClass;
+using CybersportTournament.ListWindows;
+
+namespace CybersportTournament.ElementsWindows
+{
+    /// <summary>
+    /// Логика взаимодействия для TournamentWindow.xaml
+    /// </summary>
+    public partial class TournamentWindow : Window
+    {
+        Tournaments tournament;
+        public TournamentWindow(int id)
+        {
+            InitializeComponent();
+            tournament = Connection.db.Tournaments.Where(item => item.ID == id).FirstOrDefault();
+            Name.Content = tournament.Name;
+            Game.Content = tournament.Games.Name;
+            PrizeFund.Content = tournament.PrizeFund;
+            Logo.Source = NewImage(tournament);
+            if (Connection.db.TeamsList.Where(item => item.IDTournament == tournament.ID).Select(item => item.NumberTeamList).Contains(1))
+            {
+                FMatchFTeam.Content = Connection.db.TeamsList.Where(item => item.IDTournament == tournament.ID && item.NumberTeamList == 1).Select(item => item.Teams.Name).FirstOrDefault();
+                int firstTeamID = Connection.db.TeamsList.Where(item => item.IDTournament == tournament.ID && item.NumberTeamList == 1).Select(item => item.IDTeam).FirstOrDefault();
+                FMatchSTeam.Content = Connection.db.TeamsList.Where(item => item.IDTournament == tournament.ID && item.NumberTeamList == 1 
+                                                                    && item.IDTeam != firstTeamID).Select(item => item.Teams.Name).FirstOrDefault();
+
+            }
+        }
+
+        private void BackButtonClick(object sender, RoutedEventArgs e)
+        {
+            TournamentsListWindow mw = new TournamentsListWindow();
+            mw.Show();
+            this.Close();
+        }
+
+        private BitmapImage NewImage(Tournaments tournament)
+        {
+            #region Декодирование картинки из бд
+            MemoryStream ms = new MemoryStream(tournament.Logo);
+            BitmapImage image = new BitmapImage();
+            image.BeginInit();
+            image.StreamSource = ms;
+            image.EndInit();
+            return image;
+            #endregion
+        }
+    }
+}

+ 3 - 0
CybersportTournament/Games.cs

@@ -17,6 +17,7 @@ namespace CybersportTournament
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public Games()
         {
+            this.MapsGame = new HashSet<MapsGame>();
             this.Tournaments = new HashSet<Tournaments>();
         }
     
@@ -26,6 +27,8 @@ namespace CybersportTournament
         public byte[] Logo { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<MapsGame> MapsGame { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<Tournaments> Tournaments { get; set; }
     }
 }

+ 5 - 0
CybersportTournament/ListWindows/GamesListWindow.xaml

@@ -10,6 +10,11 @@
         <Button Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <DataGrid Name="GamesList" AutoGenerateColumns="False" Height="600" Margin="0,158,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
                    RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="PlayersListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
             <DataGrid.Columns>
                 <DataGridTextColumn Binding="{Binding Name}" Header="GamesList" Width="300" IsReadOnly="True"/>
                 <DataGridTemplateColumn Header="Logo" Width="500">

+ 12 - 8
CybersportTournament/ListWindows/GamesListWindow.xaml.cs

@@ -1,6 +1,7 @@
 using ConnectionClass;
 using System.Linq;
 using System.Windows;
+using CybersportTournament.ElementsWindows;
 
 namespace CybersportTournament.ListWindows
 {
@@ -13,8 +14,7 @@ namespace CybersportTournament.ListWindows
         {
             InitializeComponent();
 
-            var result = (from Game in Connection.db.Games select new { Name = Game.Name, Logo = Game.Logo }).ToList();
-            GamesList.ItemsSource = result;
+            GamesList.ItemsSource = Connection.db.Games.ToList();
         }
 
         private void BackButtonClick(object sender, RoutedEventArgs e)
@@ -41,17 +41,21 @@ namespace CybersportTournament.ListWindows
         {
             if (Search.Text != "" && Search.Text != "Поиск")
             {
-                var result = (from Game in Connection.db.Games where Game.Name.Contains(Search.Text) select new { Name = Game.Name, Logo = Game.Logo }).ToList();
-
-                GamesList.ItemsSource = result;
+                GamesList.ItemsSource = Connection.db.Games.Where(item => item.Name.Contains(Search.Text)).ToList();
             }
             else if (Search.Text == "" || Search.Text == "Поиск")
             {
-                var result = (from Game in Connection.db.Games select new { Name = Game.Name, Logo = Game.Logo }).ToList();
-
-                GamesList.ItemsSource = result;
+                GamesList.ItemsSource = Connection.db.Games.ToList();
             }
             #endregion
         }
+
+        private void PlayersListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((Games)GamesList.SelectedItem).ID;
+            GameWindow gw = new GameWindow(id);
+            gw.Show();
+            this.Hide();
+        }
     }
 }

+ 18 - 2
CybersportTournament/ListWindows/MatchesListWindow.xaml

@@ -5,8 +5,24 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:CybersportTournament.ListWindows"
         mc:Ignorable="d"
-        Title="MatchesListWindow" Height="450" Width="800">
+        Title="MatchesListWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
     <Grid>
-        
+        <Button Name="BackButton" Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
+        <DataGrid Name="MatchesList" AutoGenerateColumns="False" Height="600" Margin="0,158,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
+                   RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="MatchesListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
+            <DataGrid.Columns>
+                <DataGridTextColumn Binding="{Binding Name}" Header="Name"  Width="600" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Time}" Header="Time" Width="300" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Period}" Header="Period" Width="250" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Result}" Header="Result" Width="150" IsReadOnly="True"/>
+            </DataGrid.Columns>
+        </DataGrid>
+        <TextBox Name="Search" HorizontalAlignment="Center" Margin="0,99,0,0" TextWrapping="Wrap" Text="Поиск" VerticalAlignment="Top" Width="1340" Height="30" FontSize="20" 
+                 Foreground="#FF675B5B" PreviewMouseLeftButtonUp="SearchPreviewMouseLeftButtonUp" LostFocus="SearchLostFocus" TextChanged="SearchTextChanged"/>
     </Grid>
 </Window>

+ 45 - 11
CybersportTournament/ListWindows/MatchesListWindow.xaml.cs

@@ -1,16 +1,7 @@
-using System;
-using System.Collections.Generic;
+using ConnectionClass;
 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;
+using CybersportTournament.ElementsWindows;
 
 namespace CybersportTournament.ListWindows
 {
@@ -22,6 +13,49 @@ namespace CybersportTournament.ListWindows
         public MatchesListWindow()
         {
             InitializeComponent();
+
+            MatchesList.ItemsSource = Connection.db.Match.ToList();
+        }
+
+        private void BackButtonClick(object sender, RoutedEventArgs e)
+        {
+            MainWindow mw = new MainWindow();
+            mw.Show();
+            this.Close();
+        }
+
+        private void SearchPreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            #region Поиск
+            if (Search.Text == "Поиск")
+                Search.Text = "";
+        }
+
+        private void SearchLostFocus(object sender, RoutedEventArgs e)
+        {
+            if (Search.Text == "")
+                Search.Text = "Поиск";
+        }
+
+        private void SearchTextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
+        {
+            if (Search.Text != "" && Search.Text != "Поиск")
+            {
+                MatchesList.ItemsSource = Connection.db.Match.Where(item => (item.Name + " " + item.Time + " " + item.Period + " " + item.Result).Contains(Search.Text)).ToList();
+            }
+            else if (Search.Text == "" || Search.Text == "Поиск")
+            {
+                MatchesList.ItemsSource = Connection.db.Match.ToList();
+            }
+            #endregion
+        }
+
+        private void MatchesListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((Match)MatchesList.SelectedItem).ID;
+            MatchWindow mw = new MatchWindow(id);
+            mw.Show();
+            this.Hide();
         }
     }
 }

+ 5 - 0
CybersportTournament/ListWindows/PlayersListWindow.xaml

@@ -10,6 +10,11 @@
         <Button Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <DataGrid Name="PlayersList" AutoGenerateColumns="False" Height="600" Margin="0,158,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
                    RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="PlayersListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
             <DataGrid.Columns>
                 <DataGridTextColumn Binding="{Binding FirstName}" Header="FirstName" Width="200" IsReadOnly="True"/>
                 <DataGridTextColumn Binding="{Binding SecondName}" Header="SecondName"  Width="200" IsReadOnly="True"/>

+ 13 - 0
CybersportTournament/ListWindows/PlayersListWindow.xaml.cs

@@ -1,6 +1,8 @@
 using ConnectionClass;
 using System.Linq;
 using System.Windows;
+using CybersportTournament.ElementsWindows;
+using System;
 
 namespace CybersportTournament.ListWindows
 {
@@ -22,6 +24,7 @@ namespace CybersportTournament.ListWindows
                           join PlayerID in Connection.db.PlayersList on Player.ID equals PlayerID.IDPlayer
                           select new
                           {
+                              Id = Player.ID,
                               FirstName = Person.FirstName,
                               SecondName = Person.SecondName,
                               MiddleName = Person.MiddleName,
@@ -99,5 +102,15 @@ namespace CybersportTournament.ListWindows
             }
             #endregion
         }
+
+        private void PlayersListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int startIndex = PlayersList.SelectedItem.ToString().IndexOfAny("Id = ".ToCharArray()) + 6;
+            int lastIndex = PlayersList.SelectedItem.ToString().IndexOf(",");
+            int id = Convert.ToInt32(PlayersList.SelectedItem.ToString().Substring(startIndex, lastIndex - startIndex));
+            PlayerWindow pw = new PlayerWindow(id);
+            pw.Show();
+            this.Hide();
+        }
     }
 }

+ 8 - 3
CybersportTournament/ListWindows/TeamsListWindow.xaml

@@ -10,13 +10,18 @@
         <Button Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <DataGrid Name="TeamList" AutoGenerateColumns="False" Height="600" Margin="0,158,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
                    RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="TeamListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
             <DataGrid.Columns>
-                <DataGridTextColumn Binding="{Binding Name}" Header="Name" Width="200" IsReadOnly="True"/>
-                <DataGridTextColumn Binding="{Binding Player}" Header="Players"  Width="500" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Teams.Name}" Header="Name" Width="200" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Players.Nickname}" Header="Players"  Width="500" IsReadOnly="True"/>
                 <DataGridTemplateColumn Header="Logo" Width="500">
                     <DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
-                            <Image Source="{Binding Logo}" Height="150"/>
+                            <Image Source="{Binding Teams.Logo}" Height="150"/>
                         </DataTemplate>
                     </DataGridTemplateColumn.CellTemplate>
                 </DataGridTemplateColumn>

+ 12 - 34
CybersportTournament/ListWindows/TeamsListWindow.xaml.cs

@@ -1,6 +1,7 @@
 using ConnectionClass;
 using System.Linq;
 using System.Windows;
+using CybersportTournament.ElementsWindows;
 
 namespace CybersportTournament.ListWindows
 {
@@ -13,17 +14,7 @@ namespace CybersportTournament.ListWindows
         {
             InitializeComponent();
 
-            var result = (from ID in Connection.db.PlayersList
-                         join Team in Connection.db.Teams on ID.IDTeam equals Team.ID
-                         join Player in Connection.db.Players on ID.IDPlayer equals Player.ID
-                         select new
-                         {
-                             Name = Team.Name,
-                             Player = Player.Nickname,
-                             Logo = Team.Logo
-                         }).ToList();
-
-            TeamList.ItemsSource = result;
+            TeamList.ItemsSource = Connection.db.PlayersList.ToList();
         }
 
         private void BackButtonClick(object sender, RoutedEventArgs e)
@@ -50,34 +41,21 @@ namespace CybersportTournament.ListWindows
         {
             if (Search.Text != "" && Search.Text != "Поиск")
             {
-                var result = (from ID in Connection.db.PlayersList
-                              join Team in Connection.db.Teams on ID.IDTeam equals Team.ID
-                              join Player in Connection.db.Players on ID.IDPlayer equals Player.ID
-                              where Team.Name.Contains(Search.Text) || Player.Nickname.Contains(Search.Text)
-                              select new
-                              {
-                                  Name = Team.Name,
-                                  Player = Player.Nickname,
-                                  Logo = Team.Logo
-                              }).ToList();
-
-                TeamList.ItemsSource = result;
+                TeamList.ItemsSource = Connection.db.PlayersList.Where(item => (item.Teams.Name + " " + item.Players.Nickname).Contains(Search.Text)).ToList();
             }
             else if (Search.Text == "" || Search.Text == "Поиск")
             {
-                var result = (from ID in Connection.db.PlayersList
-                              join Team in Connection.db.Teams on ID.IDTeam equals Team.ID
-                              join Player in Connection.db.Players on ID.IDPlayer equals Player.ID
-                              select new
-                              {
-                                  Name = Team.Name,
-                                  Player = Player.Nickname,
-                                  Logo = Team.Logo
-                              }).ToList();
-
-                TeamList.ItemsSource = result;
+                TeamList.ItemsSource = Connection.db.PlayersList.ToList();
             }
             #endregion
         }
+
+        private void TeamListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((Teams)TeamList.SelectedItem).ID;
+            TeamWindow tw = new TeamWindow(id);
+            tw.Show();
+            this.Hide();
+        }
     }
 }

+ 8 - 3
CybersportTournament/ListWindows/TournamrntsListWindow.xaml

@@ -1,18 +1,23 @@
-<Window x:Class="CybersportTournament.ListWindows.TournamrntsListWindow"
+<Window x:Class="CybersportTournament.ListWindows.TournamentsListWindow"
         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:CybersportTournament.ListWindows"
         mc:Ignorable="d"
-        Title="TournamrntsListWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
+        Title="TournamentsListWindow" Height="900" Width="1600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize">
     <Grid>
         <Button Name="BackButton"  Content="Назад" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="39" Width="140" FontSize="25" Click="BackButtonClick"/>
         <DataGrid Name="TournamrntsList" AutoGenerateColumns="False" Height="600" Margin="0,158,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" Width="1340"
                    RowHeaderStyle="{StaticResource RowHeaderStyle}" ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}">
+            <DataGrid.ItemContainerStyle>
+                <Style TargetType="DataGridRow">
+                    <EventSetter Event="MouseDoubleClick" Handler="TournamentsListMouseDoubleClick"/>
+                </Style>
+            </DataGrid.ItemContainerStyle>
             <DataGrid.Columns>
                 <DataGridTextColumn Binding="{Binding Name}" Header="Name" Width="300" IsReadOnly="True"/>
-                <DataGridTextColumn Binding="{Binding Game}" Header="Game"  Width="300" IsReadOnly="True"/>
+                <DataGridTextColumn Binding="{Binding Games.Name}" Header="Game"  Width="300" IsReadOnly="True"/>
                 <DataGridTextColumn Binding="{Binding PrizeFund}" Header="PrizeFund"  Width="300" IsReadOnly="True"/>
                 <DataGridTemplateColumn Header="Logo" Width="400">
                     <DataGridTemplateColumn.CellTemplate>

+ 14 - 37
CybersportTournament/ListWindows/TournamrntsListWindow.xaml.cs

@@ -1,5 +1,5 @@
 using ConnectionClass;
-using System;
+using CybersportTournament.ElementsWindows;
 using System.Linq;
 using System.Windows;
 
@@ -8,23 +8,13 @@ namespace CybersportTournament.ListWindows
     /// <summary>
     /// Логика взаимодействия для TournamrntsListWindow.xaml
     /// </summary>
-    public partial class TournamrntsListWindow : Window
+    public partial class TournamentsListWindow : Window
     {
-        public TournamrntsListWindow()
+        public TournamentsListWindow()
         {
             InitializeComponent();
 
-            var result = (from Tournament in Connection.db.Tournaments
-                          join Game in Connection.db.Games on Tournament.IDGame equals Game.ID
-                          select new
-                          {
-                              Name = Tournament.Name,
-                              Game = Game.Name,
-                              PrizeFund = Tournament.PrizeFund,
-                              Logo = Tournament.Logo
-                          }).ToList();
-
-            TournamrntsList.ItemsSource = result;
+            TournamrntsList.ItemsSource = Connection.db.Tournaments.ToList();
         }
 
         private void BackButtonClick(object sender, RoutedEventArgs e)
@@ -51,34 +41,21 @@ namespace CybersportTournament.ListWindows
         {
             if (Search.Text != "" && Search.Text != "Поиск")
             {
-                var result = (from Tournament in Connection.db.Tournaments
-                              join Game in Connection.db.Games on Tournament.IDGame equals Game.ID
-                              where Tournament.Name.Contains(Search.Text) || Game.Name.Contains(Search.Text) || Tournament.PrizeFund.ToString().Contains(Search.Text)
-                              select new
-                              {
-                                  Name = Tournament.Name,
-                                  Game = Game.Name,
-                                  PrizeFund = Tournament.PrizeFund,
-                                  Logo = Tournament.Logo
-                              }).ToList();
-
-                TournamrntsList.ItemsSource = result;
+                TournamrntsList.ItemsSource = Connection.db.Tournaments.Where(item => (item.Name + " " + item.Games.Name + " " + item.PrizeFund).Contains(Search.Text)).ToList();
             }
             else if (Search.Text == "" || Search.Text == "Поиск")
             {
-                var result = (from Tournament in Connection.db.Tournaments
-                              join Game in Connection.db.Games on Tournament.IDGame equals Game.ID
-                              select new
-                              {
-                                  Name = Tournament.Name,
-                                  Game = Game.Name,
-                                  PrizeFund = Tournament.PrizeFund,
-                                  Logo = Tournament.Logo
-                              }).ToList();
-
-                TournamrntsList.ItemsSource = result;
+                TournamrntsList.ItemsSource = Connection.db.Tournaments.ToList();
             }
             #endregion
         }
+
+        private void TournamentsListMouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            int id = ((Tournaments)TournamrntsList.SelectedItem).ID;
+            TournamentWindow tw = new TournamentWindow(id);
+            tw.Show();
+            this.Hide();
+        }
     }
 }

+ 1 - 1
CybersportTournament/MainWindow.xaml.cs

@@ -88,7 +88,7 @@ namespace CybersportTournament
 
         private void TournamrntsListClick(object sender, RoutedEventArgs e)
         {
-            TournamrntsListWindow tlw = new TournamrntsListWindow();
+            TournamentsListWindow tlw = new TournamentsListWindow();
             tlw.Show();
             this.Close();
         }

+ 24 - 0
CybersportTournament/MapsGame.cs

@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Этот код создан по шаблону.
+//
+//     Изменения, вносимые в этот файл вручную, могут привести к непредвиденной работе приложения.
+//     Изменения, вносимые в этот файл вручную, будут перезаписаны при повторном создании кода.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CybersportTournament
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class MapsGame
+    {
+        public int ID { get; set; }
+        public int IDGame { get; set; }
+        public string Name { get; set; }
+        public byte[] Image { get; set; }
+    
+        public virtual Games Games { get; set; }
+    }
+}

+ 1 - 0
CybersportTournament/Match.cs

@@ -26,6 +26,7 @@ namespace CybersportTournament
         public System.DateTime Time { get; set; }
         public Nullable<System.TimeSpan> Period { get; set; }
         public string Result { get; set; }
+        public int Number { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<MatchList> MatchList { get; set; }

+ 1 - 0
CybersportTournament/Rounds.cs

@@ -23,6 +23,7 @@ namespace CybersportTournament
         public int ID { get; set; }
         public int Name { get; set; }
         public Nullable<System.TimeSpan> Period { get; set; }
+        public string Result { get; set; }
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<RoundsList> RoundsList { get; set; }

+ 0 - 8
CybersportTournament/TeamsList.cs

@@ -14,19 +14,11 @@ namespace CybersportTournament
     
     public partial class TeamsList
     {
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public TeamsList()
-        {
-            this.MatchesResults = new HashSet<MatchesResults>();
-        }
-    
         public int ID { get; set; }
         public int IDTournament { get; set; }
         public int IDTeam { get; set; }
         public int NumberTeamList { get; set; }
     
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<MatchesResults> MatchesResults { get; set; }
         public virtual Teams Teams { get; set; }
         public virtual Tournaments Tournaments { get; set; }
     }

+ 3 - 0
CybersportTournament/Tournaments.cs

@@ -19,6 +19,7 @@ namespace CybersportTournament
         {
             this.MatchList = new HashSet<MatchList>();
             this.TeamsList = new HashSet<TeamsList>();
+            this.TournamentsResults = new HashSet<TournamentsResults>();
         }
     
         public int ID { get; set; }
@@ -32,5 +33,7 @@ namespace CybersportTournament
         public virtual ICollection<MatchList> MatchList { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<TeamsList> TeamsList { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<TournamentsResults> TournamentsResults { get; set; }
     }
 }

+ 3 - 3
CybersportTournament/MatchesResults.cs

@@ -12,12 +12,12 @@ namespace CybersportTournament
     using System;
     using System.Collections.Generic;
     
-    public partial class MatchesResults
+    public partial class TournamentsResults
     {
         public int ID { get; set; }
-        public int IDTeamList { get; set; }
+        public int IDTournament { get; set; }
         public string Name { get; set; }
     
-        public virtual TeamsList TeamsList { get; set; }
+        public virtual Tournaments Tournaments { get; set; }
     }
 }