Example #1
0
        private void gerarBoletosBancario(AbstractBank banco)
        {
            this.banco = banco;
            try
            {
                decimal  valorBoleto     = ParseUtil.ToDecimal(txtValorBoleto.Text);
                string   nossoNumero     = txtNossoNumero.Text;
                string   numeroDocumento = txtNumeroDocumento.Text;
                string   instrucoes      = memoInstrucoes.Text.ToUpper();
                DateTime vencimento      = dtEditVencimento.DateTime;
                var      cedente         = getCedente();
                var      sacado          = getSacado();
                int      qtde            = ParseUtil.ToInt(spinEditQuantidade.Value);

                //cria os boletos
                banco.CreateBoletos(qtde, vencimento, valorBoleto,
                                    nossoNumero, numeroDocumento, cedente, sacado, instrucoes);

                //criar o layout do boleto
                pathLayout = BoletoUtil.GenerateTicketLayout(banco.BoletosBancario);

                this.boletoValidado = true;

                //BoletoUtil.ShowBoletoPDF(banco.BoletosBancario[0]);
            }
            catch (Exception ex)
            {
                this.boletoValidado = false;
                this.backgroundWorker.CancelAsync();
                Console.WriteLine(ex);
            }
        }
Example #2
0
 public Auction(Action <ApiLogMessage> logger, AbstractBank bank)
 {
     Logger    = logger;
     this.bank = bank;
     this.bank.RegisterReservedMoneyChecker(GetReservedMoney);
 }