Pārlūkot izejas kodu

Изменения Руслана

21IS02 5 mēneši atpakaļ
vecāks
revīzija
ff0f1a5c4a

+ 3 - 8
NBAManagment/NBAManagment/App.xaml.cs

@@ -1,9 +1,7 @@
-using NBAManagment.Entities;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
-using System.Data.Entity;
 using System.Linq;
 using System.Threading.Tasks;
 using System.Windows;
@@ -15,9 +13,6 @@ namespace NBAManagment
     /// </summary>
     public partial class App : Application
     {
-        public static Entities.PracticeNBAEntities Context
-        { get; set; } = new Entities.PracticeNBAEntities();
-        public static Entities.User CurrentUser = null;
+        
+    }
 }
-} 
-    

+ 1 - 1
NBAManagment/NBAManagment/Entities/NBAshka.Designer.cs

@@ -1,4 +1,4 @@
-// Создание кода T4 для модели "D:\NBAManagment\NBAManagment\NBAManagment\Entities\NBAshka.edmx" включено. 
+// Создание кода T4 для модели "C:\Users\админ\Downloads\NBATeamTest-master\nbateamtest\NBAManagment\NBAManagment\Entities\NBAshka.edmx" включено. 
 // Чтобы включить формирование кода прежних версий, измените значение свойства "Стратегия создания кода" конструктора
 // на "Legacy ObjectContext". Это свойство доступно в окне "Свойства", если модель
 // открыта в конструкторе.

+ 4 - 5
NBAManagment/NBAManagment/Entities/NBAshka.edmx

@@ -4,7 +4,7 @@
   <edmx:Runtime>
     <!-- SSDL content -->
     <edmx:StorageModels>
-      <Schema Namespace="Хранилище PracticeNBAModel" 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="Хранилище PracticeNBAModel" 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="ActionType">
           <Key>
             <PropertyRef Name="IdActionType" />
@@ -55,7 +55,7 @@
             <PropertyRef Name="IdImage" />
           </Key>
           <Property Name="IdImage" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
-          <Property Name="Image" Type="image" />
+          <Property Name="Image" Type="image" Nullable="false" />
           <Property Name="Description" Type="varchar" MaxLength="50" />
           <Property Name="NumberOfLikes" Type="int" />
           <Property Name="CreateTime" Type="datetime" />
@@ -738,8 +738,7 @@
             <End Role="User" EntitySet="User" />
           </AssociationSet>
         </EntityContainer>
-      </Schema>
-    </edmx:StorageModels>
+      </Schema></edmx:StorageModels>
     <!-- CSDL content -->
     <edmx:ConceptualModels>
       <Schema Namespace="PracticeNBAModel" 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">
@@ -801,7 +800,7 @@
             <PropertyRef Name="IdImage" />
           </Key>
           <Property Name="IdImage" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="Image1" Type="Binary" MaxLength="Max" FixedLength="false" />
+          <Property Name="Image1" Type="Binary" MaxLength="Max" FixedLength="false" Nullable="false" />
           <Property Name="Description" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
           <Property Name="NumberOfLikes" Type="Int32" />
           <Property Name="CreateTime" Type="DateTime" Precision="3" />

+ 26 - 26
NBAManagment/NBAManagment/Entities/NBAshka.edmx.diagram

@@ -4,32 +4,32 @@
   <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
     <!-- Diagram content (shape and connector positions) -->
     <edmx:Diagrams>
