Exemplo n.º 1
0
        private void btnEnviar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtPregunta.Text) || string.IsNullOrWhiteSpace(txtRespuesta.Text))
            {
                MessageBox.Show("¡Hay uno o mas campos vacios!", "¡Atención!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                CtrLogin pLogin = new CtrLogin();

                int resultado = pLogin.Seguridad(txtPregunta.Text.Trim(), txtRespuesta.Text.Trim());

                if (resultado > 0)
                {
                    Habilitar2();
                    Deshabilitar2();
                }
                else
                {
                    MessageBox.Show("¡Datos incorrectos, intente nuevamente!", "¡Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtPregunta.Text = "";
                    txtRespuesta.Text = "";
                }
            }
        }