Booking Agent

This represents the set of functions available to the system administrator. In this class, the user may:

  1. Add a booking agent
  2. Delete a booking agent
  3. Modify a booking agent

These are all functions which can access a database containing information on each booking agent.

To get to this screen, the user must first login, and select the 'booking agent' tab from the system administrator screen.

The user will be prompted to select one of these three options, or to cancel the request and return to the previous screen.

Function Walkthrough

Here is a description of the three functions. It will include a description of the different inputs one can enter into the system, and the resulting outputs the user can expect.

Also, a detailed description of the various error messages that are possible.

Finally, an explanation of how the design works, and on which the actual coding will take place.

  1. Adding a booking agent

    When a new booking agent is hired by the airline, the database must be updated and a new record for that agent entered.

    Once this option is selected from the system administration screen, the sub-program will be called which contains a 'form' for the user to fill out.

    Adding a new booking agent

    This form will contain empty spaces for each of the attributes associated with a booking agent. The user will have the ability to input information into these fields.

    The attributes include the name of the booking agent surname, first name, initial, address, phone number, login name and password. Each of these fields is more thoroughly explained in the data dictionary, and will include samples of valid and invalid input.

    Cancelling the request

    If the user wishes to cancel this request at any time, the user may do so by choosing the 'Cancel' button. This will return the user to the previous screen.

    Input complete

    When the user is finished, and feels satisfied that the information is correct, the user may select the 'Ok' button.

    Checking for invalid input

    Then, the computer will check each field, and ensure that each one has a valid input. Examples of valid and invalid input appear below.

    If an error is found, a box will appear, identifying the incorrect input. The user will be asked whether the user wishes to return to the previous screen, and change the input, or to cancel the request.

    Final confirmation

    If no errors are found, the user will be asked to confirm that the information is correct. A window will appear, and the user may select the 'Ok' button or the 'Cancel' button.

    If the 'Cancel' button is selected, the user will return to the main screen, and the new booking agent will not be added to the database.

    If the 'Ok' button is selected, the user will return to the main screen, and the new booking agent will be added to the database.

  2. Delete a booking agent

    If ever a booking agent is fired, quits or dies, the booking agent can be deleted from the database.

    Selecting a booking agent from the list

    Once this option is chosen from the main screen, a list of all booking agents will appear on the screen.

    The list will be sorted in alphabetical order by surname, and will contain all the fields in the database.

    Cancelling the request

    The user may cancel this request at any time by selecting the 'Cancel' button. This will return the user to the main screen.

    Selecting a booking agent

    The user may select one of the booking agents, and then select the 'Ok' button.

    Confirming the selection

    The user will then be prompted to confirm the selection. If the user responds by pressing the 'Cancel' button, the booking agent will remain in the database, and the user will be returned to the main screen.

    If the user responds by selecting the 'Ok' button, the booking agent will be deleted from the database, and the user will return to the main screen.

  3. Modify a booking agent

    Sometimes the information pertaining to a booking agent will be changed. The user may select this option from the main screen to initiate a sub-program where these changes can be made.

    Selecting a booking agent

    When this option is chosen, a list of all booking agents in the database will appear on the screen. It will be sorted alphabetically by surname.

    The user may now select one of the booking agents to modify. The user may then select the 'Ok' button to modify that booking agent.

    At any time, the user may select the 'Cancel' button, which will return the user to the previous screen.

    Modifying a booking agent

    Once a booking agent has been chosen, and the 'Ok' button has been selected, a chart will appear containing all the booking agent's current information.

    The user may change any of the information in any field.

    As always, the user may at any time select the 'Cancel' button, and return to the main screen.

    Checking for invalid input

    Once satisfied with the modifications, the user may select the 'Ok' button.

    Then, the computer will check each field, and ensure that each one has a valid input. Examples of valid and invalid input appear below.

    If an error is found, a box will appear, identifying the incorrect input. The user will be asked whether the user wishes to return to the previous screen, and change the input, or to cancel the request.

    Final confirmation

    If no errors are found, the user will be asked to confirm that the information is correct. A window will appear, and the user may select the 'Ok' button or the 'Cancel' button.

    If the 'Cancel' button is selected, the user will return to the main screen, and no changes will occur to the database.

    If the 'Ok' button is selected, the user will return to the main screen, and the modifications will be made to the database.

Attributes of booking agent:

Surname
The booking agent's last name; this will be a string of twenty characters containing only alphabetic characters and punctuation. Any string containing digits is invalid. Example: "Doe". Note that any number of booking agents may share the same first and/or last name, but they must each have a unique login name.
First Name
The booking agent's first name; this will also be a string of twenty characters containing only alphabetic characters and punctuation. Any string containing digits is invalid. Example: "John".
Initial
The booking agent's middle initial; this will be a one character field containing either an alphabetic character or a space to indicate none.
Address
The booking agent's address; this will be a string of fifty characters. This field is expected to include: building number, street, city, province, and postal code, in a form suitable for a mailing label. Example: "2500 University Dr. Calgary, AB T2L 0A0".
Phone number
The booking agent's phone number. It will consist of a three digit area code enclosed in parentheses plus a seven digit local number with a dash in between the third and fourth digits. The area code may not be omitted, but the local area code will be provided as a default. Example: "(403)283-1752".
Login name
This is the name the booking agent will use to log into the booking agent system. It consists of a string of ten characters. Letters of either uppercase or lowercase may be used, but the name must be a single word (ie no spaces). The login name must be unique, and it will be used as the primary key for booking agents. The "Add Booking Agent" screen will prevent the system administrator from creating a booking agent with a login name that has already been used. Example: "davidt".
Password
This is the booking agent's password that must be entered along with the appropriate login name to gain access to the booking agent system. It will be stored in an encrypted format for security. It consists of a string of ten characters. Letters of either uppercase or lowercase may be used, but the name must be a single word (ie no spaces). Note that when this is entered or changed, the characters will not be displayed on the screen.

Psuedo Code

Open database

If Booking agent X selected
	Create variable of type booking agent
	Copy attributes of agent X to new booking agent except password
	Enable Add button
	Enable Modify button
	Enable Delete button
	Disable New button

If New selected
	Create variable of type booking agent
	Assign 'blank' to all attributes of new booking agent
	Enable Add button
	Disable New button

Call Display function with new booking agent

SELECT LOOP (explained in more detail elsewhere)
	If User selects a field
		Field = user input
UNTIL a button is selected

If 'Cancel' is selected
	Abort/Exit

If 'Delete' is selected
	Call confirmation function
	If confirm is YES
		remove agent from database
	If confirm is NO
		return to SELECT LOOP

If 'Add' or 'Modify' is selected
	Check 'surname' field
		If blank OR contains digits
			Report error
			return to SELECT LOOP
	Check 'first name' field
		If blank OR contains digits
			Report error
			return to SELECT LOOP
	Check 'phone number' field
		If NOT in phone number format
			Report error
			return to SELECT LOOP
	Check 'login name' field
		If blank OR contains nonalphabetic characters OR NOT unique
			Report error
			return to SELECT LOOP
	Check 'password' field
		If blank OR contains nonalphabetic characters
			Report error
			return to SELECT LOOP

If 'Modify' was chosen
	Update database

If 'Add' was chosen
	Check 'type' field
		If EQUAL to same field on another plane
			Report error
			return to SELECT LOOP
	Add item to database

Close database
Return to calling function

Agent Tests