gr672_bda 4 lat temu
rodzic
commit
3235ef710f

+ 5 - 2
ProjectAnalogParus/AdminPage.xaml

@@ -2,7 +2,7 @@
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"       
       xmlns:local="clr-namespace:ProjectAnalogParus"
       mc:Ignorable="d" 
       d:DesignHeight="450" d:DesignWidth="800"
@@ -22,7 +22,9 @@
                             <DataGridTextColumn Binding="{Binding Role.NameRole}" Header="Роль" Width="2*" />
                         </DataGrid.Columns>
                     </DataGrid>
-                    <Button Content="Добавать пользователя" HorizontalAlignment="Left" Margin="10,169,0,0" VerticalAlignment="Top" Width="146" Height="26" Click="InsertUserClick"/>
+                    <Button Content="Добавить пользователя" HorizontalAlignment="Left" Margin="10,169,0,0" VerticalAlignment="Top" Width="146" Height="26" Click="InsertUserClick"/>
+                    <Button Content="Информация о пользователе" HorizontalAlignment="Left" Margin="173,169,0,0" VerticalAlignment="Top" Width="174" Height="26" Click="InfoUserClick"/>
+                   
                 </Grid>
             </TabItem>
             <TabItem Header="?">
@@ -30,5 +32,6 @@
             </TabItem>
 
         </TabControl>
+
     </Grid>
 </Page>

+ 16 - 1
ProjectAnalogParus/AdminPage.xaml.cs

@@ -20,10 +20,11 @@ namespace ProjectAnalogParus
     /// </summary>
     public partial class AdminPage : Page
     {
+        gr672_bdaEntities db = new gr672_bdaEntities();
         public AdminPage()
         {
             InitializeComponent();
-            gr672_bdaEntities db = new gr672_bdaEntities();
+           
         }
 
         private void InsertUserClick(object sender, RoutedEventArgs e)
@@ -38,5 +39,19 @@ namespace ProjectAnalogParus
             gr672_bdaEntities db = new gr672_bdaEntities();
             Usergrid.ItemsSource = db.User.ToList();
         }
+
+        private void InfoUserClick(object sender, RoutedEventArgs e)
+        {
+            User user = (User)Usergrid.SelectedItem;
+            if (user != null)
+            {
+                db.User.Select(item => item.IdUser);
+                FramePage.MainFrame.Navigate(new InfoUserPage());
+            }
+            else
+            {
+                MessageBox.Show("Пользователь не выбран");
+            }
+        }
     }
 }

+ 17 - 0
ProjectAnalogParus/InfoUserPage.xaml

@@ -0,0 +1,17 @@
+<Page x:Class="ProjectAnalogParus.InfoUserPage"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:ProjectAnalogParus"
+      mc:Ignorable="d" 
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="InfoUserPage">
+
+    <Grid>
+        <TextBox Name="txtName" HorizontalAlignment="Left" Height="23" Margin="199,49,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
+        <TextBox Name="txtFullName" HorizontalAlignment="Left" Height="23" Margin="199,98,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
+        <TextBox Name="txtPassword" HorizontalAlignment="Left" Height="23" Margin="199,146,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
+        <TextBox Name="txtRole" HorizontalAlignment="Left" Height="23" Margin="199,199,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>        
+    </Grid>
+</Page>

+ 31 - 0
ProjectAnalogParus/InfoUserPage.xaml.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace ProjectAnalogParus
+{
+    /// <summary>
+    /// Логика взаимодействия для InfoUserPage.xaml
+    /// </summary>
+    public partial class InfoUserPage : Page
+    {
+        public InfoUserPage()
+        {
+            gr672_bdaEntities db = new gr672_bdaEntities();
+            InitializeComponent();
+
+            
+        }
+    }
+}

+ 7 - 0
ProjectAnalogParus/ProjectAnalogParus.csproj

@@ -171,6 +171,9 @@
     <Compile Include="Hirer.cs">
       <DependentUpon>Model.tt</DependentUpon>
     </Compile>
+    <Compile Include="InfoUserPage.xaml.cs">
+      <DependentUpon>InfoUserPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="InsertDetailsStudentWindow.xaml.cs">
       <DependentUpon>InsertDetailsStudentWindow.xaml</DependentUpon>
     </Compile>
@@ -281,6 +284,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="InfoUserPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="InsertDetailsStudentWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>