예제 #1
0
 private void TxtUserID_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13) // 엔터. char없어도 된다.
     {
         Txtpassword.Focus();
     }
 }
 private void Txtuser_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13)
     {
         Txtpassword.Focus();
     }
 }
예제 #3
0
        protected bool confirmausuario()
        {
            bool valida = false;

            if (Txtpassword.Text == "TAREA0" + Funciones_Duke4.Funciones.Fun_Convierte_String_aEntrero(System.DateTime.Today.Day.ToString()) * 2 + "7788")
            {
                valida = true;
            }
            else
            {
                String  cmd = string.Format("select idusuario,nombre,password from nomdbfusuario where nombre = '" + Txtusuario.Text + "'And password = '******' and nulo=0 ");
                DataSet ds  = FuncionesSQL.Fun_Sql_Ejecutar(cmd);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    valida = true;
                }
                else
                {
                    valida = false;
                    MessageBox.Show("El usuario o la clave no está registrada", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Txtpassword.Focus();
                }
            }

            return(valida);
        }
예제 #4
0
 private void txtusername_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         Txtpassword.Focus();
     }
 }