Exemple #1
0
        public DebtReductionOptions PostDebtReductionOptions(DebtReductionOptions debtReductionOptions)
        {
            var lessonUserId = GetUserLessonId();

            if (!lessonUserId.HasValue)
            {
                return(null);
            }

            var result = SaltServiceAgent.PostLesson2(new Lesson2()
            {
                DebtReductionOptions = debtReductionOptions, User = new User()
                {
                    UserId = lessonUserId.Value
                }
            }.ToDataContract()).ToDomainObject();

            return(result.DebtReductionOptions);
        }
Exemple #2
0
 /// <summary>
 /// To the data contract.
 /// </summary>
 /// <param name="debtReductionOptions">The debt reduction options.</param>
 /// <returns></returns>
 public static DebtReductionOptionsContract ToDataContract(this DebtReductionOptions debtReductionOptions)
 {
     return(null == debtReductionOptions
               ? null
               : new DebtReductionOptionsContract()
     {
         ExtraPaymentAmount = debtReductionOptions.ExtraPaymentAmount,
         ExtraPaymentMonth = debtReductionOptions.ExtraPaymentMonth,
         LessonUserId = debtReductionOptions.UserId,
         IncreaseMonthlyPayment = debtReductionOptions.IncreaseMonthlyPayment,
         LowerYourInterestRate = debtReductionOptions.LoweredInterestRate > 0,
         LoweredInterestRate = debtReductionOptions.LoweredInterestRate,
         PayCashForOneTimePurchases = debtReductionOptions.PayCashForOneTimePurchases,
         PayCashForRecurringExpenses = debtReductionOptions.PayCashForRecurringExpenses,
         PlanAnExtraPayment =
             debtReductionOptions.ExtraPaymentAmount > 0 ||
             debtReductionOptions.ExtraPaymentMonth > 0
     });
 }