Beispiel #1
0
 private void Limpiar()
 {
     IdnumericUpDown.Value  = 0;
     UsuariotextBox.Text    = string.Empty;
     NombretextBox.Text     = string.Empty;
     ContraseñatextBox.Text = string.Empty;
     ConfirmartextBox.Text  = string.Empty;
     NombreerrorProvider.Clear();
     UsuarioerrorProvider.Clear();
     ContrasenaerrorProvider.Clear();
     ConfirmarContrasenaerrorProvider.Clear();
 }
Beispiel #2
0
 public bool Validar()
 {
     if (string.IsNullOrEmpty(UsuariotextBox.Text) && string.IsNullOrEmpty(NombretextBox.Text) && string.IsNullOrEmpty(ContraseñatextBox.Text) && string.IsNullOrEmpty(ConfirmartextBox.Text))
     {
         UsuarioerrorProvider.SetError(UsuariotextBox, "Ingrese El Usuario");
         NombreerrorProvider.SetError(NombretextBox, "Ingrese El Nombre");
         ContrasenaerrorProvider.SetError(ContraseñatextBox, "Ingrese Una Contraseña");
         ConfirmarContrasenaerrorProvider.SetError(ConfirmartextBox, "La contraseña no coincide");
         MessageBox.Show("Debe Llenar todos los campos");
     }
     if (string.IsNullOrEmpty(NombretextBox.Text))
     {
         NombreerrorProvider.SetError(NombretextBox, "Ingrese el nombre");
         return(false);
     }
     if (string.IsNullOrEmpty(UsuariotextBox.Text))
     {
         UsuarioerrorProvider.SetError(UsuariotextBox, "Ingrese el Usuario");
         return(false);
     }
     if (string.IsNullOrEmpty(ContraseñatextBox.Text))
     {
         NombreerrorProvider.Clear();
         ContrasenaerrorProvider.SetError(ContraseñatextBox, "Ingrese contraseña");
         return(false);
     }
     if (string.IsNullOrEmpty(ConfirmartextBox.Text))
     {
         NombreerrorProvider.Clear();
         ContrasenaerrorProvider.Clear();
         ConfirmarContrasenaerrorProvider.SetError(ConfirmartextBox, "Confirmar contraseña ");
         return(false);
     }
     if (ContraseñatextBox.Text != ConfirmartextBox.Text)
     {
         NombreerrorProvider.Clear();
         ContrasenaerrorProvider.Clear();
         ConfirmarContrasenaerrorProvider.Clear();
         ConfirmarContrasenaerrorProvider.SetError(ConfirmartextBox, "La contraseña no coincide");
         return(false);
     }
     return(true);
 }
Beispiel #3
0
        public bool ValidarTexb()
        {
            if (string.IsNullOrEmpty(NombretextBox10.Text) && string.IsNullOrEmpty(ContrasenatextBox12.Text) && string.IsNullOrEmpty(ConfirmarContrasenatextBox13.Text))
            {
                NombreerrorProvider.SetError(NombretextBox10, "Ingresar el nombre");
                ContrasenaerrorProvider.SetError(ContrasenatextBox12, "Ingresar contraseña");
                ConfirmarContrasenaerrorProvider.SetError(ConfirmarContrasenatextBox13, "Confirmar contraseña");
                MessageBox.Show("Llenar todos los campos");
            }
            if (string.IsNullOrEmpty(NombretextBox10.Text))
            {
                NombreerrorProvider.SetError(NombretextBox10, "Ingrese el nombre");
                return(false);
            }
            if (string.IsNullOrEmpty(ContrasenatextBox12.Text))
            {
                NombreerrorProvider.Clear();
                ContrasenaerrorProvider.SetError(ContrasenatextBox12, "Ingrese contraseña");
                return(false);
            }
            if (string.IsNullOrEmpty(ConfirmarContrasenatextBox13.Text))
            {
                NombreerrorProvider.Clear();
                ContrasenaerrorProvider.Clear();
                ConfirmarContrasenaerrorProvider.SetError(ConfirmarContrasenatextBox13, "Confirmar contraseña");
                return(false);
            }
            if (ContrasenatextBox12.Text != ConfirmarContrasenatextBox13.Text)
            {
                NombreerrorProvider.Clear();
                ContrasenaerrorProvider.Clear();
                ConfirmarContrasenaerrorProvider.Clear();
                ConfirmarContrasenaerrorProvider.SetError(ConfirmarContrasenatextBox13, "La contraseña no coincide");
                return(false);
            }

            return(true);
        }