Exemple #1
0
 private void limpiar()
 {
     TxtPass1.Clear();
     TxtPass2.Clear();
     TxtUsu.Clear();
     CboTipo.SelectedIndex = 1;
 }
 private void TxtPass1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPass2.Focus();
     }
 }
Exemple #3
0
 private void limpiar()
 {
     TxtNom.Clear();
     TxtUsu.Clear();
     TxtPass1.Clear();
     TxtPass2.Clear();
     LblId.Text = "0";
 }
Exemple #4
0
        private void BtnAgegar_Click(object sender, EventArgs e)
        {
            if (TxtPass1.Text == TxtPass2.Text)
            {
                ingreso();
            }

            else
            {
                MessageBox.Show("Las contraseñas no coinciden");
                TxtPass2.Clear();
                TxtPass1.Clear();
            }
        }
Exemple #5
0
 private void TxtPass2_TextChanged(object sender, EventArgs e)
 {
     if (TxtPass2.Text.Trim().Length > 0)
     {
         if (TxtPass1.Text != TxtPass2.Text)
         {
             errorP1.SetError(TxtPass2, "Las contraseñas no coinciden.");
             TxtPass2.Focus();
         }
         else
         {
             errorP1.SetError(TxtPass2, "");
         }
     }
 }
Exemple #6
0
        public bool ValidarUsu()
        {
            bool retorno = true;


            if (string.IsNullOrEmpty((TxtUsuario.Text)))
            {
                errorP1.SetError(TxtUsuario, "Debe ingresar el usuario.");
                TxtUsuario.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtUsuario, "");
            }

            if (string.IsNullOrEmpty((TxtPass1.Text)))
            {
                errorP1.SetError(TxtPass1, "Debe ingresar la contraseña.");
                TxtPass1.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPass1, "");
            }

            if (string.IsNullOrEmpty((TxtPass2.Text)))
            {
                errorP1.SetError(TxtPass2, "Debe confirmar la contraseña.");
                TxtPass2.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPass2, "");

                if (TxtPass1.Text != TxtPass2.Text)
                {
                    errorP1.SetError(TxtPass2, "Las contraseñas no coinciden.");
                    TxtPass2.Focus();
                    retorno = false;
                }
                else
                {
                    errorP1.SetError(TxtPass2, "");
                }
            }

            if (LueTipoUsuario.ItemIndex < 0)
            {
                errorP1.SetError(LueTipoUsuario, "Debe seleccionar un tipo de ususario.");
                LueTipoUsuario.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(LueTipoUsuario, "");
            }

            return(retorno);
        }