HRSystem_5/src/Organization/HRSystem.java
// return object of specified Transaction subclass
return object of specified Transaction subclass
return object of specified Transaction subclass
private Transaction createTransaction( int type )
   {
      Transaction temp = null; 
      switch ( type )
      {
         case EMPLOYEE_INQUIRY: 
            temp = new EmployeeInquiry( screen,keypad, companyDatabase );
            break;
         case COMPANY_DETAILS: 
            temp = new CompanyDetails( screen, keypad , 
               companyDatabase );
            break; 
         case HIRE: 
            temp = new HireTransaction( screen, keypad, 
               companyDatabase );
            break;
         case FIRE: 
            temp = new FireTransaction( screen, keypad, 
               companyDatabase );
            break;
          case VIEWPAYROLL: 
            temp = new PayrollTransaction( screen, 
            companyDatabase, keypad );
            break;
      } 
      return temp; 
   }
private Transaction createTransaction ( int type ) { Transaction temp = null ; switch ( type ) { case EMPLOYEE_INQUIRY : temp = new EmployeeInquiry ( screen , keypad , companyDatabase ) ; break ; case COMPANY_DETAILS : temp = new CompanyDetails ( screen , keypad , companyDatabase ) ; break ; case HIRE : temp = new HireTransaction ( screen , keypad , companyDatabase ) ; break ; case FIRE : temp = new FireTransaction ( screen , keypad , companyDatabase ) ; break ; case VIEWPAYROLL : temp = new PayrollTransaction ( screen , companyDatabase , keypad ) ; break ; } return temp ; }
return object of specified Transaction subclass
return object of specified Transaction subclass
// temporary Transaction variable // determine which type of Transaction to create      // create new EmployeeInquiry transaction // create new Withdrawal transaction // create new Deposit transaction // create new Deposit transaction // create new Deposit transaction // end switch // return the newly created object