コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
             }
         }
     }
 }
コード例 #4
0
 public AdditionalIncomeController(
     IAdditionalIncome additionalIncome)
 {
     _additionalIncome = additionalIncome;
 }