public void AtribuirEstrutura(EstruturaBoleto eEstruturaBoleto) { this.Control.ID = eEstruturaBoleto.ID; this.Impresso.Valor = eEstruturaBoleto.Impresso; this.Valor.Valor = eEstruturaBoleto.Valor; this.ValorPago.Valor = eEstruturaBoleto.ValorPago; this.DataConfirmacao.Valor = eEstruturaBoleto.DataConfirmacao; this.TimeStamp.Valor = eEstruturaBoleto.DataEmissao; this.DataPagamento.Valor = eEstruturaBoleto.DataPagamento; this.DataVencimento.Valor = eEstruturaBoleto.DataVencimento; }
public void RegistraPagamento(EstruturaBoleto eEstruturaBoleto) { try { this.AtribuirEstrutura(eEstruturaBoleto); this.DataConfirmacao.Valor = DateTime.Now; StringBuilder sql = new StringBuilder(); sql.Append("UPDATE tVendaBilheteriaFormaPagamentoBoleto SET ValorPago = '@001', DataPagamento = '@002', DataConfirmacao = '@003' "); sql.Append("WHERE ID = @ID"); sql.Replace("@ID", this.Control.ID.ToString()); sql.Replace("@001", this.ValorPago.ValorBD); sql.Replace("@002", this.DataPagamento.ValorBD); sql.Replace("@003", this.DataConfirmacao.ValorBD); int x = bd.Executar(sql.ToString()); bd.Fechar(); bool result = Convert.ToBoolean(x); if (!result) { sql = new StringBuilder(); sql.Append("UPDATE tVendaBilheteriaFormaPagamentoBoletoHistorico SET ValorPago = '@001', DataPagamento = '@002', DataConfirmacao = '@003' "); sql.Append("WHERE ID = @ID"); sql.Replace("@ID", this.Control.ID.ToString()); sql.Replace("@001", this.ValorPago.ValorBD); sql.Replace("@002", this.DataPagamento.ValorBD); sql.Replace("@003", this.DataConfirmacao.ValorBD); x = bd.Executar(sql.ToString()); result = Convert.ToBoolean(x); bd.Fechar(); } this.VerificaPagamentoTotal(); } catch (Exception ex) { throw ex; } finally { bd.Fechar(); } }