Example #1
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
            crud obcrud = new crud();

            if (mtb_cedula.Text == "")
            {
                MessageBox.Show("La Cedula No Puede Ir en Blanco");
                mtb_cedula.Select();
                mtb_cedula.Focus();
            }
            else
            {
                if (txt_nombre.Text == "")
                {
                    MessageBox.Show("El nombre No Puede Ir en Blanco");
                    txt_nombre.Select();
                    txt_nombre.Focus();
                }
                else
                {
                    if (txt_apellido.Text == "")
                    {
                        MessageBox.Show("El Apellido No Puede Ir en Blanco");
                        txt_apellido.Select();
                        txt_apellido.Focus();
                    }
                    else
                    {
                        if (txt_telefono.Text == "")
                        {
                            MessageBox.Show("El Telefono No Puede Ir en Blanco");
                            txt_telefono.Select();
                            txt_telefono.Focus();
                        }
                        else
                        {
                            string campos = "nombre ='" + this.txt_nombre.Text + "',apellido ='" + this.txt_apellido.Text + "',email ='" + this.txt_email.Text + "',jurisdiccion ='" + this.cbx_jurisdiccion.Text + "',telefono ='" + this.txt_telefono.Text + "',celular ='" + this.txt_celular.Text + "',juzgado ='" + this.cbx_juzgado.Text + "',fizcalia ='" + this.cbx_fiscalia.Text + "',genero ='" + this.cbx_genero.Text + "',estado_civil ='" + this.cbx_estado.Text + "'";
                            if (obcrud.actualizar("pr_jueces", campos, "cedula = '" + this.mtb_cedula.Text + "'"))
                            {
                                MessageBox.Show("Se a Actualizado Correctamente");
                            }
                            else
                            {
                                MessageBox.Show("no se pudo actualizar");
                            }
                        }
                    }
                }
            }
        }
Example #2
0
        private void btn_eliminar_Click(object sender, EventArgs e)
        {
            object celda;
            crud   obcrud = new crud();

            celda = dataGridView2.CurrentCell.Value;

            string condicion = "nombre='" + celda + "'";

            if (obcrud.actualizar("pr_terceros", "hidden = 1", condicion))
            {
                dataGridView2.Refresh();
                int fill = dataGridView2.CurrentRow.Index;
                dataGridView2.Rows.RemoveAt(fill);
            }
            else
            {
                MessageBox.Show("No Se ha Podido Eliminar, correctamente. Debe seleccionar el nombre y luego darle a Eliminar.");
            }
        }
Example #3
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
            crud obcrud = new crud();

            if (txt_costo.Text == "")
            {
                MessageBox.Show("El Costo No Puede Ir en Blanco");
                txt_costo.Select();
                txt_costo.Focus();
            }
            else
            {
                if (txt_abonos.Text == "")
                {
                    MessageBox.Show("Los Abonos No Puede Ir en Blanco");
                    txt_abonos.Select();
                    txt_abonos.Focus();
                }
                else
                {
                    if (txt_impuesto.Text == "")
                    {
                        MessageBox.Show("El impuesto No Puede Ir en Blanco");
                        txt_impuesto.Select();
                        txt_impuesto.Focus();
                    }
                    else
                    {
                        string campos = "cliente ='" + this.cbx_cliente.Text + "',abogado ='" + this.cbx_abogado.Text + "',juez ='" + this.cbx_juez.Text + "',procurador ='" + this.cbx_procurador.Text + "',razon ='" + this.cbx_razon.Text + "',costo ='" + this.txt_costo.Text + "',impuesto ='" + this.txt_impuesto.Text + "',abonos ='" + this.txt_abonos.Text + "',notas ='" + this.richTextBox1.Text + "'";
                        if (obcrud.actualizar("pr_divorcios", campos, "cliente = '" + this.cbx_cliente.Text + "'"))
                        {
                            MessageBox.Show("Se a Actualizado Correctamente");
                        }
                        else
                        {
                            MessageBox.Show("no se pudo actualizar");
                        }
                    }
                }
            }
        }
        private void btn_modificar_Click_1(object sender, EventArgs e)
        {
            crud obcrud = new crud();

            if (txt_cedula.Text == "")
            {
                MessageBox.Show("La Cedula No Puede Ir en Blanco");
                txt_cedula.Select();
                txt_cedula.Focus();
            }
            else
            {
                if (txt_nombre.Text == "")
                {
                    MessageBox.Show("El nombre No Puede Ir en Blanco");
                    txt_nombre.Select();
                    txt_nombre.Focus();
                }
                else
                {
                    if (txt_apellido.Text == "")
                    {
                        MessageBox.Show("El Apellido No Puede Ir en Blanco");
                        txt_apellido.Select();
                        txt_apellido.Focus();
                    }
                    else
                    {
                        string campos = "nombre ='" + this.txt_nombre.Text + "',apellido ='" + this.txt_apellido.Text + "',genero ='" + this.cbx_genero.Text + "',tipo_procurador ='" + this.cbx_procu_type.Text + "',procu_id ='" + this.cbx_procuraduria.Text + "'";
                        if (obcrud.actualizar("pr_procurador", campos, "cedula = '" + this.txt_cedula.Text + "'"))
                        {
                            MessageBox.Show("Se a Actualizado Correctamente");
                        }
                        else
                        {
                            MessageBox.Show("no se pudo actualizar");
                        }
                    }
                }
            }
        }
