Exemplo n.º 1
0
        private void btn_aceptar_Click(object sender, EventArgs e)
        {
            ClaseMultiusos cm = new ClaseMultiusos();

            try
            {
                cm.EliminarDatos("tbl_cliente_has_tbl_cuenta", "FK_id_Cuenta", txt_CodigoACambiar.Text);
                cm.ModificarDatos("tbl_cuenta", "id_cuenta=" + txtIdCuenta.Text + ", numero_de_cuenta=" + txtNumeroCuenta.Text + ", fecha_creacion='" + DtpFechaCreacion.Value.ToString("yyyy-MM-dd") + "', FK_id_tipo_cuenta=" + txt_TipoCuenta.Text + ", FK_id_empleado=" + txt_Empleado.Text + ", FK_id_agencia=" + txt_Agencia.Text + ", FK_id_moneda=" + txt_Moneda.Text, "id_cuenta", txt_CodigoACambiar.Text);
                if (banderaTipoInsertCuenta == 0)
                {
                    foreach (DataGridViewRow row in dtg_Organizacion.Rows)
                    {
                        cm.InsertarDatosAplicaciones("tbl_cliente_has_tbl_cuenta", (Convert.ToString(row.Cells[0].Value)) + "," + txtIdCuenta.Text);
                    }
                }
                else if (banderaTipoInsertCuenta == 1)
                {
                    cm.InsertarDatosAplicaciones("tbl_cliente_has_tbl_cuenta", txt_CodCliente.Text + "," + txtIdCuenta.Text);
                }
                limpiar();
                regresarAEstadoInicial();
                MessageBox.Show("Datos Modificados Exitosamente");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void btn_eliminar_Click(object sender, EventArgs e)
        {
            ClaseMultiusos cm = new ClaseMultiusos();

            try
            {
                cm.ModificarDatos("tbl_cuenta", "status = 0 ", "id_cuenta", txt_CodigoACambiar.Text);
                limpiar();
                regresarAEstadoInicial();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }