Routines for ema_admn.kb


AdminCreateDialog

File Name

ema_admn.kb

Syntax

AdminCreateDialog(VAL parentWindow:WINDOW);

Parameters

parentWindow - window handle of the parent for a new dialog box

Returns

2 = already up

1 = success

0 = failure

Side Effects

None

Description

This function creates a dialog box of type Admin. Before calling this function, you should always call InitData.

Dialog Forms Called

None


AdminDBAddRow

File Name

ema_admn.kb

Syntax

AdminDBAddRow(REF adminLBData:AdminListDataRec, VAL newRow:AdminListRowRec);

Parameters

adminLBData - data record handle

newRow - data for the new row

Returns

1 = success

0 = failure

-n = failure code from database action

Side Effects

None

Description

This function performs the add row database function.

Dialog Forms Called

None


AdminDBDeleteRow

File Name

ema_admn.kb

Syntax

AdminDBDeleteRow(VAL curRow:AdminListRowRec);

Parameters

curRow - contents of the current row

Returns

1 = success

0 = failure

-n = failure code from database action

Side Effects

None

Description

This function performs the delete row database function.

Dialog Forms Called

None


AdminDBLoadTable

File Name

ema_admn.kb

Syntax

AdminDBLoadTable(REF adminLBData:AdminListDataRec);

Parameters

adminLBData - data record handle

Returns

1 = success

0 = failure

-n = failure code from database action

Side Effects

None

Description

This function loads the data structure list from the database table.

Dialog Forms Called

None


AdminDBUpdateRow

File Name

ema_admn.kb

Syntax

AdminDBUpdateRow(VAL newRow:AdminListRowRec, VAL oldRow:AdminListRowRec);

Parameters

newRow - new data for the updated row

oldRow - old data for the updated row

Returns

1 = success

0 = failure

-n = failure code from database action

Side Effects

None

Description

This function performs the update row database function.

Dialog Forms Called

None


AdminDestroyDialog

File Name

ema_admn.kb

Syntax

AdminDestroyDialog;

Parameters

None

Returns

1 = success

0 = failure

Side Effects

None

Description

This function destroys the dialog box if it is currently visible.

Dialog Forms Called

None


AdminDlgRestoreData

File Name

ema_admn.kb

Syntax

AdminDlgRestoreData(REF adminData:AdminDataRec);

Parameters

adminData - data return value

Returns

1 = success

0 = failure

Side Effects

None

Description

This function restores the dialog box data associated with this module from a file or database.

Dialog Forms Called

None


AdminDlgSaveData

File Name

ema_admn.kb

Syntax

AdminDlgSaveData(REF adminData:AdminDataRec);

Parameters

adminData - data return value

Returns

1 = success

0 = failure

Side Effects

None

Description

This function saves the dialog box data associated with this module into a persistent form (for instance, a database or file).

Dialog Forms Called

None


AdminEnableControls

File Name

ema_admn.kb

Syntax

AdminEnableControls(VAL enableControls:BOOLEAN, VAL msgString:STRING);

Parameters

enableControls - TRUE (enable) or FALSE (disable)

msgString - string to write to the message line in the box.

Nothing is written if this is $Unknown.

Returns

1 = success

0 = failure

Side Effects

None

Description

This function enables or disables the user controls and outputs a string to the message line (if there is one).

Dialog Forms Called

None


AdminEventHandler

File Name

ema_admn.kb

Syntax

AdminEventHandler(REF adminDlgData:AdminDialogRec);

Parameters

adminDlgData - instance data for this dialog box type

Returns

1 = success

0 = failure return codes from DlgSetEnabled

Side Effects

None

Description

This routine provides event handling for the Administration dialog box.

Dialog Forms Called

None


AdminGetData

File Name

ema_admn.kb

Syntax

AdminGetData(REF adminData:AdminDataRec);

Parameters

adminData - data return value

Returns

1 = success

n = return values for AdminInitData

Side Effects

None

Description

This function gets the dialog data associated with this module.

Dialog Forms Called

None


AdminGetListData

File Name

ema_admn.kb

Syntax

AdminGetListData(REF adminListData:AdminListDataRec);

Parameters

adminListData - list of admin (and count/current)

Returns

1 = success

0 = list structure not filled in, or list is empty.

Side Effects

None

Description

This function retrieves the administrator list data from the private AdminDataRec.

Dialog Forms Called

None


AdminInitData

File Name

ema_admn.kb

Syntax

AdminInitData;

Parameters

None

Returns

1 = success

0 = failure

Side Effects

None

Description

This function initializes the module data structure with information in the static data record.

Dialog Forms Called

None


AdminLBAddAction

File Name

ema_admn.kb

Syntax

AdminLBAddAction(REF adminLBData:AdminDialogRec, VAL updateDB:BOOLEAN);

Parameters

adminLBData - data record handle

updateDB - indicates whether to save operation

Returns

1 = success

0 = failed to insert because item is already there

-1 = key field is empty (no addition)

-n = failed to add to database (no GUI update) (See database codes.)

Side Effects

None

Description

This function performs the "Add to list box" function. It takes the contents of the current data fields, insert a new record in the list box, insert a new matching internal record into the rows data structure, and sets the current variables appropriately.

Dialog Forms Called

None


AdminLBDeleteAction

