Beispiel #1
0
        public void GetEmployeeData(int EmployeeTypeId)
        {
            SimpleFactory           a     = new SimpleFactory();
            ISimpleFactoryInterFace iSimp = a.GetEmployee(EmployeeTypeId);

            Console.WriteLine("BONUS : " + iSimp.getBonus().ToString() + " ;PAY " + iSimp.getPay().ToString());
        }
Beispiel #2
0
        public Employee ApplySalary()
        {
            ISimpleFactoryInterFace manager = this.Create();

            _emp.Bonus  = manager.getBonus();
            _emp.Salary = manager.getPay();
            return(_emp);
        }
Beispiel #3
0
        public ISimpleFactoryInterFace GetEmployee(int EmployeeTypeId)
        {
            ISimpleFactoryInterFace returnValue = null;

            if (EmployeeTypeId == Convert.ToInt32(EmployeeType.Permanent.GetHashCode()))
            {
                returnValue = new SimpleFactoryPermamentEmp();
            }
            else if (EmployeeTypeId == Convert.ToInt32(EmployeeType.Contract.GetHashCode()))
            {
                returnValue = new SimpleFactoryContractEmp();
            }
            return(returnValue);
        }