예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
            }
        }