示例#1
0
        private void PayrollConfirmed(object sender, EventArgs e)
        {
            var payroll = new Domain.Payroll
            {
                StartDate        = payrollHeaderView.StartDate.GetValueOrDefault(),
                EndDate          = payrollHeaderView.EndDate.GetValueOrDefault(),
                Period           = payrollHeaderView.PeriodName,
                PaymentFrequency = PaymentFrequency.Monthly,
                PayrollDetails   = (from p in payrollGridView.PayrollDetails
                                    select new Domain.PayrollDetail
                {
                    Employee =
                        new Domain.Employee {
                        EmployeeID = p.EmployeeID
                    },
                    GrossSalary = p.GrossSalary,
                    IncomeTax = p.IncomeTax,
                    Pension = p.PensionDeduction,
                    OtherDeductions = p.LoanDeduction
                }).ToList()
            };

            _payrollService.ConfirmPayment(payroll);
        }