Example #1
0
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider1.Clear();

            if (string.IsNullOrWhiteSpace(InscripcionId.Text))
            {
                MyErrorProvider1.SetError(InscripcionId, "El campo Direccion no puede estar vacio");
                InscripcionId.Focus();
                paso = false;
            }



            if (string.IsNullOrWhiteSpace(FechaDateTimePicker.Text))
            {
                MyErrorProvider1.SetError(FechaDateTimePicker, "El campo Fecha de nacimiento no puede estar vacio");
                FechaDateTimePicker.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(EstudianteId.Text))
            {
                MyErrorProvider1.SetError(EstudianteId, "El campo Direccion no puede estar vacio");
                EstudianteId.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ComentarioTextBox.Text))
            {
                MyErrorProvider1.SetError(ComentarioTextBox, "El campo Email no puede estar vacio");
                ComentarioTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(Monto.Text))
            {
                MyErrorProvider1.SetError(Monto, "El campo Balance no puede estar vacio");
                Monto.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(Deposito.Text))
            {
                MyErrorProvider1.SetError(Deposito, "El campo Balance no puede estar vacio");
                Deposito.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(Balance.Text))
            {
                MyErrorProvider1.SetError(Balance, "El campo Balance no puede estar vacio");
                Balance.Focus();
                paso = false;
            }


            return(paso);
        }
        private void Limpiar()
        {
            PasanteIdNumericUpDown.Value      = 0;
            FechaCreacionDateTimePicker.Value = DateTime.Now.Date;
            NombrePasanteTextBox.Clear();
            MatriculaTextBox.Clear();
            EmailTextBox.Clear();
            HorasARealizarTextBox.Clear();
            TelefonoTextBox.Clear();
            ComentarioTextBox.Clear();
            MyErrorProvider.Clear();

            this.Detalle = new List <HabilidadesDetalle>();
            CargarGrid();
        }
Example #3
0
        private bool Validar() //Validar los campos
        {
            bool paso = true;

            if (string.IsNullOrEmpty(InscripcionesIDTextBox.Text))
            {
                MessageBox.Show("El campo inscripcionesId debe estar en 0 para agregar una inscripcion");
                PersonaIdTextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrEmpty(PersonaIdTextBox.Text))
            {
                MessageBox.Show("El campo PersonaId no puede estar vacio y debe ser mayor o igual que 1");
                PersonaIdTextBox.Focus();
                paso = false;
            }

            if (ComentarioTextBox.Text == string.Empty)
            {
                MessageBox.Show("El campo comentario no puede estar vacio");
                ComentarioTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(MontoTextBox.Text))
            {
                MessageBox.Show("El campo  monto no puede estar vacio");
                BalanceTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(BalanceTextBox.Text))
            {
                MessageBox.Show("El campo balance no puede estar vacio");
                BalanceTextBox.Focus();
                paso = false;
            }

            return(paso);
        }
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(FechaDateTimePicker.Text))
            {
                MyErrorProvider.SetError(FechaDateTimePicker, "El campo Fecha no puede estar vacio");
                FechaDateTimePicker.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ComentarioTextBox.Text))
            {
                MyErrorProvider.SetError(ComentarioTextBox, "El campo Comentarios no puede estar vacio");
                ComentarioTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(MontoTextBox.Text))
            {
                MyErrorProvider.SetError(MontoTextBox, "El campo Monto no puede estar vacio");
                MontoTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(DepositoTextBox.Text))
            {
                MyErrorProvider.SetError(DepositoTextBox, "El campo Deposito no puede estar vacio");
                DepositoTextBox.Focus();
                paso = false;
            }

            return(paso);
        }