Namespace: Consultingwerk.SmartComponents.Implementation
Class 
SmartDataObjectAdapter Copy to Clipboard
Parent classes:
Inherits: Consultingwerk.SmartComponents.Base.SmartDataAdapter
Implements: Consultingwerk.SmartComponents.Interfaces.Design.IDesignDataSource, Consultingwerk.SmartComponents.Interfaces.Design.IDesignDataTarget, ICustomTypeDescriptor, IHasDesignerVerbs, Consultingwerk.SmartComponents.Interfaces.ISmartDataSource, Consultingwerk.SmartComponents.Interfaces.ISmartDataTarget, Consultingwerk.SmartComponents.Interfaces.ISmartNavigationTarget, System.ComponentModel.ISupportInitialize

File:SmartDataObjectAdapter
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Sun May 31 10:03:56 CEST 2009



Top Method Summary
Options Name Purpose
LOGICAL AssignQuerySelection (character, character, character) Assigns selection criteria to the query and distributes the column/value pairs to the corresponding buffer's where-clause. Each buffer's expression will always be embedded in parenthesis.
CancelCreateRowHandler (Object, CancelCreateRowEventArgs) Event Handler for the CancelCreateRow event of the ProBindingSource
CloseQuery () Empties the result set of this SmartDataAdapter. Used to clear grids
CreateRowHandler (Object, CreateRowEventArgs) Handler for the CreateRow event of the ProBindingSource
DeleteRow () Deletes the current row.
DesignerOpenSmartDataObject ()
DestroySmartDataObject () Destroys the SmartDataObject instance
LOGICAL FetchLast () This Method moves to the last DataRow inside the BindingSource. It is called by The Navigation Tools of the Toolbars. Enforced by Interface ISmartNavigationTarget.
CHARACTER GetFieldValues (character) Returns a CHR(1) delimited list of field values from the DataSource
CHARACTER GetRecordPosition () Evaluates the current record position property value
GetSmartDataObjectError () Formats Error message returned from the SmartDataObject using the SmartDataObject error class Error messages are returned using the fetchMessages API
InitializeSmartDataObject () Initializes the SmartDataObject by running initializeObject
LaunchSmartDataObject () Launches the SmartDataObject associated with this Data Adapter instance
OffEndHandler (Object, OffEndEventArgs) Event handler for the OffEnd event of the ProBindingSource object
OnVerbClicked (character) Event Handler method for Designer Verbs
LOGICAL OpenQuery () Opens the SmartDataObjects Query by calling RetrieveData
ParentPositionChanged (Object, EventArgs) This Method is invoked by the ParentPositionChangedBase Event Handler of the SmartDataAdapters base class when the PositionChanged Event of the SmartDataSources BindingSource is fired.
PositionChangedHandler (Object, EventArgs) Handler for the PositionChanged event of the BindingSource attached to this SmartDataAdapter instance.
LOGICAL RemoveQuerySelection (character, character) Remove field expression(s) for specified column(s) and operator(s) added by assignQuerySelection from the query.
LOGICAL RetrieveData () Retrieves data from the SmartDataObject and binds the RowObject temp-table to a ProBindingSource
SetDesignerProperties () Sets Properties to customize Visual Designer behavior
UpdateRow () UpdateRow submits the changes to a buffer into the using the SmartDataObject API Called by a DataTarget when it's required to save data. * Enforced by Interface ISmartDataSource.

Top Constructor Summary
Options Name Purpose
SmartDataObjectAdapter () Constructor for the SmartDataObjectAdapter class
SmartDataObjectAdapter (IContainer) Constructor for the SmartDataObjectAdapter class

Top Property Summary
Options Name Purpose
LOGICAL AddingRecord
CHARACTER AddRowIdent
INTEGER BatchSize
HANDLE DataHandle
CHARACTER ForeignFields
LOGICAL OpenSmartDataObject
HANDLE RowObject
INTEGER RowsToBatch
HANDLE SmartDataObjectHandle
LOGICAL SmartDataObjectInitialized
CHARACTER SmartDataObjectName


Method Detail
Top

LOGICAL AssignQuerySelection (character, character, character)

