Parcourir la source

Окно авторизации 2.0

1 il y a 5 ans
Parent
commit
792a38fd42

+ 12 - 0
CopyCenter/AuthorizationWindow.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="CopyCenter.AuthorizationWindow"
+        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>
+        
+    </Grid>
+</Window>

+ 27 - 0
CopyCenter/AuthorizationWindow.xaml.cs

@@ -0,0 +1,27 @@
+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>
+    /// Логика взаимодействия для AuthorizationWindow.xaml
+    /// </summary>
+    public partial class AuthorizationWindow : Window
+    {
+        public AuthorizationWindow()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 7 - 10
CopyCenter/CopyCenter.csproj

@@ -64,6 +64,9 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="AuthorizationWindow.xaml.cs">
+      <DependentUpon>AuthorizationWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Card.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
@@ -91,11 +94,6 @@
     <Compile Include="User.cs">
       <DependentUpon>DataBase.tt</DependentUpon>
     </Compile>
-    <Page Include="Z:\ТИС\MainWindow.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-      <Link>MainWindow.xaml</Link>
-    </Page>
     <Compile Include="App.xaml.cs">
       <DependentUpon>App.xaml</DependentUpon>
       <SubType>Code</SubType>
@@ -115,11 +113,10 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>DataBase.edmx</DependentUpon>
     </Compile>
-    <Compile Include="Z:\ТИС\MainWindow.xaml.cs">
-      <DependentUpon>MainWindow.xaml</DependentUpon>
-      <SubType>Code</SubType>
-      <Link>MainWindow.xaml.cs</Link>
-    </Compile>
+    <Page Include="AuthorizationWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="MenuWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 0 - 50
CopyCenter/MainWindow.xaml.cs

@@ -1,50 +0,0 @@
-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 CopyCenter
-{
-    /// <summary>
-    /// Логика взаимодействия для MainWindow.xaml
-    /// </summary>
-    public partial class MainWindow : Window
-    {
-        gr672_liiEntities db;
-        public MainWindow()
-        {
-            InitializeComponent();
-            db = new gr672_liiEntities();
-        }
-
-        private void AuthorizationClick(object sender, RoutedEventArgs e)
-        {
-            if (login.Text == "" || password.Password == "")
-            {
-                MessageBox.Show("Введено неверное значение!");
-                return;
-            }
-            if (db.User.Select(item => item.Login + " " + item.Password).Contains(login.Text + " " + password.Password))
-            {
-                MessageBox.Show("Добро пожаловать, вы авторизированы");
-                MenuWindow mw = new MenuWindow();
-                mw.Show();
-                this.Close();
-            }
-            else
-            {
-                MessageBox.Show("Введено неверное значение логина/пароля1");
-            }
-        }
-    }
-}