Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button_Click(object sender, RoutedEventArgs e)
- {
- Thread thread = new Thread(GO);
- thread.Start();
- }
- void GO()
- {
- Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart)delegate ()
- {
- using (EFContext _context = new EFContext())
- {
- var res = _context.User.FirstOrDefault(x => x.Email == Email.Text && x.Password == Password.Password);
- if (res != null)
- {
- MainWindow w = new MainWindow(res.Id);
- w.Show();
- this.Close();
- }
- else
- {
- IncorrectData.Visibility = Visibility.Visible;
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement