Пример #1
0
        internal static DateTime GetStatementTillDate(CreditCardBase objBase, DateTime baseDate)
        {
            if (objBase.ETipoTarjeta != ETipoTarjeta.Credito)
            {
                return(DateTime.MinValue);
            }

            switch (objBase.EFormaPago)
            {
            case EFormaPago.MesVencido:

                int statement_limit_day = objBase.StatementLimitDay(baseDate);
                return((baseDate.Day <= statement_limit_day)
                                ? new DateTime(baseDate.Year, baseDate.Month, statement_limit_day)
                                : new DateTime(baseDate.AddMonths(1).Year, baseDate.AddMonths(1).Month, statement_limit_day));

            case EFormaPago.XDiasMes:

                return(new DateTime(baseDate.Year, baseDate.Month, DateAndTime.LastDay(baseDate.Month, baseDate.Year).Day));

            //Caso imposible
            default:
                return(DateTime.MinValue);
            }
        }
Пример #2
0
        internal static DateTime GetStatementDueDate(CreditCardBase objBase, DateTime dueDate)
        {
            if (objBase.ETipoTarjeta != ETipoTarjeta.Credito)
            {
                return(DateTime.MinValue);
            }

            return(new DateTime(dueDate.Year, dueDate.Month, dueDate.Day));
        }
Пример #3
0
        internal static DateTime GetStatementFromDate(CreditCardBase objBase, DateTime dueDate)
        {
            if (objBase.ETipoTarjeta != ETipoTarjeta.Credito)
            {
                return(DateTime.MinValue);
            }

            DateTime from_date = dueDate.AddMonths(-1);

            switch (objBase.EFormaPago)
            {
            case EFormaPago.MesVencido:
                int statement_limit_day = objBase.StatementLimitDay(from_date);
                return(new DateTime(from_date.Year, from_date.Month, statement_limit_day).AddMonths(-1).AddDays(1));

            case EFormaPago.XDiasMes:
                return(new DateTime(from_date.Year, from_date.Month, 1));

            //Caso imposible
            default:
                return(DateTime.MinValue);
            }
        }
Пример #4
0
        internal static DateTime GetStatementDueDate(CreditCardBase objBase, DateTime baseDate)
        {
            if (objBase.ETipoTarjeta != ETipoTarjeta.Credito)
            {
                return(DateTime.MinValue);
            }

            DateTime due_date = baseDate.AddMonths(1);

            int statement_limit_day = objBase.StatementLimitDay(due_date);
            int statement_pay_day   = objBase.StatementPayDay(due_date);

            switch (objBase.EFormaPago)
            {
            case EFormaPago.MesVencido:

                due_date = new DateTime(due_date.Year, due_date.Month, statement_pay_day);

                if (baseDate.Day <= statement_limit_day)
                {
                    return(due_date);
                }
                else
                {
                    return(due_date.AddMonths(1));
                }

            case EFormaPago.XDiasMes:

                return(new DateTime(due_date.Year, due_date.Month, statement_pay_day));

            //Caso imposible
            default:
                return(DateTime.MinValue);
            }
        }