Ejemplo n.º 1
0
        protected override IEmployeeManager Create()
        {
            var contractEmployeeManager = EmployeeManagerFactory.GetEmployeeManager(Employee);

            if (!Employee.GetType().IsAssignableFrom(typeof(ContractEmployee)))
            {
                return(contractEmployeeManager);
            }
            // Employee Specific Initialization
            ((ContractEmployee)Employee).HourlyRate = contractEmployeeManager.GetPay();

            return(contractEmployeeManager);
        }
Ejemplo n.º 2
0
        protected override IEmployeeManager Create()
        {
            var visitingEmployeeManager = EmployeeManagerFactory.GetEmployeeManager(Employee);

            if (!Employee.GetType().IsAssignableFrom(typeof(VisitingEmployee)))
            {
                return(visitingEmployeeManager);
            }
            // Employee Specific Initialization
            ((VisitingEmployee)Employee).VisitCount = ((VisitingEmployeeManager)visitingEmployeeManager).GetNumberOfVisits();

            return(visitingEmployeeManager);
        }
        protected override IEmployeeManager Create()
        {
            var permanentEmployeeManager = EmployeeManagerFactory.GetEmployeeManager(Employee);

            if (!Employee.GetType().IsAssignableFrom(typeof(PermanentEmployee)))
            {
                return(permanentEmployeeManager);
            }
            // Employee Specific Initialization
            var emp = (PermanentEmployee)Employee;

            emp.JoinedDate    = ((PermanentEmployeeManager)permanentEmployeeManager).GetJoinedDate();
            emp.MonthlySalary = permanentEmployeeManager.GetPay();

            return(permanentEmployeeManager);
        }