private void cargarPagos() { clsNegocioPago objNegocioPago = new clsNegocioPago(); try { DataSet dsPagos = objNegocioPago.consutlarPago(idVenta); dgPagos.DataSource = dsPagos.Tables[0]; } catch (Exception) { } }
private void btnGuardar_Click(object sender, EventArgs e) { try { double valor = 0; clsNegocioPago objNegocioPago = new clsNegocioPago(); if (txtValor.Text != "") { valor = double.Parse(txtValor.Text); string fechaPago = calFecha.Value.ToString("yyyy-MM-dd");; string tipoPago = ""; if (rbEfectivo.Checked) { tipoPago = "Efectivo"; } if (rbDeposito.Checked) { tipoPago = "Deposito"; } if (rbCheque.Checked) { tipoPago = "Cheque"; } if (objNegocioPago.insertarPago(idVenta, valor, idCliente, fechaPago, tipoPago)) { this.Close(); } else { MessageBox.Show("Valor ingresado es incorrecto"); } } } catch (Exception) { MessageBox.Show("No se pudo registrar el pago"); } finally { } }
private void cargarValorPagado() { clsNegocioPago objNegocioPago = new clsNegocioPago(); double totalPago = 0; try { if (lbVenta.Items.Count > 0) { int idVenta = int.Parse(lbVenta.SelectedValue.ToString()); DataSet dsPago = objNegocioPago.consutlarPago(idVenta); foreach (DataRow dr in dsPago.Tables[0].Rows) { totalPago += double.Parse(dr[1].ToString()); } } txtValorPagado.Text = totalPago.ToString(); } catch (Exception) { } }