示例#1
0
        public double CalculateDeduction(PayCheck payCheck)
        {
            int    fridays           = NumberOfFridays(payCheck.StartDay, payCheck.PayDay);
            double allDues           = CalculateAllDues(fridays);
            double allServiceCharges = CalculateAllServiceCharges(payCheck.StartDay, payCheck.PayDay);

            return(allDues + allServiceCharges);
        }
示例#2
0
        public void PayDay(PayCheck payCheck)
        {
            double grossPay   = classification.Calculate(payCheck);
            double deductions = affiliation.CalculateDeduction(payCheck);
            double netPay     = grossPay - deductions;

            payCheck.GrossPay   = grossPay;
            payCheck.Deductions = deductions;
            payCheck.NetPay     = netPay;
            method.Pay(payCheck);
        }
示例#3
0
        public double Calculate(PayCheck payCheck)
        {
            double totalPay = 0;

            foreach (TimeCard timeCard in timeCards.Values)
            {
                if (DateUtil.IsInPayPeriod(payCheck.StartDay, payCheck.PayDay, timeCard.Date))
                {
                    totalPay += CalulatePayForTimeCard(timeCard);
                }
            }
            return(totalPay);
        }
        public double Calculate(PayCheck payCheck)
        {
            double salesTotal = 0;

            foreach (SalesReceipt salesReceipt in salesReceipts.Values)
            {
                if (DateUtil.IsInPayPeriod(payCheck.StartDay, payCheck.PayDay, salesReceipt.Date))
                {
                    salesTotal += salesReceipt.Amount;
                }
            }
            return(baseRate + (salesTotal * commissionRate * 0.01));
        }
示例#5
0
        public override void Execute()
        {
            empIds = GetEmployeeIds();
            Employee emp;
            PayCheck payCheck;

            foreach (int empId in empIds)
            {
                emp = database.GetEmployee(empId);
                if (emp.IsPayDate(payDay))
                {
                    DateTime startDay = emp.GetStartDay(payDay);
                    payCheck         = new PayCheck(startDay, payDay);
                    payChecks[empId] = payCheck;
                    emp.PayDay(payCheck);
                }
            }
        }
示例#6
0
 public void Pay(PayCheck payCheck)
 {
     throw new NotImplementedException();
 }
示例#7
0
 public void Pay(PayCheck payCheck)
 {
     payCheck.SetField("Disposition", "Mail");
 }
示例#8
0
 public double Calculate(PayCheck payCheck)
 {
     return(salary);
 }
示例#9
0
 public double CalculateDeduction(PayCheck payCheck)
 {
     return(0);
 }