Beispiel #1
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     //btn buscar
     try
     {
         String cedula = textBox1.Text;
         ServicioAntecedentesPenalesSWJavita.ciudadano ciudadano = controller.darCiudadanoPorCedula(cedula);
         if (ciudadano != null)
         {
             MessageBox.Show("El ciudadano con el DI: " + ciudadano.cedula + " con el nombre: " + ciudadano.nombre.Trim() + " " + ciudadano.apellido.Trim() + " Ha sido seleccionado");
             txtCiudad.Enabled       = true;
             txtCod.Enabled          = true;
             txtEstado.Enabled       = true;
             txtSentencia.Enabled    = true;
             dateTimePicker1.Enabled = true;
         }
         else
         {
             MessageBox.Show("El ciudadano con el DI: " + cedula + " No existe");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error! " + ex);
     }
 }
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            //btn buscar
            try
            {
                if (textBox1.Text.Trim() == "")
                {
                    MessageBox.Show("Existen valores vacíos, por favor suministre los datos necesarios");
                }
                else
                {
                    String cedula = textBox1.Text;
                    ServicioAntecedentesPenalesSWJavita.ciudadano ciudadano = controller.darCiudadanoPorCedula(cedula);
                    if (ciudadano != null)
                    {
                        txtName.Text = ciudadano.nombre.Trim();
                        txtAp.Text   = ciudadano.apellido.Trim();
                        if (ciudadano.genero)
                        {
                            radioButton1.Checked = true;
                        }
                        else
                        {
                            radioButton2.Checked = false;
                        }
                        comboBox1.SelectedIndex = ciudadano.tipoDocumento - 1;
                        dateTimePicker1.Value   = ciudadano.fechaNacimiento;

                        txtName.Enabled         = true;
                        txtAp.Enabled           = true;
                        dateTimePicker1.Enabled = true;
                        radioButton1.Enabled    = true;
                        radioButton2.Enabled    = true;
                    }
                    else
                    {
                        MessageBox.Show("El ciudadano con el DI " + cedula + " no existe");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error! " + ex);
            }
        }
Beispiel #3
0
 private void button2_Click(object sender, EventArgs e)
 {
     //btn eliminar
     try
     {
         String cedula = textBox1.Text;
         ServicioAntecedentesPenalesSWJavita.ciudadano ciudadano = controller.darCiudadanoPorCedula(cedula);
         int id = Int32.Parse(txtIDAntecedente.Text);
         if (controller.eliminarAntecedente(id))
         {
             MessageBox.Show("El antecedente del ciudadano identificado con DI: " + ciudadano.cedula + " ha sido eliminado");
             limpiar();
         }
         else
         {
             MessageBox.Show("No se eliminó correctamente el antecedente");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error!  " + ex);
     }
 }