Example #1
0
        private static void Main(string[] args)
        {
            int[] args = int args[];
            //Employee a = new Employee();
            Employee a = EmployeeFactory.Create(args[0]);

            a.SayHello();
            //Employee b = new Sales();
            Employee b = EmployeeFactory.Create(args[1]);

            b.SayHello();
        }
Example #2
0
        private static void Main(string[] args)
        {
            Employee employee = null;

            if (args.Length <= 0)
            {
                employee = EmployeeFactory.Create(EmployeeType.Default);
            }
            else

            {
                EmployeeType type = (EmployeeType)int.Parse(args[0]);
                employee = EmployeeFactory.Create(type);
            }

            Console.WriteLine(employee);
        }