Beispiel #1
0
        public List <PaymentBusinessModel> GeneratePaymentsForEmployee(EmployeeBusinessModel employee)
        {
            var payments = new List <PaymentBusinessModel>();

            for (int i = 0; i < _paymentsPerYear; i++)
            {
                var paycheck = new PaymentBusinessModel
                {
                    InitialValue = _initialPaymentValue,
                    Deductions   = _deductionBusinessLogic.CreateDeductionsPerPaymentFromEmployee(employee, _paymentsPerYear)
                };
                paycheck.Total = CalculatePaycheckTotal(paycheck);

                payments.Add(paycheck);
            }

            return(payments);
        }
Beispiel #2
0
 public decimal CalculatePaycheckTotal(PaymentBusinessModel paycheck)
 {
     return(paycheck.InitialValue - paycheck.Deductions.Sum(d => d.TotalCost));
 }