Exemplo n.º 1
0
        private void picQuitar_Click(object sender, EventArgs e)
        {
            clsSujetoProcesal reg = lstDetCar.Find(i => i.NOMBRE == txtNombresSujetoProcesal.Text);

            if (reg != null)
            {
                lstDetCar.Remove(reg);

                CargarGrilla();
                txtNombresSujetoProcesal.Text   = "";
                cboIdentificacion.SelectedIndex = 0;
                txtDni.Text = "";
                cboTipoSujetoProcesal.SelectedIndex = 0;
            }
        }
Exemplo n.º 2
0
        private void picAgregar_Click(object sender, EventArgs e)
        {
            clsSujetoProcesal reg = lstDetCar.Find(i => i.NOMBRE == txtNombresSujetoProcesal.Text);

            if (txtNombresSujetoProcesal.Text == "")
            {
                MessageBox.Show("Ingrese nombres completos de sujeto procesal");
            }
            else if (cboIdentificacion.SelectedIndex == 0)
            {
                MessageBox.Show("Seleccione tipo de documento de identificación");
            }
            else if (txtDni.Text == "")
            {
                MessageBox.Show("Ingrese número de documento de identidad");
            }
            else if (txtDni.Text.Length < 8)
            {
                MessageBox.Show("Número de documento de identidad mínimo 8 números");
            }
            else if (txtDni.Text.Length > 9)
            {
                MessageBox.Show("Número de documento de identidad maxímo 9 números");
            }
            else if (cboTipoSujetoProcesal.SelectedIndex == 0)
            {
                MessageBox.Show("Seleccione tipo de sujeto procesal");
            }
            else if (reg == null)
            {
                reg         = new clsSujetoProcesal();
                reg.ID      = dgvSujetoProcesal.RowCount + 1;
                reg.NOMBRE  = txtNombresSujetoProcesal.Text.Trim();
                reg.TIPODNI = cboIdentificacion.SelectedValue.ToString();
                reg.NRODNI  = txtDni.Text.Trim();
                reg.TIPO    = cboTipoSujetoProcesal.SelectedValue.ToString();

                lstDetCar.Add(reg);

                CargarGrilla();
                txtNombresSujetoProcesal.Text   = "";
                cboIdentificacion.SelectedIndex = 0;
                txtDni.Text = "";
                cboTipoSujetoProcesal.SelectedIndex = 0;
            }
        }