-      <Diagram DiagramId="a68e7452841747d49c682e47c2c6fd65" Name="Diagram1" ZoomLevel="69">
-        <EntityTypeShape EntityType="PracticeNBAModel.ActionType" Width="1.5" PointX="7.5" PointY="19.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Conference" Width="1.5" PointX="0.75" PointY="12.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Country" Width="1.5" PointX="6" PointY="5.125" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Department" Width="1.5" PointX="17.25" PointY="6.125" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Division" Width="1.5" PointX="3" PointY="12.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Gender" Width="1.5" PointX="6" PointY="1.625" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Image" Width="1.5" PointX="0.75" PointY="2.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Matchup" Width="1.5" PointX="7.5" PointY="11.375" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.MatchupDetail" Width="1.5" PointX="12.75" PointY="12.375" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.MatchupLogs" Width="1.5" PointX="9.75" PointY="15.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.MatchupType" Width="1.5" PointX="5.25" PointY="20.625" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Organization" Width="1.5" PointX="15" PointY="6" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Player" Width="1.5" PointX="8.25" PointY="0.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.PlayerInTeam" Width="1.5" PointX="10.5" PointY="12.125" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.PlayerStatistic" Width="1.5" PointX="10.5" PointY="5.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Position" Width="1.5" PointX="6" PointY="17.125" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.PostSeason" Width="1.5" PointX="7.5" PointY="8.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Quarter" Width="1.5" PointX="10.5" PointY="20.625" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Role" Width="1.5" PointX="9" PointY="23.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Season" Width="1.5" PointX="5.25" PointY="8.5" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Status" Width="1.5" PointX="5.25" PointY="22.875" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.StatusOrganization" Width="1.5" PointX="12.75" PointY="6.25" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.sysdiagrams" Width="1.5" PointX="2.75" PointY="2.75" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.Team" Width="1.5" PointX="5.25" PointY="11.625" IsExpanded="true" />
-        <EntityTypeShape EntityType="PracticeNBAModel.User" Width="1.5" PointX="11.25" PointY="0.75" IsExpanded="true" />
+      <Diagram DiagramId="a68e7452841747d49c682e47c2c6fd65" Name="Diagram1" ZoomLevel="18">
+        <EntityTypeShape EntityType="PracticeNBAModel.ActionType" Width="1.5" PointX="10.5" PointY="26.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Conference" Width="1.5" PointX="0.75" PointY="10.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Country" Width="1.5" PointX="8.25" PointY="21.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Department" Width="1.5" PointX="17.25" PointY="1.125" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Division" Width="1.5" PointX="3" PointY="10.5" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Gender" Width="1.5" PointX="8.25" PointY="18.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Image" Width="1.5" PointX="0.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Matchup" Width="1.5" PointX="10.5" PointY="5.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.MatchupDetail" Width="1.5" PointX="12.75" PointY="6.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.MatchupLogs" Width="1.5" PointX="12.75" PointY="9.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.MatchupType" Width="1.5" PointX="8.25" PointY="0.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Organization" Width="1.5" PointX="15" PointY="0.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Player" Width="1.5" PointX="10.5" PointY="19.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.PlayerInTeam" Width="1.5" PointX="10.5" PointY="14" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.PlayerStatistic" Width="1.5" PointX="7.5" PointY="8.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Position" Width="1.5" PointX="8.25" PointY="23.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.PostSeason" Width="1.5" PointX="10.5" PointY="10.375" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Quarter" Width="1.5" PointX="10.5" PointY="2.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Role" Width="1.5" PointX="11.25" PointY="28.875" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Season" Width="1.5" PointX="8.25" PointY="4.125" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Status" Width="1.5" PointX="8.25" PointY="15.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.StatusOrganization" Width="1.5" PointX="12.75" PointY="1.25" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.sysdiagrams" Width="1.5" PointX="2.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.Team" Width="1.5" PointX="5.25" PointY="9.625" IsExpanded="true" />
+        <EntityTypeShape EntityType="PracticeNBAModel.User" Width="1.5" PointX="13.5" PointY="17.875" IsExpanded="true" />
         <AssociationConnector Association="PracticeNBAModel.FK_MatchupLogs_ActionType" ManuallyRouted="false" />
         <AssociationConnector Association="PracticeNBAModel.FK_Division_Conference" ManuallyRouted="false" />
         <AssociationConnector Association="PracticeNBAModel.FK_Player_Country" ManuallyRouted="false" />

+ 1 - 1
NBAManagment/NBAManagment/MainWindow.xaml

@@ -16,7 +16,7 @@
 
         <StackPanel  Orientation="Horizontal" HorizontalAlignment="Center"  VerticalAlignment="Center" >
             <Button Content="Visitor" Style="{StaticResource ModernButton}" Click="Button_Click" Width="200"/>
