WindowAuto.xaml.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace CatProject
  15. {
  16. /// <summary>
  17. /// Логика взаимодействия для WindowAuto.xaml
  18. /// </summary>
  19. public partial class WindowAuto : Window
  20. {
  21. public WindowAuto()
  22. {
  23. InitializeComponent();
  24. }
  25. private void Button_Click(object sender, RoutedEventArgs e)
  26. {
  27. int password = TBPassword.Password.GetHashCode();
  28. User user = BaseClass.BaseConnect.User.FirstOrDefault(x => x.Login == TBLogin.Text && x.Password == password);
  29. if (user!=null)
  30. {
  31. FrameClass.MainFrame.Navigate(new PersonalPage(user.id));
  32. }
  33. else
  34. {
  35. MessageBox.Show("Пользователь не найден");
  36. }
  37. this.Close();
  38. }
  39. }
  40. }