1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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 Prakticheskaya5_Venediktov
- {
- /// <summary>
- /// Логика взаимодействия для Avtorize.xaml
- /// </summary>
- public partial class Avtorize : Page
- {
- public Avtorize()
- {
- InitializeComponent();
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- int p = PBPassword.Password.GetHashCode();
- Users UserNow = Base.database.Users.FirstOrDefault(x => x.Login == TBLogin.Text && x.Password == p);
- if (UserNow != null)
- {
- if (UserNow.ID_Role == 1)
- {
- NavigationService.Navigate(new AdminPage());
- }
- if (UserNow.ID_Role == 2)
- {
- NavigationService.Navigate(new UserPage());
- }
- }
- else
- {
- MessageBox.Show("Пользователь не найден, проверьте логин или пароль");
- }
- }
- }
- }
-
|