public override void Execute() { ArrayList empIds = database.GetAllEmployeeIds(); foreach (int empId in empIds) { Employee employee = database.GetEmployee(empId); if (employee.IsPayDate(payDate)) { DateTime startDate = employee.GetPayPeriodStartDate(payDate); Paycheck pc = new Paycheck(startDate, payDate); paychecks[empId] = pc; employee.Payday(pc); } } }
public void Execute() { var empIds = PayrollDatabase.GetAllEmployeeIds(); foreach (int empId in empIds) { Employee employee = PayrollDatabase.GetEmployee(empId); if (!employee.IsPayDate(payDate)) { continue; } DateTime startDate = employee.GetPayPeriodStartDate(payDate); Paycheck pc = new Paycheck(startDate, payDate); Paychecks[empId] = pc; employee.Payday(pc); } }