12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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 WPF_Entity_Examole
- {
- /// <summary>
- /// Логика взаимодействия для okno.xaml
- /// </summary>
- public partial class okno : Window
- {
- gr671_mkyuEntities i;
- public okno()
- {
- InitializeComponent();
- i = new gr671_mkyuEntities();
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- if (login.Text == "" || password.Password == "" )
- {
- MessageBox.Show("Пустые поля");
- return;
- }
- if (i.Users.Select(item => item.Login + " " + item.Password).Contains(login.Text + " " + password.Password))
- {
- MessageBox.Show("Вы авторизованы");
- MainWindow mw = new MainWindow();
- mw.Show();
- this.Close();
- }
- else
- {
- MessageBox.Show("Error");
- return;
- }
-
- }
- }
- }
|