of_update


pfcapsrv.pbl   >   pfc_n_cst_tvsrv_levelsource   >   of_update   

Full name pfc_n_cst_tvsrv_levelsource.of_update
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_update(ref n_ds[],integer,boolean,boolean,boolean)

Name Datatype
No Data

Name Datatype
lb_accepttext boolean
lb_resetflag boolean
li_i integer
li_max integer
ls_sqlspyheading String
ls_sqlspymessage String

protected function integer of_update (ref n_ds ads_updatearray[], integer ai_direction, boolean ab_insert, boolean ab_update, boolean ab_delete);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_Update
//
//	Access:    		Protected
//
//	Arguments: 		
//	ads_updatearray[]	Array of treeview datastores to be updated
//	ai_direction		Direction to perform updates in (topdown or bottomup)
//	ab_insert			True if we need to perform insert SQL statements
//	ab_update			True if we need to perform update SQL statements
//	ab_delete			True if we need to perform delete SQL statements
//
//	Returns:   		Integer
//   					1 if it succeeds and -1 if an error occurs.
//
//	Description:  Updates the datawindows in the linked chain of tree levels
//
//	   Note: This function is not typically called by the developer.  
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
boolean	lb_accepttext = False
boolean 	lb_resetflag = False
integer	li_i, li_max
String	ls_sqlspyheading
String	ls_sqlspymessage

IF IsNull(itv_requestor) or Not Isvalid(itv_requestor) Then Return -1

//If available notify the SQLSpy service.
If IsValid(gnv_app.inv_debug) Then
	If IsValid(gnv_app.inv_debug.inv_sqlspy) Then

		//Create the heading and message for the SQLSpy.
		ls_sqlspyheading = itv_requestor.ClassName() + '.Levelsource'
		ls_sqlspymessage = 'Smart Update - '
		Choose Case ai_direction
			Case TOPDOWN
				ls_sqlspymessage = ls_sqlspymessage + 'TOPDOWN: '
			Case BOTTOMUP
				 ls_sqlspymessage = ls_sqlspymessage + 'BOTTOMTOP: '
		End Choose
		If ab_insert Then
			ls_sqlspymessage = ls_sqlspymessage + 'Insert '
		End If
		If ab_update Then
			ls_sqlspymessage = ls_sqlspymessage + 'Update '
		End If
		If ab_delete Then
			ls_sqlspymessage = ls_sqlspymessage + 'Delete '
		End If
		
		//Send the information to the service for processing.
		gnv_app.inv_debug.inv_sqlspy.of_sqlSyntax  &
			(ls_sqlspyheading, '/*** ' + ls_sqlspymessage + ' ***/')
	End If
End If

li_max = upperbound(ads_updatearray)
Choose Case ai_direction
	Case TOPDOWN
		// update from first to last
		For li_i = 1 to li_max
			If ads_updatearray[li_i].of_Update &
				(lb_accepttext, lb_resetflag, ab_insert, ab_update, ab_delete) <> 1 Then 
				Return FAILURE
			End If
		Next 
		Return 1
	Case BOTTOMUP
		// update from last to first
		For li_i = li_max to 1 Step -1
			If ads_updatearray[li_i].of_Update &
				(lb_accepttext, lb_resetflag, ab_insert, ab_update, ab_delete) <> 1 Then 
				Return FAILURE
			End If
		Next 
		Return 1
End Choose

Return -1
end function

     
Name Owner
pfc_n_cst_tvsrv_levelsource.of_update pfc_n_cst_tvsrv_levelsource

     
Name Owner
powerobject.classname powerobject
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_ds.of_update pfc_n_ds
pfc_n_cst_sqlspy.of_sqlsyntax pfc_n_cst_sqlspy

     
Full name
demopfc

     
Name Scope
No Data