Advertisement
Guest User

Untitled

a guest
Jan 18th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. public void loginButton_Click(object sender, RoutedEventArgs e)
  2. {
  3. var dashboard = new MainWindow();
  4. dashboard.Owner = this;
  5. // dashboard.Show();
  6. // this.Hide();
  7. string user = usernameTextBox.Text;
  8. string pass = passwordTextBox.Text;
  9.  
  10.  
  11. if (string.IsNullOrEmpty(usernameTextBox.Text) &&
  12. string.IsNullOrEmpty(passwordTextBox.Text))
  13. {
  14. label3.Content = "U dient beide velden in te vullen";
  15. }
  16.  
  17. else if (string.IsNullOrEmpty(usernameTextBox.Text))
  18. {
  19. label3.Content = "U dient een gebruiksnaam in te vullen";
  20. }
  21.  
  22. else if (string.IsNullOrEmpty(passwordTextBox.Text))
  23. {
  24. label3.Content = "U dient een wachtwoord in te vullen";
  25. }
  26.  
  27. // inlog verwerking
  28. bool r = validate_login(user, pass);
  29. if (r)
  30. {
  31. // MessageBox.Show("Correct Login Credentials");
  32. var MainWindow = new MainWindow();
  33. MainWindow.hiddenTextBox.Text = user.ToString();
  34. MainWindow.Show();
  35. this.Hide();
  36. }
  37. else
  38. MessageBox.Show("Incorrect Login Credentials");
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement