Esempio n. 1
0
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(DescripciontextBox.Text))
            {
                ErrorProvider.SetError(DescripciontextBox, "Este campo no puede estar vacío");
                DescripciontextBox.Focus();
                paso = false;
            }
            if (ProyectosBLL.ExisteProyecto(DescripciontextBox.Text, (int)IdnumericUpDown.Value))
            {
                ErrorProvider.SetError(DescripciontextBox, "Este Proyecto ya existe");
                DescripciontextBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(TareacomboBox.Text))
            {
                ErrorProvider.SetError(TareacomboBox, "Debe seleccionar una Tarea");
                TareacomboBox.Focus();
                paso = false;
            }
            if (this.Detalle.Count == 0)
            {
                ErrorProvider.SetError(DetallesdataGridView, "Debe agregar una Tarea");
                DetallesdataGridView.Focus();
                paso = false;
            }

            return(paso);
        }