Ejemplo 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);
        }
Ejemplo n.º 2
0
        private bool Validar()
        {
            bool paso = true;

            if (DescripciontextBox.Text == string.Empty)
            {
                ErrorProvider.SetError(DescripciontextBox, "Este Campo no puede estar vacio");
                DescripciontextBox.Focus();
                paso = false;
            }
            if (RolesBLL.ExisteDescripcion(DescripciontextBox.Text, (int)IdnumericUpDown.Value))
            {
                ErrorProvider.SetError(DescripciontextBox, "Esta Descripcion ya existe");
                DescripciontextBox.Focus();
                paso = false;
            }
            if (PermisocomboBox.Text == string.Empty)
            {
                ErrorProvider.SetError(PermisocomboBox, "Debe seleccionar un Permiso Id");
                PermisocomboBox.Focus();
                paso = false;
            }
            if (this.Detalle.Count == 0)
            {
                ErrorProvider.SetError(DetallesdataGridView, "Debe agregar un Permiso");
                DetallesdataGridView.Focus();
                paso = false;
            }

            return(paso);
        }
Ejemplo n.º 3
0
 private void RemoverButton_Click(object sender, EventArgs e)
 {
     if ((DetallesdataGridView.Rows.Count > 0) && (DetallesdataGridView.CurrentRow != null))
     {
         Detalle.RemoveAt(DetallesdataGridView.CurrentRow.Index);
         CargarGrid();
     }
     else
     {
         ErrorProvider.SetError(DetallesdataGridView, "No hay filas que remover");
         DetallesdataGridView.Focus();
     }
 }
Ejemplo n.º 4
0
        private void RemoverButton_Click(object sender, EventArgs e)
        {
            if ((DetallesdataGridView.Rows.Count > 0) && (DetallesdataGridView.CurrentRow != null))
            {
                int    total  = Convert.ToInt32(TotaltextBox.Text);
                string tiempo = DetallesdataGridView.CurrentRow.Cells[4].Value.ToString();
                total            -= Convert.ToInt32(tiempo);
                TotaltextBox.Text = Convert.ToString(total);

                Detalle.RemoveAt(DetallesdataGridView.CurrentRow.Index);
                CargarGrid();
            }
            else
            {
                ErrorProvider.SetError(DetallesdataGridView, "No hay filas para Remover");
                DetallesdataGridView.Focus();
            }
        }