Esempio n. 1
0
        static void Main2302()
        {
            Console.WriteLine("Hello Visitor Pattern!");

            EmployeeList empList = new EmployeeList();
            IEmployee    fteA    = new FullTimeEmployee("0001", 3200.00, 45);
            IEmployee    fteB    = new FullTimeEmployee("0002", 2000, 40);
            IEmployee    fteC    = new FullTimeEmployee("0003", 2400, 38);
            IEmployee    fteD    = new PartTimeEmployee("0004", 80 * 40, 20);
            IEmployee    fteE    = new PartTimeEmployee("0005", 60 * 40, 18);

            empList.AddEmployee(fteA);
            empList.AddEmployee(fteB);
            empList.AddEmployee(fteC);
            empList.AddEmployee(fteD);
            empList.AddEmployee(fteE);

            var hr = new HRDepartment();

            empList.Action(hr);

            Console.WriteLine("****************************************************");

            var finance = new FinanceDepartment();

            empList.Action(finance);


            Console.ReadLine();
        }