Ejemplo n.º 1
0
        public Pagamento()
        {
            if (!Parcelado)
            {
                _numeroDaParcela = 1;
            }

            if (DataCredito is null || DataCredito == new DateTime(1, 1, 1))
            {
                DataCredito = DataPagamento.AddDays(2);
            }
        }
Ejemplo n.º 2
0
        public void CalcularDiasEmAtraso()
        {
            if (!ContaEstaEmAtraso())
            {
                DiasEmAtraso = 0;
            }

            DiasEmAtraso = (int)DataPagamento.Subtract(DataVencimento).Days;
            if (DiasEmAtraso < 0)
            {
                DiasEmAtraso = 0;
            }
        }
Ejemplo n.º 3
0
 public Retorno Salvar(Pagamento Entity)
 {
     try
     {
         Retorno retorno = PreenchimentoObrigatorio(Entity);
         if (retorno.IsValido)
         {
             if (Entity.Codigo == 0)
             {
                 retorno = new DataPagamento().Incluir(Entity);
             }
             else
             {
                 retorno = new DataPagamento().Alterar(Entity);
             }
         }
         return(retorno);
     }
     catch (Exception ex)
     {
         return(Retorno.CriarRetornoExcecao(ex));
     }
 }