Ejemplo n.º 1
0
        public string hourlyInfo(Employee employee)
        {
            employee.CalculatePay();
            HourlyEmployee hr = employee as HourlyEmployee;

            hr.HourWeeklyPay   += hr.WeeklyPay;
            hr.HourTakeHomePay += hr.TakeHomePay;
            hr.HourFICA        += hr.fICA;
            hr.HourFedTax      += hr.FedTax;

            return(string.Format("{4}. Employee ID: {5}\n" +
                                 " Gross Pay this week {0}\n" +
                                 " Net Pay this week {1}\n" +
                                 " FICA Paid this week {2} \n" +
                                 " Total federal tax withheld this week {3}\n"
                                 , hr.WeeklyPay.ToString("C"), hr.TakeHomePay.ToString("C"),
                                 hr.fICA.ToString("C"), hr.FedTax.ToString("C"), hr.Name, hr.EmployeeId.ToString()));
        }
Ejemplo n.º 2
0
        public string salariedInfo(Employee employee)
        {
            employee.CalculatePay();
            SalariedEmployee se = employee as SalariedEmployee;

            se.SalariedWeeklyPay   += se.WeeklyPay;
            se.SalariedTakeHomePay += se.TakeHomePay;
            se.SalariedFICA        += se.fICA;
            se.SalariedFedTax      += se.FedTax;

            return(string.Format("{4}. Employee ID: {5} \n Gross" +
                                 " Pay this week {0}\n" +
                                 " Net Pay this week {1}\n" +
                                 " FICA Paid this week {2} \n" +
                                 " Total federal tax withheld this week {3}\n"
                                 , se.WeeklyPay.ToString("C"), se.TakeHomePay.ToString("C"),
                                 se.fICA.ToString("C"), se.FedTax.ToString("C"), se.Name, se.EmployeeId.ToString()));
        }