Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. private void button_Click(object sender, RoutedEventArgs e)
  2. {
  3.  
  4. Thread thread = new Thread(GO);
  5. thread.Start();
  6. }
  7.  
  8. void GO()
  9. {
  10. Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
  11. {
  12.  
  13. using (EFContext _context = new EFContext())
  14. {
  15. var res = _context.User.FirstOrDefault(x => x.Email == Email.Text && x.Password == Password.Password);
  16. if (res != null)
  17. {
  18. MainWindow w = new MainWindow(res.Id);
  19. w.Show();
  20. this.Close();
  21. }
  22. else
  23. {
  24. IncorrectData.Visibility = Visibility.Visible;
  25. }
  26. }
  27. });
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement