Database Modification
Top  Previous  Next


These functions are used to modify the database. Naturally these should be used with care, since modifications cannot be simply undone, and anything modified through functions is likely to be done without the user knowing it has happened.



(Back to Function Types List)


Function:
   AddRecord   
Result-type:   Record
   
Arguments:   cTable
   
Description:   Creates a new record in the given table and adds it to the database, with blank fields (except the record ID which is automatically generated)   


Function:   AddReservation   
Result-type:   Record
   
Arguments:   rCustomer, rSite
   
Description:   Creates a new reservation record for the given customer on the given site and adds it to the database. The Site may be NullRecord() for unassigned reservations. It's also properly linked to the customer   


Function:   AddTransaction   
Result-type:   Record
   
Arguments:   rCustOrResv
   
Description:   Creates a new transaction record for the given reservation or customer (which can be a NullRecord) and adds it to the database. It's also properly linked to the reservation and/or customer as appropriate   


Function:   DeleteRecord   
Result-type:   Record
   
Arguments:   rRecord
   
Description:   Deletes a record from the database. Note that this won't necessarily delete it 'properly', e.g. any linked references to this record may not be cleaned up. Transactions can be deleted safely (the references from the reservation and/or customer are handled as needed), but be very careful about deleting other record types.   


Function:   LockRecord   
Result-type:   Boolean
   
Arguments:   rRecord
   
Description:   Locks the record for upcoming changes, and returns TRUE if the lock was successful   


Function:   LockSetting   
Result-type:   Boolean
   
Arguments:   cSection, cKey
   
Description:   Locks the global setting (actually its whole section) for upcoming changes, and returns TRUE if the lock was successful   


Function:   LockSettingLocal   
Result-type:   Boolean
   
Arguments:   cSection, cKey [, nWorkstaton]
   
Description:   Locks the local setting (actually its whole section) for upcoming changes, and returns TRUE if the lock was successful. If no workstation number is specified, uses the current workstation number   


Function:   ReadAllSettings   
Result-type:   Boolean
   
Arguments:   (none)
   
Description:   Reads all 'Setting' values , and refreshes the displays -- this is usually required after any SetSetting... functions in order for setting changes to actually take effect.   


Function:   RefreshDisplay   
Result-type:   Boolean
   
Arguments:   (none)
   
Description:   Refreshes the main display (e.g. the current Tab View being displayed). This may need to be used after changing reservation information so the changes are reflected on the Rack, for instance. Always returns True.   


Function:   ReIndexSiteReservations   
Result-type:   Boolean
   
Arguments:   (none)
   
Description:   Rebuilds an internal Site/Reservation index -- this should be called any time the site assigned to a reservation is changed, or a reservation is deleted or added. This does not automatically refresh the screen (use RefreshDisplay). The return value is always True.   


Function:   SetFieldBlank   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName
   
Description:   Sets the given field of a record to 'blank'. Returns TRUE if successful   


Function:   SetFieldBool   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, bValue
   
Description:   Sets the boolean value for the given field of a record. Returns TRUE if successful   


Function:   SetFieldDate   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, dValue
   
Description:   Sets the date value for the given field of a record. Returns TRUE if successful   


Function:   SetFieldText   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, cValue
   
Description:   Sets the text value for the given field of a record. Returns TRUE if successful   


Function:   SetFieldTime   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, dValue
   
Description:   Sets the time value for the given field of a record. Returns TRUE if successful   


Function:   SetFieldValue   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, nValue
   
Description:   Sets the numeric value for the given field of a record. Returns TRUE if successful   


Function:   SetFieldAddLinkedRec   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, rAddRec
   
Description:   Adds a record link to the given linked list field. Returns TRUE if successful   


Function:   SetFieldRemoveLinkedRec   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, rRemoveRec
   
Description:   Removes a record link from the given linked list field. Returns TRUE if successful   


Function:   SetFieldMoveLinkedRecUp   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, rMoveRec
   
Description:   Moves a record link up in the given linked list field. Returns TRUE if successful   


Function:   SetFieldMoveLinkedRecDown   
Result-type:   Boolean
   
Arguments:   rRecord, cFieldName, rMoveRec
   
Description:   Moves a record link down in the given linked list field. Returns TRUE if successful   


Function:   SetSettingBool   
Result-type:   Boolean
   
Arguments:   cSection, cKey, bValue
   
Description:   Sets the boolean value for the given system global setting. Returns TRUE if successful. Note: You may need to use the ReadAllSettings() function (or restart the program) before the new settings take effect.   


Function:   SetSettingLocalBool   
Result-type:   Boolean
   
Arguments:   cSection, cKey, bValue [, nWorkstaton]
   
Description:   Sets the boolean value for the given system local setting. Returns TRUE if successful. If no workstation number is specified, uses the current workstation number. Note: You may need to use the ReadAllSettings() function (or restart the program) before the new settings take effect.   


Function:   SetSettingLocalText   
Result-type:   Boolean
   
Arguments:   cSection, cKey, cValue [, nWorkstaton]
   
Description:   Sets the text value for the given system local setting. Returns TRUE if successful. If no workstation number is specified, uses the current workstation number. Note: You may need to use the ReadAllSettings() function (or restart the program) before the new settings take effect.   


Function:   SetSettingLocalValue   
Result-type:   Boolean
   
Arguments:   cSection, cKey, nValue [, nWorkstaton]
   
Description:   Sets the numeric value for the given system local setting. Returns TRUE if successful. If no workstation number is specified, uses the current workstation number. Note: You may need to use the ReadAllSettings() function (or restart the program) before the new settings take effect.   


Function:   SetSettingText   
Result-type:   Boolean
   
Arguments:   cSection, cKey, cValue
   
Description:   Sets the text value for the given system global setting. Returns TRUE if successful. Note: You may need to use the ReadAllSettings() function (or restart the program) before the new settings take effect.   


Function:   SetSettingValue   
Result-type:   Boolean
   
Arguments:   cSection, cKey, nValue
   
Description:   Sets the numeric value for the given system global setting. Returns TRUE if successful. Note: You may need to use the ReadAllSettings() function (or restart the program) before the new settings take effect.   





Page URL http://CampgroundMaster.com/shelp/databasemodification.html

Campground Master Home