-            <Button Content="Admin" Style="{StaticResource ModernButton}" Click="Btn_click_loginAdmin" Width="200" Height="50"/>
+            <Button Content="Admin" Style="{StaticResource ModernButton}" Width="200" Height="50"/>
         </StackPanel>
 
         <StackPanel  Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0 0 0 50">

+ 26 - 7
NBAManagment/NBAManagment/MainWindow.xaml.cs

@@ -1,5 +1,7 @@
-using System;
+using NBAManagment.Entities;
+using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -8,8 +10,10 @@ using System.Windows.Controls;
 using System.Windows.Data;
 using System.Windows.Documents;
 using System.Windows.Input;
+using System.Windows.Markup;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using System.Windows.Media.Media3D;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 
@@ -23,6 +27,26 @@ namespace NBAManagment
         public MainWindow()
         {
             InitializeComponent();
+
+            //var context = new PracticeNBAEntities();
+            //for (int i = 1; i <= 18; i++)
+            //{
+            //    byte[] imageBytes = File.ReadAllBytes(@"C:\Users\voxhy\OneDrive\Рабочий стол\NBATeam\Material\data\Pictures\" + i + ".jpg");
+
+            //    var image = new NBAManagment.Entities.Image
+            //    {
+            //        Image1 = imageBytes,
+            //        CreateTime = DateTime.Now,
+                    
+            //    };
+            //    context.Image.Add(image);
+            //}
+            //context.SaveChanges();
+            
+
+
+            Console.ReadLine();
+
         }
 
         private void Button_Click(object sender, RoutedEventArgs e)
@@ -32,11 +56,6 @@ namespace NBAManagment
             this.Close();
         }
 
-        private void Btn_click_loginAdmin(object sender, RoutedEventArgs e)
-        {
-            Login login = new Login();
-            login.Show();
-            this.Close();
-        }
+
     }
 }

+ 22 - 8
NBAManagment/NBAManagment/NBAManagment.csproj

@@ -44,9 +44,10 @@
     <Reference Include="System" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Data" />
-    <Reference Include="System.IdentityModel" />
+    <Reference Include="System.Drawing" />
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.Security" />
+    <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Core" />
@@ -155,11 +156,22 @@
     <Compile Include="Entities\User.cs">
       <DependentUpon>NBAshka.tt</DependentUpon>
     </Compile>
-    <Compile Include="Login.xaml.cs">
-      <DependentUpon>Login.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="PlayersMain.xaml.cs">
-      <DependentUpon>PlayersMain.xaml</DependentUpon>
+    <Compile Include="Filter\IFilter.cs" />
+    <Compile Include="Filter\IFilteredEnumerable.cs" />
+    <Compile Include="Filter\PagedEnumerable.cs" />
+    <Compile Include="Filter\PageFilter.cs" />
+    <Compile Include="MachupList.xaml.cs">
+      <DependentUpon>MachupList.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="MatchPhotoLineManger.cs" />
+    <Compile Include="Models\Season.cs" />
+    <Compile Include="Models\MatchupType.cs" />
+    <Compile Include="Models\Team.cs" />
+    <Compile Include="Models\Status.cs" />
+    <Compile Include="Models\Matchup.cs" />
+    <Compile Include="Models\Image.cs" />
+    <Compile Include="PhotosPage.xaml.cs">
+      <DependentUpon>PhotosPage.xaml</DependentUpon>
     </Compile>
     <Compile Include="TeamDetail.xaml.cs">
       <DependentUpon>TeamDetail.xaml</DependentUpon>
@@ -171,7 +183,7 @@
     <Compile Include="VisitorMenu.xaml.cs">
       <DependentUpon>VisitorMenu.xaml</DependentUpon>
     </Compile>
-    <Page Include="Login.xaml">
+    <Page Include="MachupList.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -187,7 +199,7 @@
       <DependentUpon>MainWindow.xaml</DependentUpon>
       <SubType>Code</SubType>
     </Compile>
-    <Page Include="PlayersMain.xaml">
+    <Page Include="PhotosPage.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -256,9 +268,11 @@
       <DependentUpon>NBAshka.edmx</DependentUpon>
       <LastGenOutput>NBAshka.cs</LastGenOutput>
     </Content>