Purpose: Assigns selection criteria to the query and distributes the
column/value pairs to the corresponding buffer's where-clause.
Each buffer's expression will always be embedded in parenthesis.
Notes: Calls assignQuerySelection in the SmartDataObject
Can be called before initialization, but the alternative string
operator is not supported before the object is initialized.
(datatype is not known)
- This procedure is designed to be called several times to build up
the the query's where clause
(storing intermediate results in the QueryString property) before
it is finally used in a Query-Prepare method.
- openDataQuery takes care of the preparation of the QueryString
property.
- The QueryColumns property is used to ensure that each column and
operator only will be added once to the QueryString. The property is
also used to store the offset and length of the corresponding values.

Parameters:
pcColumns CHARACTER
Column names (Comma separated), Fieldname of a table in the query in the form of TBL.FLDNM or DB.TBL.FLDNM (only if qualified with db is specified), (RowObject.FLDNM should be used for SDO's) If the fieldname isn't qualified it checks the tables in the TABLES property and assumes the first with a match.
pcValues CHARACTER
Corresponding Values (CHR(1) separated)
pcOperators CHARACTER
Operator one for all columns, blank - defaults to EQ, Use slash to define alternative string operator EQ/BEGINS etc., comma separated for each column/value
Returns LOGICAL
Return value from ADM2 assignQuerySelection, always TRUE
Top

CancelCreateRowHandler (Object, CancelCreateRowEventArgs)

Purpose: Event Handler for the CancelCreateRow event of the ProBindingSource
Notes: Comments from cancelRow in data.p:
cancelRow calls doUndoUpdate which restores the original values
of a modified row from the RowObjUpd record then deletes the
RowObjUdp record. In the case of newMode, the new
RowObject is deleted and doUndoUpdate repositions the
RowObject temp-table to what was previously the current row.

Parameters:
sender System.Object
The reference to the System.Object that raised the event
args Progress.Data.CancelCreateRowEventArgs
The CAncelCreateRowEventArgs with the data for this event
Top

CloseQuery ()

Purpose: Empties the result set of this SmartDataAdapter. Used to clear grids
Notes: Empty the RowObject temp-table and reopens the query

Top

CreateRowHandler (Object, CreateRowEventArgs)

Purpose: Handler for the CreateRow event of the ProBindingSource
Notes: Comments from addRow in data.p:
Creates a new RowObject temp-table record, initializes it, and
returns CHR(1) delimited list of values for the requested
columns (in pcViewColList) of the new RowObject row.
The first entry in the list is the RowObject ROWID and db RowIds
separated with commas. (The db Rowids are blank as the record
has not been created)

Parameters:
sender System.Object
The reference to the System.Object that raised the event
args Progress.Data.CreateRowEventArgs
The reference to the CreateRowEventArgs instance with the data for this event
Top

DeleteRow ()

Purpose: Deletes the current row.
Notes:

Top

DesignerOpenSmartDataObject ()

Purpose:
Notes:

Top

DestroySmartDataObject ()

Purpose: Destroys the SmartDataObject instance
Notes:

Top

LOGICAL FetchLast ()

Purpose: This Method moves to the last DataRow inside the BindingSource.
It is called by The Navigation Tools of the Toolbars.
Enforced by Interface ISmartNavigationTarget.
Notes: Local override that allows to fetch the last batch from the SDO
before moving the BindingSource

Returns LOGICAL
Logical value, currently not used
Top

CHARACTER GetFieldValues (character)

Purpose: Returns a CHR(1) delimited list of field values from the
DataSource
Notes: Uses SDO function colValues

Parameters:
pcFields CHARACTER
The comma delimited list of fields to return
Returns CHARACTER
The CHR(1) delimited list of field values
Top

CHARACTER GetRecordPosition ()

Purpose: Evaluates the current record position property value
Notes: Translates QueryPosition from SDO to RecordPosition property

Returns CHARACTER
The current record position as a CHARACTER representing an RecordPositionEnum value
Top

GetSmartDataObjectError ()

Purpose: Formats Error message returned from the SmartDataObject using
the SmartDataObject error class
Error messages are returned using the fetchMessages API
Notes: THROWS SmartDataObjectValidationError

Top

InitializeSmartDataObject ()

Purpose: Initializes the SmartDataObject by running initializeObject
Notes: PROTECTED method can be overridden in a child class, to add
customization

Top

LaunchSmartDataObject ()

Purpose: Launches the SmartDataObject associated with this Data Adapter
instance
Notes: Original code is in constructObject in adm2/containr.p

Top

OffEndHandler (Object, OffEndEventArgs)

Purpose: Event handler for the OffEnd event of the ProBindingSource object
Notes: Overrides OffEndHandler in SmartDataAdapter base class

Parameters:
sender System.Object
The reference to the object that raised the event
e Progress.Data.OffEndEventArgs
The OffEndEventArgs with the data for the event
Top

OnVerbClicked (character)

Purpose: Event Handler method for Designer Verbs
Notes: This method is intended to be overridden

Parameters:
pcVerbText CHARACTER
The text indicating the verb that was clicked
Top

LOGICAL OpenQuery ()

Purpose: Opens the SmartDataObjects Query by calling RetrieveData
Notes:

Returns LOGICAL
Logical value indicating the success of the method
Top

ParentPositionChanged (Object, EventArgs)

Purpose: This Method is invoked by the ParentPositionChangedBase Event Handler
of the SmartDataAdapters base class when the PositionChanged Event of
the SmartDataSources BindingSource is fired.
Notes: Refresh Data when a new line is selected inside the Parent
SmartDataSource.

Parameters:
sender System.Object
The reference to the object that raised the event
e System.EventArgs
The System.EventArgs with the data for this event
Top

PositionChangedHandler (Object, EventArgs)

Purpose: Handler for the PositionChanged event of the BindingSource attached
to this SmartDataAdapter instance.
Notes: The current RecordPosition is passed to the SmartNavigationSource.

Parameters:
sender System.Object
The reference to the object that raised the event
e System.EventArgs
The System.EventArgs with the data for this event
Top

LOGICAL RemoveQuerySelection (character, character)

Purpose: Remove field expression(s) for specified column(s) and operator(s)
added by assignQuerySelection from the query.
Notes: This procedure modifies the QueryString property.
openQuery will prepare the query using this property.
The removal of the actual field expression is done by the help
of the position and length stored in the QueryColumns property.

Parameters:
pcColumns CHARACTER
Column names (Comma separated)
pcOperators CHARACTER
Operator - one for all columns, blank - defaults to (EQ), Use slash to define alternative string operator, EQ/BEGINS etc.., comma separated for each column/value
Returns LOGICAL
Return value from ADM2 removeQuerySelection, always TRUE
Top

LOGICAL RetrieveData ()

Purpose: Retrieves data from the SmartDataObject and binds the RowObject
temp-table to a ProBindingSource
Notes:

Returns LOGICAL
Logical value indicating the success of the method
Top

SetDesignerProperties ()

Purpose: Sets Properties to customize Visual Designer behavior
Notes:

Top

UpdateRow ()

Purpose: UpdateRow submits the changes to a buffer into the using the
SmartDataObject API
Called by a DataTarget when it's required to save data.
Enforced by Interface ISmartDataSource.
Notes: Do NOT call SUPER:UpdateRow() in the overriding method.
Parameters required for submitRow in data.p:
INPUT pcRowIdent - "key" with row to update.
The RowObject ROWID, typically derived from the visual
DataTarget's RowIdent property, which often also
has an additional list of the ROWID(s) of the db
record(s). This appended list is not used here and is thus
not required.
- ? indicates current record.
INPUT pcValueList - CHR(1) delimited list of alternating column names
and values to be assigned.



Constructor Detail
Top

SmartDataObjectAdapter ()

Purpose: Constructor for the SmartDataObjectAdapter class
Notes:

Top

SmartDataObjectAdapter (IContainer)

Purpose: Constructor for the SmartDataObjectAdapter class
Notes:

Parameters:
poContainer System.ComponentModel.IContainer
The System.ComponentModel.IContainer used as the Container for this component


Property Detail
Top

LOGICAL AddingRecord


Returns LOGICAL
Top

CHARACTER AddRowIdent


Returns CHARACTER
Top

INTEGER BatchSize


Returns INTEGER
Top

HANDLE DataHandle


Returns HANDLE
Top

CHARACTER ForeignFields


Returns CHARACTER
Top

LOGICAL OpenSmartDataObject


Returns LOGICAL
Top

HANDLE RowObject


Returns HANDLE
Top

INTEGER RowsToBatch


Returns INTEGER
Top

HANDLE SmartDataObjectHandle


Returns HANDLE
Top

LOGICAL SmartDataObjectInitialized


Returns LOGICAL
Top

CHARACTER SmartDataObjectName


Returns CHARACTER


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       13.04.2026 10:23:35