void ScheduleHandler::AddSchedule( EmployeeHandler& employeeHandler )
{
	int hour = ScheduleSelection();

	int employeeIndex = employeeHandler.EmployeeSelection();
	Employee& refEmployee = employeeHandler.GetEmployee( employeeIndex );

	if ( refEmployee.GetIsActive() == false )
	{
		cout << "** ERROR: Employee is not currently working for company!" << endl;
	}

	m_lstSchedule[ hour ].AssignEmployee( &refEmployee );

	cout << "Assigned " << hour << " to employee " << refEmployee.GetName() << endl;
}
int main(void)
{
	// 직원관리를 목적으로 설계된 컨트롤 클래스의 객체생성
	EmployeeHandler handler;

	// 정규직 등록
	handler.AddEmployee(new PermanentWorker("KIM", 1000));
	handler.AddEmployee(new PermanentWorker("LEE", 1500));

	// 임시직 등록
	TemporaryWorker * alba=new TemporaryWorker("Jung", 700);
	alba->AddWorkTime(5);	// 5시간 일한결과 등록
	handler.AddEmployee(alba);

	// 영업직 등록
	SalesWorker * seller=new SalesWorker("Hong", 1000, 0.1);
	seller->AddSalesResult(7000);	// 영업실적 7000
	handler.AddEmployee(seller);

	// 이번 달에 지불해야 할 급여의 정보
	handler.ShowAllSalaryInfo();	

	// 이번 달에 지불해야 할 급여의 총합
	handler.ShowTotalSalary();
	return 0;
}
Exemple #3
0
int main()
{


    EmployeeHandler employeemanagement;




    cout<<endl;
    cout<<endl;


    bool Quit = false;
    while(Quit != true)
    {


        DisplayMainMenu();
        int choice;
        cin>> choice;
        while( choice > 9)
        {
            cout<<"Please Enter a Number from 0 thru 9......!!!!!!"<<endl;
            break;
        }



        if (choice == ADD_EMPLOYEE)
        {

            employeemanagement.AddEmployee();
        }


        else if (choice == EDIT_EMPLOYEE)
        {
            cout<<"option is 2"<<endl;
            employeemanagement.EditEmployee();

        }


        else if (choice == LAYOFF_EMPLOYEE)
        {
            cout<<"option is 3"<<endl;
            employeemanagement.LayoffEmployee();

        }


        else if (choice == VIEW_EMPLOYEE)
        {
            cout<<"option is 4"<<endl;
            employeemanagement.DisplayEmployeeList();

        }


        else if (choice == UPDATE_SCHEDULE)
        {

            cout<<"option is 5"<<endl;
            cout<<"Updating Schedule........"<<endl;
            string option;
            cout<<endl;
            cout<< "[0] : 0:00 - UNALLOCATED"<<endl;
            cout<< "[1] : 1:00 - UNALLOCATED"<<endl;
            cout<< "[2] : 2:00 - UNALLOCATED"<<endl;
            cout<< "[3] : 3:00 - UNALLOCATED"<<endl;
            cout<< "[4] : 4:00 - UNALLOCATED"<<endl;
            cout<< "[5] : 5:00 - UNALLOCATED"<<endl;
            cout<< "[6] : 6:00 - UNALLOCATED"<<endl;
            cout<< "[7] : 7:00 - UNALLOCATED"<<endl;
            cout<< "[8] : 8:00 - UNALLOCATED"<<endl;
            cout<< "[9] : 9:00 - UNALLOCATED"<<endl;
            cout<< "[10] : 10:00 - UNALLOCATED"<<endl;
            cout<< "[11] : 11:00 - UNALLOCATED"<<endl;
            cout<< "[12] : 12:00 - UNALLOCATED"<<endl;
            cout<< "[13] : 13:00 - UNALLOCATED"<<endl;
            cout<< "[14] : 14:00 - UNALLOCATED"<<endl;
            cout<< "[15] : 15:00 - UNALLOCATED"<<endl;
            cout<< "[16] : 16:00 - UNALLOCATED"<<endl;
            cout<< "[17] : 17:00 - UNALLOCATED"<<endl;
            cout<< "[18] : 18:00 - UNALLOCATED"<<endl;
            cout<< "[19] : 19:00 - UNALLOCATED"<<endl;
            cout<< "[20] : 20:00 - UNALLOCATED"<<endl;
            cout<< "[21] : 21:00 - UNALLOCATED"<<endl;
            cout<< "[22] : 22:00 - UNALLOCATED"<<endl;
            cout<< "[23] : 23:00 - UNALLOCATED"<<endl;
            cout<< "[24] : 24:00 - UNALLOCATED"<<endl;


            cout<<endl;
            cout<< "Enter the schedule hour-block:"<<endl;
            cin>> option;



            if (option =="0")
            {
                cout <<"0 Hour"<<endl;
            }

            else if (option =="1")
            {
                cout <<"1 Hour"<<endl;
            }

            else if (option =="2")
            {
                cout <<"2 Hour"<<endl;
            }

            else if (option =="3")
            {
                cout <<"3 Hour"<<endl;
            }

            else if (option =="4")
            {
                cout <<"4 Hour"<<endl;
            }

            else if (option =="5")
            {
                cout <<"5 Hour"<<endl;
            }

            else if (option =="6")
            {
                cout <<"6 Hour"<<endl;
            }

            else if (option =="7")
            {
                cout <<"7 Hour"<<endl;
            }

            else if (option =="8")
            {
                cout <<"8 Hour"<<endl;
            }
            cout<<"EMPLOYEES"<<endl;
            cout<<endl;
            string firstName;
            string lastName;
            int PayRate;
            cout<<"[0]:"<<firstName<<lastName<<PayRate<<endl;///print View Employee List(and their status)
            cout<<endl;
            int index;
            cout<<"Enter the index of the employee:"<<endl;
            cin>>index;
            if (index == 0 )

            {
                cout <<"You pick me"<<endl;

            }



        }
        else if (choice == CANCEL_SCHEDULE)