File Name

ema_admn.kb

Syntax

AdminLBDeleteAction(REF adminLBData:AdminDialogRec, VAL updateDB:BOOLEAN);

Parameters

adminLBData - data record handle

updateDB - indicates whether to save operation

Returns

1 = success

0 = list is empty

-1 = failed to update internal selection after DB/GUI operation

-n = failed to delete from database (no GUI update). (See DB codes.)

Side Effects

None

Description

This function performs a delete function for the current selected item in the list.

Dialog Forms Called

None


AdminLBEnter2ndaryFieldAction

File Name

ema_admn.kb

Syntax

AdminLBEnter2ndaryFieldAction(REF adminLBData:AdminDialogRec, VAL fieldname:STRING);

Parameters

adminLBData - data record handle

fieldname - fieldname that has been selected

Returns

1 = success

2 = list was empty

0 = failure return codes from DlgSetEnabled

-n = failure return codes from DlgSetEnabled

Side Effects

None

Description

This function enables the Modify button for entry into non-key fields in the GUI.

Dialog Forms Called

None


AdminLBEnterKeyFieldAction

File Name

ema_admn.kb

Syntax

AdminLBEnterKeyFieldAction(REF adminLBData:AdminDialogRec, VAL fieldname:STRING);

Parameters

adminLBData - data record handle

fieldname - fieldname that has been selected

Returns

1 = success

0 = failure return codes from DlgSetEnabled

-n = failure return codes from DlgSetEnabled

Side Effects

None

Description

This function responds to a movement of focus to a primary key field in the GUI.

Dialog Forms Called

None


AdminLBModifyAction

File Name

ema_admn.kb

Syntax

AdminLBModifyAction(REF adminLBData:AdminDialogRec, VAL updateDB:BOOLEAN);

Parameters

adminLBData - data record handle

updateDB - indicates whether to save operation

Returns

1 = success

0 = either list is empty, no selection, no field modified, or user refused to modify

-1 = failure, attempt to supply empty (null) value for key

-n = failed to update database row (no GUI update) (See database codes.)

Side Effects

None

Description

This function performs a modify function for the current selected item in the list. It assumes that the appropriate lists (GUI list box, KML list, DB list) are already positioned at the current item.

Dialog Forms Called

None


AdminLBMsgSelectHandler

File Name

ema_admn.kb

Syntax

AdminLBMsgSelectHandler(REF adminLBData:AdminDialogRec, VAL fieldname:STRING, VAL updateDB:BOOLEAN);

Parameters

adminLBData - data record handle

fieldname - fieldname that has been selected

updateDB - indicates whether to save operation

Returns

1 = success

2 = not one of the recognized controls, keep processing

-n = failure code returned by one of the Action routines

Side Effects

None

Description

This function should be called from an event handler for a $MsgSelect event on buttons and the listbox.

Dialog Forms Called

None


AdminLBSelectAction

File Name

ema_admn.kb

Syntax

AdminLBSelectAction(REF adminLBData:AdminDialogRec);

Parameters

adminLBData - data record handle

Returns

1 = success

0 = failure

Side Effects

None

Description

This function is called when a new item has been selected in a list box.

Dialog Forms Called

None


AdminSaveData

File Name

ema_admn.kb

Syntax

AdminSaveData;

Parameters

None

Returns

1 = success

0 = failure

Side Effects

None

Description

This function saves the dialog box data associated with this module into a file or database.

Dialog Forms Called

None


AdminSetData

File Name

ema_admn.kb

Syntax

AdminSetData(REF adminData:AdminDataRec);

Parameters

adminData - data return value

Returns

1 = success

0 = failure

Side Effects

None

Description

This function sets the dialog box data associated with this module.

Dialog Forms Called

None


AdminShutDown

File Name

ema_admn.kb

Syntax

AdminShutDown(VAL callerStatus:INTEGER);

Parameters

callerStatus - caller's shutdown status.

(If caller is closing down due to internal problems, then this module should abort.)

Returns

1 = success

0 = failure

Side Effects

None

Description

This function performs the final operations for this module in the expectation that the calling application is shutting down.

Dialog Forms Called

None


ModuleTestEventHandler

File Name

ema_admn.kb

Syntax

ModuleTestEventHandler( REF moduleTestData: ModuleTestRec );

Parameters

ModuleTestData - instance data for this dialog box type

Returns

1 = success

0 = failure

Side Effects

None

Description

This routine provides event handling for the Module Test dialog box.

Dialog Forms Called

None


RefreshListBoxFromData

File Name

ema_admn.kb

Syntax

RefreshListBoxFromData(REF adminLBData:AdminDialogRec);

Parameters

adminLBData - data record handle

Returns

1 = success

0 = failure

-n = failure code from database action

Side Effects

None

Description

This function transfers the information stored in the data structure rows into the list box. The box is cleared before insertion.

Dialog Forms Called

None


TransferRowToGUIFields

File Name

ema_admn.kb

Syntax

TransferRowToGUIFields(REF adminLBData:AdminDialogRec);

Parameters

adminLBData - data record handle

Returns

1 = success

0 = failure

-n = failure code from database action

Side Effects

None

Description

This function transfers the information stored in the current row into the various matching GUI fields. If there is no current row, then it clears the fields.

Dialog Forms Called

None