private double CalulatePayForTimeCard(TimeCard timeCard) { double overTimeHours = Math.Max(0.0, timeCard.Hours - 8); double normalTimeHours = timeCard.Hours - overTimeHours; return((overTimeHours * 1.5 + normalTimeHours) * hourlyRate); }
public override void Execute() { Employee emp = database.GetEmployee(empId); if (emp != null) { HourlyClassification hc = emp.Classification as HourlyClassification; if (hc != null) { TimeCard tc = new TimeCard(date, hours); hc.AddTimeCard(tc); } else { throw new ApplicationException("Tried to add timecard to non-hourly employee"); } } else { throw new ApplicationException("No such employee."); } }
public void AddTimeCard(TimeCard tc) { timeCards[tc.Date] = tc; }