Beispiel #1
0
        protected void btnGerarDadosPagamento_Click(object sender, EventArgs e)
        {
            BMUsuarioPagamento bmUsuarioPagamento = new BMUsuarioPagamento();

            UsuarioPagamento novoUsuarioPagamento = new UsuarioPagamento();

            novoUsuarioPagamento.Usuario = new BMUsuario().ObterPorId(int.Parse(ddlUsuario.SelectedValue));
            novoUsuarioPagamento.ConfiguracaoPagamento = new BMConfiguracaoPagamento().ObterPorID(1);
            novoUsuarioPagamento.DataInicioVigencia    = DateTime.Now;
            novoUsuarioPagamento.DataFimVigencia       = DateTime.Now.AddYears(2);
            novoUsuarioPagamento.ValorPagamento        = 15;
            novoUsuarioPagamento.DataInicioRenovacao   = DateTime.Now.AddYears(2);
            novoUsuarioPagamento.DataMaxInadimplencia  = DateTime.Now.AddMonths(2);
            novoUsuarioPagamento.PagamentoConfirmado   = false;
            novoUsuarioPagamento.PagamentoEfetuado     = false;
            novoUsuarioPagamento.FormaPagamento        = enumFormaPagamento.Boleto;
            novoUsuarioPagamento.DataAceiteTermoAdesao = DateTime.Now;
            novoUsuarioPagamento.DataVencimento        = DateTime.Now.AddDays(2);
            novoUsuarioPagamento.PagamentoEnviadoBanco = false;


            //CADASTRA O NOVO REGISTRO
            bmUsuarioPagamento.Salvar(novoUsuarioPagamento);

            //RECUPERA O NOSSO NUMERO E SALVA O REGISTRO
            novoUsuarioPagamento.NossoNumero = new BMUsuarioPagamento().GerarNossoNumero(novoUsuarioPagamento);
            bmUsuarioPagamento.Salvar(novoUsuarioPagamento);

            PreencherGrid(novoUsuarioPagamento.Usuario.ID);
        }
Beispiel #2
0
 public void SalvarInformacoesDePagamento(UsuarioPagamento usuarioPagamento)
 {
     try
     {
         bmUsuarioPagamento.Salvar(usuarioPagamento);
     }
     catch (AcademicoException ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
        protected void dgvDados_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int idPagamento = int.Parse(e.CommandArgument.ToString());

            BMUsuarioPagamento bmUsuarioPagamento = new BMUsuarioPagamento();

            UsuarioPagamento pagamento = bmUsuarioPagamento.ObterInformacoesDePagamentoPorID(idPagamento);

            if (pagamento.PagamentoConfirmado.HasValue && !pagamento.PagamentoConfirmado.Value)
            {
                pagamento.DataPagamento          = DateTime.Now;
                pagamento.PagamentoEfetuado      = true;
                pagamento.PagamentoConfirmado    = true;
                pagamento.DataPagamentoInformado = DateTime.Now;

                bmUsuarioPagamento.Salvar(pagamento);

                PreencherGrid(pagamento.Usuario.ID);
            }
        }