示例#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());
        }
示例#2
0
        public Employee ApplySalary()
        {
            ISimpleFactoryInterFace manager = this.Create();

            _emp.Bonus  = manager.getBonus();
            _emp.Salary = manager.getPay();
            return(_emp);
        }
示例#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);
        }