Пример #1
0
 public void LimpiarTextBox()
 {
     //EstudiantesIdtextBox.Clear();
     NombrestextBox.Clear();
     ApellidostextBox.Clear();
     CarreratextBox.Clear();
     MatriculatextBox.Clear();
     EdadtextBox.Clear();
     DirecciontextBox.Clear();
 }
Пример #2
0
 private void Limpiar()
 {
     MatriculatextBox.Clear();
     NombreTextBox.Clear();
     SemestreTextBox.Clear();
     IndicetextBox.Clear();
     CarreraTextBox.Clear();
     TelefonomaskedTextBox.Clear();
     FechadateTimePicker.Value = DateTime.Now;
     ErrorProvider.Clear();
 }
Пример #3
0
        private bool Validar()
        {
            bool paso = true;

            if (MatriculatextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(MatriculatextBox, "No puede estar vacio");
                MatriculatextBox.Focus();
                paso = false;
            }
            if (NombreTextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(NombreTextBox, "No puede estar vacio");
                NombreTextBox.Focus();
                paso = false;
            }
            if (SemestreTextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(SemestreTextBox, "No puede estar vacio");
                SemestreTextBox.Focus();
                paso = false;
            }
            if (IndicetextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(IndicetextBox, "No puede estar vacio");
                IndicetextBox.Focus();
                paso = false;
            }
            if (CarreraTextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(CarreraTextBox, "No puede estar vacio");
                CarreraTextBox.Focus();
                paso = false;
            }
            if (TelefonomaskedTextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(TelefonomaskedTextBox, "No puede estar vacio");
                TelefonomaskedTextBox.Focus();
                paso = false;
            }

            return(paso);
        }
Пример #4
0
        private bool validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(IDnumericUpDown.Text))
            {
                MyerrorProvider.SetError(IDnumericUpDown, "El campo no debe estar vacio");
                IDnumericUpDown.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(NombretextBox.Text))
            {
                MyerrorProvider.SetError(NombretextBox, "El campo no debe estar vacio");
                NombretextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(MatriculatextBox.Text))
            {
                MyerrorProvider.SetError(MatriculatextBox, "El campo no debe estar vacio");
                MatriculatextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(EmailtextBox.Text))
            {
                MyerrorProvider.SetError(EmailtextBox, "El campo no debe estar vacio");
                EmailtextBox.Focus();
                paso = false;
            }
            if (ValidaEmail())
            {
                MyerrorProvider.SetError(EmailtextBox, "Ya existe un estudiante con este Email");
                EmailtextBox.Focus();
                paso = false;
            }
            if (!EmailValido(EmailtextBox.Text))
            {
                MyerrorProvider.SetError(EmailtextBox, "Email no valido");
                EmailtextBox.Focus();
                paso = false;
            }
            if (ValidarMatricula())
            {
                MyerrorProvider.SetError(MatriculatextBox, "Ya existe un estudiante con esta matricula");
                MatriculatextBox.Focus();
                paso = false;
            }
            if (ValidarCelular())
            {
                MyerrorProvider.SetError(CelularMaskedTextBox, "Ya existe un estudiante con este celular");
                CelularMaskedTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ApellidotextBox.Text))
            {
                MyerrorProvider.SetError(ApellidotextBox, "El campo no debe estar vacio");
                ApellidotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(DirecciontextBox.Text))
            {
                MyerrorProvider.SetError(DirecciontextBox, "El Campo no debe estar vacio");
                DirecciontextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(CelularMaskedTextBox.Text))
            {
                MyerrorProvider.SetError(CelularMaskedTextBox, "El Campo no debe estar vacio");
                CelularMaskedTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(UsuariocomboBox.Text))
            {
                MyerrorProvider.SetError(UsuariocomboBox, "El Campo no debe estar vacio");
                UsuariocomboBox.Focus();
                paso = false;
            }

            if (FechadateTimePicker.Value > DateTime.Now)
            {
                MyerrorProvider.SetError(FechadateTimePicker, "La fecha no es correcta");
                FechadateTimePicker.Focus();
                paso = false;
            }
            return(paso);
        }