Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var employee = EmployeeFactory.GetEmployeeInstance(UserRole.Developer, AccessBoundry.User);

            employee.FirstName = "Camilo A";
            employee.LastName  = "Villa Naranjo";
            employee.SetEmail();

            Console.WriteLine(employee);
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        private static void FactoryPatternEmployee()
        {
            EmployeeFactory  employeeFactory = new EmployeeFactory();
            FactoryIEmployee employee        = employeeFactory.GetEmployeeInstance(EmployeeType.PartTime);

            EmployeeBase emp = (EmployeeBase)employee;

            emp.FirstName = "Chandra";
            emp.LastName  = "Sekaran";

            Console.WriteLine("Bonus : {0}", employee.GetBonus());
            Console.WriteLine("Salary : {0}", employee.GetSalary());
            Console.WriteLine("Full Name : {0}", emp.GetFullName());
        }
Ejemplo n.º 3
0
        public static void SeedData(List <IEmployee> employees)
        {
            IEmployee teacher1 = EmployeeFactory.GetEmployeeInstance(EmployeeType.Teacher, 1, "Bob", "Fisher", 40000);

            employees.Add(teacher1);

            IEmployee teacher2 = EmployeeFactory.GetEmployeeInstance(EmployeeType.Teacher, 2, "Jenny", "Thomas", 40000);

            employees.Add(teacher2);

            IEmployee headOfDepartment = EmployeeFactory.GetEmployeeInstance(EmployeeType.HeadOfDepartment, 3, "Brenda", "Mullins", 50000);

            employees.Add(headOfDepartment);

            IEmployee deputyHeadMaster = EmployeeFactory.GetEmployeeInstance(EmployeeType.DeputyHeadMaster, 4, "Devlin", "Brown", 60000);

            employees.Add(deputyHeadMaster);

            IEmployee headMaster = EmployeeFactory.GetEmployeeInstance(EmployeeType.HeadMaster, 5, "Damien", "Jones", 80000);

            employees.Add(headMaster);
        }