Example #5
0
        private void button5_Click(object sender, EventArgs e)
        {
            crud   obcrud = new crud();
            object celda  = dataGridView2.CurrentCell.Value;
            string campos = "cambio ='" + this.textBox1.Text + "'";

            if (obcrud.actualizar("pr_facturacion", campos, "id = '" + celda + "'"))
            {
                MessageBox.Show("Se a Actualizado Correctamente");
                dataGridView2.Rows.Clear();
                MySqlConnection cn;
                MySqlCommand    cmd;
                MySqlDataReader dr;
                try
                {
                    cn = new MySqlConnection("server=localhost;user id=root; database=proyecto3; password="******"select id, nombre, apellido, sub_total, honorarios, itbs, notario, total, efectivo, cambio from pr_facturacion where cambio <= '0'", cn);
                    dr  = cmd.ExecuteReader();

                    while (dr.Read())
                    {
                        this.dataGridView2.Rows.Add(dr.GetValue(0), dr.GetValue(1), dr.GetValue(2), dr.GetValue(3), dr.GetValue(4), dr.GetValue(5), dr.GetValue(6), dr.GetValue(7), dr.GetValue(8), dr.GetValue(9));
                    }
                    cn.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error" + ex.Message);
                }
            }
            else
            {
                MessageBox.Show("no se pudo actualizar");
            }
        }
