private void EstablecerPago(EspecificarPago pago) { using (SqlConnection conexion = this.obtenerConexion()) { using (SqlCommand comando = new SqlCommand("LOS_VIAJEROS_DEL_ANONIMATO.SP_EstablecerPago", conexion)) { conexion.Open(); comando.CommandType = CommandType.StoredProcedure; comando.Parameters.Add("@numeroVoucher", SqlDbType.Int).Value = this.NroVoucher; comando.Parameters.Add("@DNI_Pago", SqlDbType.Int).Value = pago.DNI_Abonante; comando.Parameters.Add("@TipoPago", SqlDbType.NVarChar).Value = pago.tipoPago; comando.Parameters.Add("@NumeroTarjetaPago", SqlDbType.Int).Value = pago.numeroTarjeta; comando.Parameters.Add("@ClaveTarjetaPago", SqlDbType.NVarChar).Value = pago.claveTarjeta; comando.Parameters.Add("@CompaniaTarjetaPago", SqlDbType.NVarChar).Value = pago.companiaTarjeta; try { comando.ExecuteNonQuery(); } catch (SqlException ex) { this.Hide(); (new Dialogo(ex.Message, "Aceptar")).ShowDialog(); this.Show(); } } } }
private void buttonContinuar_Click(object sender, EventArgs e) { this.Hide(); // Especificar quien paga. EspecificarPago addPago = new EspecificarPago(); DialogResult dr = addPago.ShowDialog(); if (dr == DialogResult.OK) { this.EstablecerPago(addPago); (new Comprobante(this.NroVoucher)).ShowDialog(); this.Close(); } else { this.Show(); } }