protected static bool IsInPayPeriod(DateTime theDate, Paycheck paycheck)
        {
            DateTime end = paycheck.PayDate;
            DateTime start = paycheck.StartDate;

            return (theDate >= start) && theDate <= end;
        }
예제 #2
0
        public void PayDay(Paycheck paycheck)
        {
            double grossPay = classification.CalculatePay(paycheck);

            paycheck.GrossPay = grossPay;
            method.Pay(paycheck);
        }
예제 #3
0
        protected static bool IsInPayPeriod(DateTime theDate, Paycheck paycheck)
        {
            DateTime end   = paycheck.PayDate;
            DateTime start = paycheck.StartDate;

            return((theDate >= start) && theDate <= end);
        }
예제 #4
0
        public void PayDay(Paycheck paycheck)
        {
            double grossPay = classification.CalculatePay(paycheck);

            paycheck.GrossPay = grossPay;
            method.Pay(paycheck);
        }
        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);
 }
예제 #8
0
        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));
        }
예제 #9
0
 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);
         }
     }
 }
예제 #10
0
        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);
                }
            }
        }
예제 #11
0
 public void Pay(Paycheck paycheck)
 {
     paycheck.SetField("Disposition", "Hold");
 }
예제 #12
0
 public abstract double CalculatePay(Paycheck paycheck);
예제 #13
0
 public void Pay(Paycheck paycheck)
 {
     paycheck.SetField("Disposition", "Mail");
 }
예제 #14
0
 public override double CalculatePay(Paycheck paycheck)
 {
     return(salary);
 }
 public override double CalculatePay(Paycheck paycheck)
 {
     return salary;
 }
 public abstract double CalculatePay(Paycheck paycheck);