Example #6
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
            crud obcrud = new crud();

            if (mtb_cedula.Text == "")
            {
                MessageBox.Show("La Cedula No Puede Ir en Blanco");
                mtb_cedula.Select();
                mtb_cedula.Focus();
            }
            else
            {
                if (txt_nombre.Text == "")
                {
                    MessageBox.Show("El nombre No Puede Ir en Blanco");
                    txt_nombre.Select();
                    txt_nombre.Focus();
                }
                else
                {
                    if (txt_apellido.Text == "")
                    {
                        MessageBox.Show("El Apellido No Puede Ir en Blanco");
                        txt_apellido.Select();
                        txt_apellido.Focus();
                    }
                    else
                    {
                        if (txt_telefono.Text == "")
                        {
                            MessageBox.Show("El Telefono No Puede Ir en Blanco");
                            txt_telefono.Select();
                            txt_telefono.Focus();
                        }
                        else
                        {
                            if (txt_direccion.Text == "")
                            {
                                MessageBox.Show("La Direccion No Puede Ir en Blanco");
                                txt_direccion.Select();
                                txt_direccion.Focus();
                            }
                            else
                            {
                                {
                                    if (txt_trabajo.Text == "")
                                    {
                                        MessageBox.Show("El Trabajo a Realizar No Puede Ir en Blanco");
                                        txt_trabajo.Select();
                                        txt_trabajo.Focus();
                                    }
                                    else
                                    {
                                        string campos = "nombre ='" + this.txt_nombre.Text + "',apellido ='" + this.txt_apellido.Text + "',apodo ='" + this.txt_apodo.Text + "',email ='" + this.txt_email.Text + "',contacto ='" + this.txt_contacto.Text + "',telefono ='" + this.txt_telefono.Text + "',celular ='" + this.txt_celular.Text + "',trabajo_realizar ='" + this.txt_trabajo.Text + "',direccion ='" + this.txt_direccion.Text + "',costo_servicio ='" + this.txt_costo.Text + "',empresa ='" + this.txt_empresa.Text + "',abonos ='" + this.txt_abonos.Text + "',direccion_trabajo ='" + this.txt_direc_emp.Text + "',fizcalia ='" + this.txt_fizcalia.Text + "',genero ='" + this.cbx_genero.Text + "',estado_civil ='" + this.cbx_estado.Text + "',pais ='" + this.cbx_pais.Text + "'";
                                        if (obcrud.actualizar("pr_terceros", campos, "cedula = '" + this.mtb_cedula.Text + "'"))
                                        {
                                            MessageBox.Show("Se a Actualizado Correctamente");
                                        }
                                        else
                                        {
                                            MessageBox.Show("no se pudo actualizar");
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        private void btn_eliminar_Click_1(object sender, EventArgs e)
        {
            object celda;
            crud obcrud = new crud();

            celda = dataGridView2.CurrentCell.Value;

            string condicion = "nombre='" + celda + "'";
            if (obcrud.actualizar("pr_procurador", "hidden = 1", condicion))
            {
                dataGridView2.Refresh();
                int fill = dataGridView2.CurrentRow.Index;
                dataGridView2.Rows.RemoveAt(fill);
            }
            else
            {
                MessageBox.Show("No Se ha Podido Eliminar, correctamente. Debe seleccionar el nombre y luego darle a Eliminar.");
            }
        }
        private void btn_modificar_Click_1(object sender, EventArgs e)
        {
            crud obcrud = new crud();

            if (txt_cedula.Text == "")
            {
                MessageBox.Show("La Cedula No Puede Ir en Blanco");
                txt_cedula.Select();
                txt_cedula.Focus();
            }
            else
            {

                if (txt_nombre.Text == "")
                {
                    MessageBox.Show("El nombre No Puede Ir en Blanco");
                    txt_nombre.Select();
                    txt_nombre.Focus();
                }
                else
                {
                    if (txt_apellido.Text == "")
                    {
                        MessageBox.Show("El Apellido No Puede Ir en Blanco");
                        txt_apellido.Select();
                        txt_apellido.Focus();
                    }
                    else
                    {
                        string campos = "nombre ='" + this.txt_nombre.Text + "',apellido ='" + this.txt_apellido.Text + "',genero ='" + this.cbx_genero.Text + "',tipo_procurador ='" + this.cbx_procu_type.Text + "',procu_id ='" + this.cbx_procuraduria.Text + "'";
                        if (obcrud.actualizar("pr_procurador", campos, "cedula = '" + this.txt_cedula.Text + "'"))
                        {
                            MessageBox.Show("Se a Actualizado Correctamente");
                        }
                        else
                        {
                            MessageBox.Show("no se pudo actualizar");
                        }
                    }
                }
            }
        }
Example #9
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {

            crud obcrud = new crud();

            if (mtb_cedula.Text == "")
            {
                MessageBox.Show("La Cedula No Puede Ir en Blanco");
                mtb_cedula.Select();
                mtb_cedula.Focus();
            }
            else
            {

                if (txt_nombre.Text == "")
                {
                    MessageBox.Show("El nombre No Puede Ir en Blanco");
                    txt_nombre.Select();
                    txt_nombre.Focus();
                }
                else
                {
                    if (txt_apellido.Text == "")
                    {
                        MessageBox.Show("El Apellido No Puede Ir en Blanco");
                        txt_apellido.Select();
                        txt_apellido.Focus();
                    }
                    else
                    {
                        if (txt_telefono.Text == "")
                        {
                            MessageBox.Show("El Telefono No Puede Ir en Blanco");
                            txt_telefono.Select();
                            txt_telefono.Focus();
                        }
                        else
                        {
                            if (txt_direccion.Text == "")
                            {
                                MessageBox.Show("La Direccion No Puede Ir en Blanco");
                                txt_direccion.Select();
                                txt_direccion.Focus();
                            }
                            else
                            {
                                {
                                    if (txt_trabajo.Text == "")
                                    {
                                        MessageBox.Show("El Trabajo a Realizar No Puede Ir en Blanco");
                                        txt_trabajo.Select();
                                        txt_trabajo.Focus();
                                    }
                                    else
                                    {

                                        string campos = "nombre ='" + this.txt_nombre.Text + "',apellido ='" + this.txt_apellido.Text + "',apodo ='" + this.txt_apodo.Text + "',email ='" + this.txt_email.Text + "',contacto ='" + this.txt_contacto.Text + "',telefono ='" + this.txt_telefono.Text + "',celular ='" + this.txt_celular.Text + "',trabajo_realizar ='" + this.txt_trabajo.Text + "',direccion ='" + this.txt_direccion.Text + "',costo_servicio ='" + this.txt_costo.Text + "',empresa ='" + this.txt_empresa.Text + "',abonos ='" + this.txt_abonos.Text + "',direccion_trabajo ='" + this.txt_direc_emp.Text + "',fizcalia ='" + this.cbx_fiscalia.Text + "',genero ='" + this.cbx_genero.Text + "',estado_civil ='" + this.cbx_estado.Text + "',pais ='" + this.cbx_pais.Text + "',tel_trabajo ='" + this.txt_tel_emp.Text + "', sector ='" + this.cbx_sector.Text + "',provincia ='" + this.cbx_provincia.Text + "',procurador ='" + this.cbx_procurador.Text + "',oficialia_civil ='" + this.cbx_oficialia.Text + "'";
                                        if (obcrud.actualizar("pr_clientes", campos, "cedula = '" + this.mtb_cedula.Text + "'"))
                                        {
                                            MessageBox.Show("Se a Actualizado Correctamente");
                                        }
                                        else
                                        {
                                            MessageBox.Show("no se pudo actualizar");
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }


        }
Example #10
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
            crud obcrud = new crud();

            if (mtb_cedula.Text == "")
            {
                MessageBox.Show("La Cedula No Puede Ir en Blanco");
                mtb_cedula.Select();
                mtb_cedula.Focus();
            }
            else
            {

                if (txt_nombre.Text == "")
                {
                    MessageBox.Show("El nombre No Puede Ir en Blanco");
                    txt_nombre.Select();
                    txt_nombre.Focus();
                }
                else
                {
                    if (txt_apellido.Text == "")
                    {
                        MessageBox.Show("El Apellido No Puede Ir en Blanco");
                        txt_apellido.Select();
                        txt_apellido.Focus();
                    }
                    else
                    {
                        if (txt_telefono.Text == "")
                        {
                            MessageBox.Show("El Telefono No Puede Ir en Blanco");
                            txt_telefono.Select();
                            txt_telefono.Focus();
                        }
                        else
                        {
                                        string campos = "nombre ='" + this.txt_nombre.Text + "',apellido ='" + this.txt_apellido.Text + "',email ='" + this.txt_email.Text + "',jurisdiccion ='" + this.cbx_jurisdiccion.Text + "',telefono ='" + this.txt_telefono.Text + "',celular ='" + this.txt_celular.Text + "',juzgado ='" + this.cbx_juzgado.Text + "',fizcalia ='" + this.cbx_fiscalia.Text + "',genero ='" + this.cbx_genero.Text + "',estado_civil ='" + this.cbx_estado.Text + "'";
                                        if (obcrud.actualizar("pr_jueces", campos, "cedula = '" + this.mtb_cedula.Text + "'"))
                                        {
                                            MessageBox.Show("Se a Actualizado Correctamente");
                                        }
                                        else
                                        {
                                            MessageBox.Show("no se pudo actualizar");
                                        }
                                    }
                                }
              
                }
            }
        }
Example #11
0
        private void btn_modificar_Click(object sender, EventArgs e)
        {
             crud obcrud = new crud();

            if (txt_costo.Text == "")
            {
                MessageBox.Show("El Costo No Puede Ir en Blanco");
                txt_costo.Select();
                txt_costo.Focus();
            }
            else
            {
                
            if (txt_abonos.Text == "")
            {
                MessageBox.Show("Los Abonos No Puede Ir en Blanco");
                txt_abonos.Select();
                txt_abonos.Focus();
            }
            else
            {
                if (txt_impuesto.Text == "")
                {
                    MessageBox.Show("El impuesto No Puede Ir en Blanco");
                    txt_impuesto.Select();
                    txt_impuesto.Focus();
                }
                else
                {
                    string campos = "cliente ='" + this.cbx_cliente.Text + "',abogado ='" + this.cbx_abogado.Text + "',juez ='" + this.cbx_juez.Text + "',procurador ='" + this.cbx_procurador.Text + "',razon ='" + this.cbx_razon.Text + "',costo ='" + this.txt_costo.Text + "',impuesto ='" + this.txt_impuesto.Text + "',abonos ='" + this.txt_abonos.Text + "',notas ='" + this.richTextBox1.Text + "'";
                    if (obcrud.actualizar("pr_divorcios", campos, "cliente = '" + this.cbx_cliente.Text + "'"))
                    {
                        MessageBox.Show("Se a Actualizado Correctamente");
                    }
                    else
                    {
                        MessageBox.Show("no se pudo actualizar");
                    }
                }
            }
          }
        }