public void Execute(IAdditionalIncome additionalIncome, List <decimal?> points) { if (additionalIncome is Sale sale) { for (int i = additionalIncome.From; i < additionalIncome.To; ++i) { var income = additionalIncome.GetIncomePerYear(i - additionalIncome.From); points[i] = points[i] + income; } } }
public AnalyticsFactory( IAbstractExpenses expenses, ICompletedOrders completedOrders, IWagesForCompletedOrders wagesForCompleted, ISaleOfGoods saleOfGoods, IAdditionalIncome additionalIncome, IPaymentForThePreviousPeriod paymentForThePrevious, IAbstractSalaryExpenses abstractSalaryExpenses) { _expenses = expenses; _completedOrders = completedOrders; _wagesForCompleted = wagesForCompleted; _saleOfGoods = saleOfGoods; _additionalIncome = additionalIncome; _paymentForThePrevious = paymentForThePrevious; _abstractSalaryExpenses = abstractSalaryExpenses; }
public void Execute(IAdditionalIncome additionalIncome, List <decimal?> points) { if (additionalIncome is Deposit deposit) { decimal lastIncome = 0m; for (int i = additionalIncome.From; i < additionalIncome.To; ++i) { var income = additionalIncome.GetIncomePerYear(i - additionalIncome.From); if (i - additionalIncome.From <= deposit.Years) { lastIncome = income; points[i] = points[i] + income; } else { points[i] = points[i] + lastIncome; } } } }
public AdditionalIncomeController( IAdditionalIncome additionalIncome) { _additionalIncome = additionalIncome; }