示例#1
0
        private void picAgregar_Click(object sender, EventArgs e)
        {
            clsDelito reg = lstDetCar.Find(i => i.ARTICULO == txtArticulo.Text);

            if (cboTipoDelito.SelectedIndex == 0)
            {
                MessageBox.Show("Seleccione Tipo Delito");
            }
            else if (txtArticulo.Text == "")
            {
                MessageBox.Show("Ingrese artículo");
            }
            else if (txtGenerico.Text == "")
            {
                MessageBox.Show("Ingrese delito genérico");
            }
            else if (txtSubgenerico.Text == "")
            {
                MessageBox.Show("Ingrese delito subgenérico");
            }
            else if (txtEspecifico.Text == "")
            {
                MessageBox.Show("Ingrese delito específico");
            }
            else if (txtInciso.Text == "")
            {
                MessageBox.Show("Ingrese inciso del artículo citado");
            }
            else if (txtCita.Text == "")
            {
                MessageBox.Show("Ingrese cita del código penal");
            }
            else if (reg == null)
            {
                reg             = new clsDelito();
                reg.ID          = dgvDelito.RowCount + 1;
                reg.ARTICULO    = txtArticulo.Text.Trim();
                reg.GENERICO    = txtGenerico.Text.Trim();
                reg.SUBGENERICO = txtSubgenerico.Text.Trim();
                reg.ESPECIFICO  = txtEspecifico.Text.Trim();
                reg.INCISO      = txtInciso.Text.Trim();
                reg.CITA        = txtCita.Text;
                reg.TIPODELITO  = cboTipoDelito.SelectedValue.ToString();

                lstDetCar.Add(reg);

                CargarGrilla();
                txtArticulo.Text            = "";
                txtGenerico.Text            = "";
                txtSubgenerico.Text         = "";
                txtEspecifico.Text          = "";
                txtInciso.Text              = "";
                txtCita.Text                = "";
                cboTipoDelito.SelectedIndex = 0;
            }
        }
示例#2
0
        private void picQuitar_Click(object sender, EventArgs e)
        {
            clsDelito reg = lstDetCar.Find(i => i.ARTICULO == txtArticulo.Text);

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

                CargarGrilla();
                txtArticulo.Text            = "";
                txtGenerico.Text            = "";
                txtSubgenerico.Text         = "";
                txtEspecifico.Text          = "";
                txtInciso.Text              = "";
                txtCita.Text                = "";
                cboTipoDelito.SelectedIndex = 0;
            }
        }