Prechádzať zdrojové kódy

Окно клиенты и кнопка выход

gr672_lii 5 rokov pred
rodič
commit
79fb074696

+ 23 - 0
CopyCenter/ClientsWindow.xaml

@@ -0,0 +1,23 @@
+<Window x:Class="CopyCenter.ClientsWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:CopyCenter"
+        mc:Ignorable="d"
+        Title="Клиенты" Height="450" Width="800">
+    <Grid>
+        <DataGrid Name="ClientList" AutoGenerateColumns="False">
+            <DataGrid.Columns>
+                <DataGridTextColumn Header="Наименование" Binding="{Binding NameClient}"></DataGridTextColumn>
+                <DataGridTextColumn Header="Тип клиента" Binding="{Binding TypeClient}"></DataGridTextColumn>
+            </DataGrid.Columns>
+        </DataGrid>
+        <Button Content="" HorizontalAlignment="Right" Margin="0,369,10,0" VerticalAlignment="Top" Width="45" Click="Exit_Click" Height="40">
+            <Button.Background>
+                <ImageBrush ImageSource="exit_PNG29.png"/>
+            </Button.Background>
+        </Button>
+        
+    </Grid>
+</Window>

+ 36 - 0
CopyCenter/ClientsWindow.xaml.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace CopyCenter
+{
+    /// <summary>
+    /// Логика взаимодействия для ClientsWindow.xaml
+    /// </summary>
+    public partial class ClientsWindow : Window
+    {
+        gr672_liiEntities db = new gr672_liiEntities();
+        public ClientsWindow()
+        {
+            InitializeComponent();
+            ClientList.ItemsSource = db.Client.ToList();
+        }
+
+        private void Exit_Click(object sender, RoutedEventArgs e)
+        {
+            MenuWindow mw = new MenuWindow();
+            mw.Show();
+            this.Close();
+        }
+    }
+}

+ 7 - 0
CopyCenter/CopyCenter.csproj

@@ -76,6 +76,9 @@
     <Compile Include="Client.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
+    <Compile Include="ClientsWindow.xaml.cs">
+      <DependentUpon>ClientsWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Discount.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
@@ -117,6 +120,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="ClientsWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="MenuWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 1 - 1
CopyCenter/MenuWindow.xaml

@@ -16,7 +16,7 @@
             <Button Content="Заказы" Width="120" Height="30" Margin="5,0,30,35" Background="DarkOrange" FontSize="14" FontFamily="Century Gothic" Foreground="White" Click="Orders"/>
             <Button Content="Услуги" Width="120" Height="30" Margin="5,0,30,35" Background="DarkOrange" FontSize="14" FontFamily="Century Gothic" Foreground="White" Click="Service"/>
         </StackPanel>
-        <Button Content="" HorizontalAlignment="Right" Margin="5" VerticalAlignment="Top" Width="45" Click="Button_Click" Height="40">
+        <Button Content="" HorizontalAlignment="Right" Margin="5" VerticalAlignment="Top" Width="45" Click="Exit_Click" Height="40">
                 <Button.Background>
                 <ImageBrush ImageSource="exit_PNG29.png"/>
             </Button.Background>

+ 6 - 4
CopyCenter/MenuWindow.xaml.cs

@@ -24,16 +24,18 @@ namespace CopyCenter
             InitializeComponent();
         }
 
-        private void Button_Click(object sender, RoutedEventArgs e)
+        private void Exit_Click(object sender, RoutedEventArgs e)
         {
-            AuthorizationWindow mw = new AuthorizationWindow();
-            mw.Show();
+            AuthorizationWindow aw = new AuthorizationWindow();
+            aw.Show();
             this.Close();
         }
 
         private void Clients(object sender, RoutedEventArgs e)
         {
-
+            ClientsWindow cw = new ClientsWindow();
+            cw.Show();
+            this.Close();
         }
 
         private void Cards(object sender, RoutedEventArgs e)