예제 #1
0
        static void Main(string[] args)
        {
            SalaryEmployee sEmployee  = new SalaryEmployee("David", "Barnes", new DateTime(2014, 10, 31), 537.36m);
            SalaryEmployee sEmployee2 = new SalaryEmployee();

            //Output the SalaryEmployee converted to a string
            Console.WriteLine(sEmployee.ToString());
            Console.WriteLine(sEmployee2.ToString());

            HourlyEmployee hEmployee = new HourlyEmployee("Joe", "Smith", new DateTime(2013, 10, 01), 12.43m, 36m);

            Console.WriteLine(hEmployee.ToString());
            Console.WriteLine(hEmployee.GetYearlySalary());
            Console.WriteLine(hEmployee.GetAllEmployeeInformation());

            //Declare a new colletion
            IEmployeeCollection employeeCollection;

            //Instanciate the collection with the concreate class even though it is going into
            //an interface container
            employeeCollection = new EmployeeCollection();
            //Call the method below to add the employees to the collection
            AddNewEmployees(employeeCollection);

            //Print the employees out
            PrintEmployees(employeeCollection);
        }
예제 #2
0
        static void Main(string[] args)
        {
            // Employee employee = new Employee();
            SalaryEmployee sEmployees = new SalaryEmployee("Kyle", "Sherman", new DateTime(2014, 10, 31), 1000.01m);

            //Console.WriteLine(sEmployees.GetAllEmployeeInformation().ToString());
            Console.WriteLine(sEmployees.ToString());
            //SalaryEmployee sEmployee2 = new SalaryEmployee();
            //Console.WriteLine(sEmployees.nameAndSalary());

            HourlyEmployee hEmployee1 = new HourlyEmployee("Steve", "MahBoi", new DateTime(2013, 10, 31), 1000.01m, 40);

            //Console.WriteLine(hEmployee1.GetAllEmployeeInformation().ToString());
            Console.WriteLine(hEmployee1.ToString());
            Console.WriteLine(hEmployee1.GetYearlySalary());
            Console.WriteLine(hEmployee1.GetAllEmployeeInformation());
        }