private void btnLogar_Click(object sender, EventArgs e) { DataTableReader read = new DataTableReader(consultorio2DataSet.Usuario); bool logado = false; if (String.Compare(usuarioTextBox.Text, "") != 0 && (String.Compare(senhaTextBox.Text, "") != 0)) { while (read.Read()) { if (String.Compare(usuarioTextBox.Text, read.GetString(0)) == 0 && (String.Compare(senhaTextBox.Text, read.GetString(1)) == 0)) { logado = true; } break; } } if (logado) { frmPrincipal principal = new frmPrincipal(); principal.ShowDialog(); } else { MessageBox.Show("Login ou Senha incorretos."); } }
private void btnSair_Click(object sender, EventArgs e) { //Application.Exit(); frmPrincipal carrega = new frmPrincipal(); carrega.ShowDialog(); }
private void btnSair_Click(object sender, EventArgs e) { frmPrincipal carrega = new frmPrincipal(); carrega.ShowDialog(); }