Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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.");
            }
        }
Esempio n. 3
0
 public void AddTimeCard(TimeCard tc)
 {
     timeCards[tc.Date] = tc;
 }