+    <Resource Include="Resources\download.png" />
   </ItemGroup>
   <ItemGroup>
     <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 0 - 188
NBAManagment/NBAManagment/SourceButton.xaml

@@ -66,194 +66,6 @@
         </Setter>
     </Style>
     
-    
-    <!--<Application.Resources>-->
-        <!--Converter-->
-        <!--<converter:GameStatusConverter x:Key="GameStatusConverter"/>
-        <converter:BoolToYesNoConverter x:Key="BoolToYesNoConverter"/>-->
-
-    
-    
-        <!--ДОП СТИЛИ-->
-    
-    
-        <!--Color-->
-        <SolidColorBrush x:Key="FooterColor" Color="#FF6995C2"/>
-        <SolidColorBrush x:Key="BlueColor" Color="#FF0070C0"/>
-        <SolidColorBrush x:Key="DarkGray" Color="#FF434343"/>
-
-        <!--Style-->
-        <Style x:Key="TitleText" TargetType="TextBlock">
-            <Setter Property="Foreground" Value="Gray"/>
-            <Setter Property="FontFamily" Value="Calibri"/>
-        </Style>
-        <Style TargetType="DatePicker">
-            <Setter Property="Foreground" Value="Gray"/>
-            <Setter Property="FontFamily" Value="Calibri"/>
-        </Style>
-        <Style x:Key="NormalText" TargetType="TextBlock">
-            <Setter Property="Foreground" Value="Gray"/>
-            <Setter Property="FontFamily" Value="Microsoft Sans Serif, Arial"/>
-            <Setter Property="FontSize" Value="10pt"/>
-        </Style>
-        <Style TargetType="TextBox">
-            <Setter Property="Foreground" Value="Gray"/>
-            <Setter Property="FontFamily" Value="Microsoft Sans Serif, Arial"/>
-            <Setter Property="FontSize" Value="10pt"/>
-            <Style.Triggers>
-                <Trigger Property="IsReadOnly" Value="True">
-                    <Setter Property="Background" Value="Gray"/>
-                </Trigger>
-            </Style.Triggers>
-        </Style>
-        <Style TargetType="TextBlock" x:Key="StatusBlock" BasedOn="{StaticResource NormalText}">
-            <Setter Property="Margin" Value="5, 7"/>
-            <Setter Property="Width" Value="125"/>
-            <Setter Property="Height" Value="40"/>
-            <Setter Property="FontSize" Value="17"/>
-            <Setter Property="TextAlignment" Value="Center"/>
-            <Setter Property="Foreground" Value="White"/>
-            <Setter Property="Padding" Value="2"/>
-            <Style.Triggers>
-                <Trigger Property="Text" Value="Finished">
-                    <Setter Property="Background" Value="Gray"/>
-                </Trigger>
-                <Trigger Property="Text" Value="Running">
-                    <Setter Property="Background" Value="Red"/>
-                </Trigger>
-                <Trigger Property="Text" Value="Not start">
-                    <Setter Property="Background" Value="{StaticResource BlueColor}"/>
-                </Trigger>
-            </Style.Triggers>
-        </Style>
-        <Style TargetType="Button">
-            <Setter Property="Foreground" Value="Gray"/>
-            <Setter Property="FontFamily" Value="Calibri"/>
-            <Setter Property="FontSize" Value="12pt"/>
-        </Style>
-        <Style TargetType="Button" x:Key="UserTypeButton">
-            <Setter Property="Background" Value="{StaticResource FooterColor}"/>
-            <Setter Property="Width" Value="150px"/>
-            <Setter Property="Height" Value="70px"/>
-            <Setter Property="Foreground" Value="White"/>
-            <Setter Property="FontSize" Value="32px"/>
-            <Setter Property="FontFamily" Value="Microsoft Sans Serif, Arial"/>
-        </Style>
-        <Style TargetType="Button" x:Key="NextButton">
-            <Setter Property="Foreground" Value="Gray"/>
-            <Setter Property="FontSize" Value="120px"/>
-            <Setter Property="BorderThickness" Value="0px"/>
-            <Setter Property="Background" Value="{x:Null}"/>
-            <Setter Property="FontFamily" Value="Microsoft Sans Serif, Arial"/>
-        </Style>
-        <Style TargetType="DataGridCell" x:Key="StandartCell">
-            <Setter Property="TextBlock.Foreground" Value="#FF535353"/>
-            <Setter Property="TextBlock.FontFamily" Value="Microsoft Sans Serif, Arial"/>
-            <Setter Property="TextBlock.FontSize" Value="10pt"/>
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type DataGridCell}">
-                        <Grid>
-                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                        </Grid>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-        </Style>
-        <Style x:Key="CenterTextDataGridCellStyle" TargetType="{x:Type DataGridCell}">
-            <Setter Property="Background" Value="Transparent"/>
-            <Setter Property="BorderBrush" Value="Transparent"/>
-            <Setter Property="BorderThickness" Value="1"/>
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="{x:Type DataGridCell}">
-                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
-                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                        </Border>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-            <Style.Triggers>
-                <Trigger Property="IsSelected" Value="True">
-                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
-                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
-                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
-                </Trigger>
-                <Trigger Property="IsKeyboardFocusWithin" Value="True">
-                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
-                </Trigger>
-                <MultiTrigger>
-                    <MultiTrigger.Conditions>
-                        <Condition Property="IsSelected" Value="true"/>
-                        <Condition Property="Selector.IsSelectionActive" Value="false"/>
-                    </MultiTrigger.Conditions>
-                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
-                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
-                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
-                </MultiTrigger>
-                <Trigger Property="IsEnabled" Value="false">
-                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
-                </Trigger>
-            </Style.Triggers>
-        </Style>
-        <Style x:Key="ImageButtonStyle" TargetType="Button">
-            <Setter Property="Template">
-                <Setter.Value>
-                    <ControlTemplate TargetType="Button">
-                        <ContentPresenter/>
-                    </ControlTemplate>
-                </Setter.Value>
-            </Setter>
-        </Style>
-
-        <!--ControlTemplate-->
-        <ControlTemplate x:Key="RoundButtonTemplate" TargetType="{x:Type ButtonBase}">
-            <Border x:Name="border" CornerRadius="5" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
-                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
-            </Border>
-            <ControlTemplate.Triggers>
-                <Trigger Property="Button.IsDefaulted" Value="True">
-                    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
-                </Trigger>
-                <Trigger Property="IsMouseOver" Value="True">
-                    <Setter Property="Background" TargetName="border" Value="#FFBEE6FD"/>
-                    <Setter Property="BorderBrush" TargetName="border" Value="#FF444444"/>
-                </Trigger>
-                <Trigger Property="IsPressed" Value="True">
-                    <Setter Property="Background" TargetName="border" Value="#FFC4E5F6"/>
-                    <Setter Property="BorderBrush" TargetName="border" Value="#FF444444"/>
-                </Trigger>
-                <Trigger Property="ToggleButton.IsChecked" Value="True">
-                    <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
-                    <Setter Property="BorderBrush" TargetName="border" Value="#FF444444"/>
-                </Trigger>
-                <Trigger Property="IsEnabled" Value="False">
-                    <Setter Property="Background" TargetName="border" Value="Gray"/>
-                    <Setter Property="BorderBrush" TargetName="border" Value="#FF444444"/>
-                    <Setter Property="Foreground" Value="#FF838383"/>
-                </Trigger>
-            </ControlTemplate.Triggers>
-        </ControlTemplate>
-
-        <!--DataTemplate-->
-        <DataTemplate x:Key="TeamItemTemplate">
-            <Grid>
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="30"/>
-                    <RowDefinition Height="17*"/>
-                </Grid.RowDefinitions>
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="60"/>
-                    <ColumnDefinition Width="86*"/>
-                </Grid.ColumnDefinitions>
-                <Image Source="{Binding Logo}" Grid.RowSpan="2" Margin="5"/>
-                <TextBlock Text="{Binding Name}" Style="{StaticResource NormalText}"  Grid.Column="1" Margin="5" Foreground="#FF4F4F4F"/>
-                <Grid Grid.Row="1"  Grid.Column="1">
-                    <TextBlock Text="{Binding Coach}" Grid.Column="0" Foreground="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Style="{StaticResource NormalText}" Margin="2, 5, 2, 5" FontSize="10px"/>
-                </Grid>
-            </Grid>
-        </DataTemplate>
 
