Example #1
0
        public bool IsInPayPeriod(DateTime theDate, PayCheck paycheck)
        {
            DateTime payPeriodEndDate   = paycheck.PayPeriodEndDate;
            DateTime payPeriodStartDate = paycheck.PayPeriodStartDate;

            return((theDate >= payPeriodStartDate) &&
                   (theDate <= payPeriodEndDate));
        }
Example #2
0
        public double CalculateDeductions(PayCheck paycheck)
        {
            double service_charges = GetServiceCharge(paycheck.PayPeriodEndDate) == null ? 0 : GetServiceCharge(paycheck.PayPeriodEndDate).Amount;
            double totalDues       = 0;
            int    fridays         = NumberOfFridaysInPayPeriod(paycheck.PayPeriodStartDate, paycheck.PayPeriodEndDate);

            totalDues = dues * fridays;
            return(service_charges + totalDues);
        }
Example #3
0
        public void PayDay(PayCheck paycheck)
        {
            double grossPay   = classification.CalculatePay(paycheck);
            double deductions = affiliation.CalculateDeductions(paycheck);
            double netPay     = grossPay - deductions;

            paycheck.GrossPay   = grossPay;
            paycheck.Deductions = deductions;
            paycheck.NetPay     = netPay;
            method.Pay(paycheck);
        }
Example #4
0
        public override double CalculatePay(PayCheck paycheck)
        {
            double totalPay = IsNeedSalaryPay(paycheck.PayPeriodEndDate) ? salary / 2 : 0;

            foreach (var receipt in reciptes)
            {
                if (IsInPayPeriod(receipt.Date, paycheck))
                {
                    totalPay += (receipt.Amount * commissionRate);
                }
            }
            return(totalPay);
        }
        public override double CalculatePay(PayCheck paycheck)
        {
            double totalPay = 0.0;

            foreach (TimeCard timeCard in timecards)
            {
                if (IsInPayPeriod(timeCard.Date, paycheck))
                {
                    totalPay += CalculatePayForTimeCard(timeCard);
                }
            }
            return(totalPay);
        }
Example #6
0
 public abstract double CalculatePay(PayCheck paycheck);
Example #7
0
 public override double CalculatePay(PayCheck paycheck)
 {
     return(salary);
 }
Example #8
0
 public double CalculateDeductions(PayCheck paycheck)
 {
     return(0);
 }
Example #9
0
 internal void Pay(PayCheck paycheck)
 {
     //throw new NotImplementedException();
 }