private void Button_Click(object sender, RoutedEventArgs e) { Code_Error.Visibility = Visibility.Hidden; Email_Error.Visibility = Visibility.Hidden; String email = EmailTextBox.Text; String code = CodeTextBox.Password.ToString(); User u = db.loadUser(email, code); if (u != null) { if (u != null) { if (u.getCode().Substring(0, 2).Equals("99")) { Profissional next = new Profissional(u); this.NavigationService.Navigate(next); } else { Pacient next = new Pacient(u); this.NavigationService.Navigate(next); } } } else { Code_Error.Visibility = Visibility.Visible; Email_Error.Visibility = Visibility.Visible; } }
private void GoToProfissional(object sender, MouseButtonEventArgs e) { Profissional prof = new Profissional(this.user); this.NavigationService.Navigate(prof); }