-    <!--</Application.Resources>-->
 
 </ResourceDictionary>

+ 0 - 1
NBAManagment/NBAManagment/TeamDetail.xaml

@@ -229,7 +229,6 @@
                         </Grid>
                     </TabItem>
                 </TabControl>
-                <Button Content="Back" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="663,0,0,0"  Height="32" Width="95"  TextBlock.FontFamily="Century"/>
                 <Image HorizontalAlignment="Left" Height="59" Margin="12,3,0,0" VerticalAlignment="Top" Width="23" Source="/logo.jpg" Grid.RowSpan="2"/>
                 <TextBlock Text="NBA Management System" Foreground="Gray" FontFamily="Century" Margin="47,20,589,8" FontSize="10"/>
 

+ 24 - 5
NBAManagment/NBAManagment/TeamDetail.xaml.cs

@@ -21,28 +21,47 @@ namespace NBAManagment
     /// </summary>
     public partial class TeamDetail : Window
     {
+        private Team selectteam;
         public static PracticeNBAEntities DataEntitiesEmployee { get; set; }
 
         public static ObservableCollection<PlayerInTeam> ListEmployee;
 
         public static PracticeNBAEntities DataEntitiesEmploye1 { get; set; }
         public static ObservableCollection<MatchupDetail> ListEmployee1;
-        public TeamDetail()
+        public TeamDetail(Team selectteam = null)
         {
+            if (selectteam != null)
+            {
+               this.selectteam = selectteam;
+            }
             DataEntitiesEmployee = new PracticeNBAEntities();
             DataEntitiesEmploye1 = new PracticeNBAEntities();
             InitializeComponent();
             ListEmployee = new ObservableCollection<PlayerInTeam>();
             ListEmployee1 = new ObservableCollection<MatchupDetail>();
+
         }
         private void Page_Loaded(object sender, RoutedEventArgs e)
         {
-            var querryEmployee = DataEntitiesEmployee.PlayerInTeam.OrderBy(Employee => Employee.IdPlayerInTeam);
-            foreach(PlayerInTeam emp in querryEmployee)
+            if (selectteam != null)
             {
-                ListEmployee.Add(emp);
+                foreach (PlayerInTeam emp in selectteam.PlayerInTeam)
+                {
+                    ListEmployee.Add(emp);
+                }
+                DataGridEmployee.ItemsSource = ListEmployee;
             }
-            DataGridEmployee.ItemsSource = ListEmployee;
+            else
+            {
+                var querryEmployee = DataEntitiesEmployee.PlayerInTeam.OrderBy(Employee => Employee.IdPlayerInTeam);
+                foreach (PlayerInTeam emp in querryEmployee)
+                {
+                    ListEmployee.Add(emp);
+                }
+                DataGridEmployee.ItemsSource = ListEmployee;
+            }
+
+            
 
             var querryEmployee1 = DataEntitiesEmployee.MatchupDetail.OrderBy(Employee => Employee.IdMatchupDetail);
             foreach (MatchupDetail emp1 in querryEmployee1)

+ 18 - 6
NBAManagment/NBAManagment/TeamsMain.xaml.cs

@@ -49,7 +49,9 @@ namespace NBAManagment
 
         private void Hyperlink_Click(object sender, RoutedEventArgs e)
         {
-            var Roaster = (sender as Hyperlink).DataContext as Team;
+            Team Roaster = (sender as Hyperlink).DataContext as Team;
+            TeamDetail teamDetail = new TeamDetail(Roaster);
+            teamDetail.Show();
         }
 
 
@@ -65,7 +67,9 @@ namespace NBAManagment
 
         private void Hyperlink_Click_3(object sender, RoutedEventArgs e)
         {
-
+            Team Roaster = (sender as Hyperlink).DataContext as Team;
+            TeamDetail teamDetail = new TeamDetail(Roaster);
+            teamDetail.Show();
         }
 
         private void Hyperlink_Click_4(object sender, RoutedEventArgs e)
@@ -80,7 +84,9 @@ namespace NBAManagment
 
         private void Hyperlink_Click_6(object sender, RoutedEventArgs e)
         {
-
+            Team Roaster = (sender as Hyperlink).DataContext as Team;
+            TeamDetail teamDetail = new TeamDetail(Roaster);
+            teamDetail.Show();
         }
 
         private void Hyperlink_Click_7(object sender, RoutedEventArgs e)
@@ -95,7 +101,9 @@ namespace NBAManagment
 
         private void Hyperlink_Click_9(object sender, RoutedEventArgs e)
         {
-
+            Team Roaster = (sender as Hyperlink).DataContext as Team;
+            TeamDetail teamDetail = new TeamDetail(Roaster);
+            teamDetail.Show();
         }
 
         private void Hyperlink_Click_10(object sender, RoutedEventArgs e)
@@ -120,7 +128,9 @@ namespace NBAManagment
 
         private void Hyperlink_Click_14(object sender, RoutedEventArgs e)
         {
-
+            Team Roaster = (sender as Hyperlink).DataContext as Team;
+            TeamDetail teamDetail = new TeamDetail(Roaster);
+            teamDetail.Show();
         }
 
         private void Hyperlink_Click_15(object sender, RoutedEventArgs e)
@@ -135,7 +145,9 @@ namespace NBAManagment
 
         private void Hyperlink_Click_17(object sender, RoutedEventArgs e)
         {
-
+            Team Roaster = (sender as Hyperlink).DataContext as Team;
+            TeamDetail teamDetail = new TeamDetail(Roaster);
+            teamDetail.Show();
         }
 
         private void Hyperlink_Click_18(object sender, RoutedEventArgs e)

+ 4 - 6
NBAManagment/NBAManagment/VisitorMenu.xaml

@@ -21,16 +21,14 @@
 
         <!-- Main Buttons -->
         <WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
-            
             <Button Content="Teams" Style="{StaticResource ModernButton}" Width="150" Height="50" Click="Button_Click"/>
-            <Button Content="Players" Style="{StaticResource ModernButton}" Width="150" Height="50" Click="Btn_Click_Players" />
-            <Button Content="Matchups" Style="{StaticResource ModernButton}" Width="150" Height="50" />
-            <Button Content="Photos" Style="{StaticResource ModernButton}" Width="150" Height="50" />
-            
+            <Button Content="Players" Style="{StaticResource ModernButton}" Width="150" Height="50" />
+            <Button Content="Matchups" Style="{StaticResource ModernButton}" Width="150" Height="50" Click="Button_Click_2" />
+            <Button Content="Photos" Style="{StaticResource ModernButton}" Width="150" Height="50" Click="Button_ClickPhotos" />
         </WrapPanel>
 
         <!-- Back Button -->
-        <Button Content="Logout" Style="{StaticResource ModernButton}" Grid.Row="2" HorizontalAlignment="Right" Margin="10" Width="100" Height="40" Click="Button_Click_1"/>
+        <Button Content="Back" Style="{StaticResource ModernButton}" Grid.Row="2" HorizontalAlignment="Right" Margin="10" Width="100" Height="40" Click="Button_Click_1"/>
 
         <!-- Footer -->
         <StackPanel Grid.Row="3" Background="#FF0078D7" VerticalAlignment="Center">

+ 10 - 3
NBAManagment/NBAManagment/VisitorMenu.xaml.cs

@@ -39,11 +39,18 @@ namespace NBAManagment
             this.Close();
         }
 
-        private void Btn_Click_Players(object sender, RoutedEventArgs e)
+        private void Button_ClickPhotos(object sender, RoutedEventArgs e)
         {
-            PlayersMain playersMain = new PlayersMain();
-            playersMain.Show();
+            PhotosPage photosPage = new PhotosPage();
+            photosPage.Show();
             this.Close();
         }
+
+        private void Button_Click_2(object sender, RoutedEventArgs e)
+        {
+            MachupList machupList = new MachupList();
+            machupList.Show();
+            this.Close();   
+        }
     }
 }