123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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 RegiAut
- {
- /// <summary>
- /// Логика взаимодействия для AuthorizationWindow.xaml
- /// </summary>
- public partial class AuthorizationWindow : Window
- {
- gr683_daaEntities db;
- public AuthorizationWindow()
- {
- InitializeComponent();
- db = new gr683_daaEntities();
- }
- private void RegistrationClick(object sender, RoutedEventArgs e)
- {
- RegistrationWindow rw = new RegistrationWindow();
- rw.Show();
- Close();
- }
- 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("Вы авторизованы");
- }
- else
- {
- MessageBox.Show("Ошибка логина/пароля");
- }
- }
- }
- }
|