예제 #1
0
        private void nome_usuario_TextBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 8)
            {
                nome_usuario_TextBox1.Text = "";
            }

            if (e.KeyChar == 13)
            {
                ConexaoOracle test = new ConexaoOracle();
                UsuarioDados Logador = new UsuarioDados(test);
                if (Logador.valida(nome_usuario_TextBox1.Text, senha_usuario_TextBox1.Text) == true)
                {
                    Tela_inicial inicio = new Tela_inicial();
                    inicio.ShowDialog();
                }
                else
                {
                    texto_login_incorreto.Text = "USUÁRIO NÃO CADASTRADO";
                };
            }
        }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     ConexaoOracle test = new ConexaoOracle();
     UsuarioDados Logador = new UsuarioDados(test);
     if (Logador.valida(nome_usuario_TextBox1.Text,senha_usuario_TextBox1.Text) == true)
     {
         Tela_inicial inicio = new Tela_inicial();
         this.Cursor = Cursors.Default;
         inicio.ShowDialog();
     }
     else if(nome_usuario_TextBox1.Text == "admin" && senha_usuario_TextBox1.Text == "admin")
     {
         Tela_inicial inicio = new Tela_inicial();
         this.Cursor = Cursors.Default;
         inicio.ShowDialog();
     }
     else
     {
         texto_login_incorreto.Text = "USUÁRIO NÃO CADASTRADO";
         this.Cursor = Cursors.Default;
     }
 }