public void GetEmployeeData(int EmployeeTypeId) { SimpleFactory a = new SimpleFactory(); ISimpleFactoryInterFace iSimp = a.GetEmployee(EmployeeTypeId); Console.WriteLine("BONUS : " + iSimp.getBonus().ToString() + " ;PAY " + iSimp.getPay().ToString()); }
public Employee ApplySalary() { ISimpleFactoryInterFace manager = this.Create(); _emp.Bonus = manager.getBonus(); _emp.Salary = manager.getPay(); return(_emp); }
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); }