protected static bool IsInPayPeriod(DateTime theDate, Paycheck paycheck) { DateTime end = paycheck.PayDate; DateTime start = paycheck.StartDate; return (theDate >= start) && theDate <= end; }
public void PayDay(Paycheck paycheck) { double grossPay = classification.CalculatePay(paycheck); paycheck.GrossPay = grossPay; method.Pay(paycheck); }
protected static bool IsInPayPeriod(DateTime theDate, Paycheck paycheck) { DateTime end = paycheck.PayDate; DateTime start = paycheck.StartDate; return((theDate >= start) && theDate <= end); }
public override double CalculatePay(Paycheck paycheck) { var total = from TimeCard timeCard in timeCards.Values where IsInPayPeriod(paycheck.StartDate, paycheck) select CalculatePayForTimeCard(timeCard); return total.Sum(); }
public override double CalculatePay(Paycheck paycheck) { var total = from TimeCard timeCard in timeCards.Values where IsInPayPeriod(paycheck.StartDate, paycheck) select CalculatePayForTimeCard(timeCard); return(total.Sum()); }
public override double CalculatePay(Paycheck paycheck) { double salesTotal = 0.0; foreach (SalesReceipt receipt in salesReceipts.Values) { if (IsInPayPeriod(paycheck.StartDate,paycheck)) salesTotal += receipt.Amount; } return baseRate + (salesTotal * commissionRate * 0.01); }
public override double CalculatePay(Paycheck paycheck) { double salesTotal = 0.0; foreach (SalesReceipt receipt in salesReceipts.Values) { if (IsInPayPeriod(paycheck.StartDate, paycheck)) { salesTotal += receipt.Amount; } } return(baseRate + (salesTotal * commissionRate * 0.01)); }
public void Execute() { ArrayList empIds = PayrollDatabase.GetAllEmployeeIds(); foreach (int empId in empIds) { Employee employee = PayrollDatabase.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() { ArrayList empIds = PayrollDatabase.GetAllEmployeeIds(); foreach (int empId in empIds) { Employee employee = PayrollDatabase.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 Pay(Paycheck paycheck) { paycheck.SetField("Disposition", "Hold"); }
public abstract double CalculatePay(Paycheck paycheck);
public void Pay(Paycheck paycheck) { paycheck.SetField("Disposition", "Mail"); }
public override double CalculatePay(Paycheck paycheck) { return(salary); }
public override double CalculatePay(Paycheck paycheck) { return salary; }