private void BtnLogin_Click(object sender, RoutedEventArgs e) { HomeAdm home = new HomeAdm(); Administrador adm = new Administrador(); string senha = txtSenha.Text; adm.Login = txtLogin.Text; adm = AdministradorDAO.FindAdm(adm); if (adm != null) { if (adm.Senha == senha) { home.Show(); this.Close(); } else { MessageBox.Show("Senha incorreta"); } } else { MessageBox.Show("Login incorreto"); } }