|
pfc_propertyrefreshtable
|
|
Full name
|
pfc_u_tabpg_dwproperty_srvmultitable.pfc_propertyrefreshtable
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
event integer pfc_propertyrefreshtable(string)
|
Name
|
Datatype
|
lb_changespending
|
boolean
|
lb_keycolumn
|
boolean
|
lb_keyinplace
|
boolean
|
lb_newkeycolumn
|
boolean
|
lb_newkeyinplace
|
boolean
|
lb_newupdatecolumn
|
boolean
|
lb_register
|
boolean
|
lb_updatecolumn
|
boolean
|
li_item
|
Integer
|
li_itemcount
|
Integer
|
li_newwhereoption
|
integer
|
li_row
|
Integer
|
li_rowcount
|
Integer
|
li_whereoption
|
integer
|
ls_column
|
string
|
event pfc_propertyrefreshtable;call super::pfc_propertyrefreshtable;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_propertyrefreshtable
//
// Arguments: None
//
// Returns: Integer
// 1 if it succeeds.
// -1 if an error occurs.
//
// Description:
// Refresh the datawindow to match the selected on-screen attribute values.
// Keep track if changes were applied.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_keyinplace, lb_newkeyinplace
boolean lb_register
boolean lb_changespending = False
integer li_whereoption, li_newwhereoption
Integer li_rowcount
Integer li_row
Integer li_itemcount
Integer li_item
string ls_column
boolean lb_keycolumn, lb_newkeycolumn
boolean lb_updatecolumn, lb_newupdatecolumn
// Validate the arguments.
If Len(Trim(as_table)) = 0 Then Return -1
// Filter and Sort just the table related data.
li_rowcount = of_SetData(as_table)
If li_rowcount <= 0 Then Return -1
// Refresh the Register flag.
lb_register = (Upper(ids_data.object.pfc_register.primary[1]) = 'Y')
If lb_register <> cbx_register.Checked Then
lb_changespending = True
If cbx_register.Checked Then
ids_data.object.pfc_register.primary[1] = 'Y'
Else
ids_data.object.pfc_register.primary[1] = 'N'
End If
End If
// Refresh the WhereClause option.
li_whereoption = ids_data.object.pfc_whereoption.primary[1]
If rb_wherekey.Checked Then
li_newwhereoption = 0
ElseIf rb_wherekeyandupd.Checked Then
li_newwhereoption = 1
Else
li_newwhereoption = 2
End If
If li_whereoption <> li_newwhereoption Then
lb_changespending = True
ids_data.object.pfc_whereoption.primary[1] = li_newwhereoption
End If
// Refresh the Key option.
lb_keyinplace = Upper(ids_data.object.pfc_keyinplace.primary[1]) = 'Y'
lb_newkeyinplace = (rb_keydelthenins.Checked)
If lb_keyinplace <> lb_newkeyinplace Then
lb_changespending = True
If rb_keydelthenins.Checked Then
ids_data.object.pfc_keyinplace.primary[1] = 'Y'
Else
ids_data.object.pfc_keyinplace.primary[1] = 'N'
End If
End If
// Refresh the Columns information (both column lists have the same entries & order).
li_itemcount = lb_keycolumns.TotalItems()
For li_item = 1 to li_itemcount
ls_column = lb_keycolumns.Text(li_item)
// Find the corresponding row entry.
li_row = ids_data.Find('pfc_column = "'+Lower(ls_column)+'"', 0, 9999)
If li_row <= 0 Then Return -1
// Refresh the Key columns.
lb_keycolumn = Upper(ids_data.object.pfc_key.primary[li_row]) = 'Y'
lb_newkeycolumn = (lb_keycolumns.State(li_item) = 1)
If lb_keycolumn <> lb_newkeycolumn Then
lb_changespending = True
If lb_newkeycolumn Then
ids_data.object.pfc_key.primary[li_row] = 'Y'
Else
ids_data.object.pfc_key.primary[li_row] = 'N'
End If
End If
// Refresh the Update columns.
lb_updatecolumn = Upper(ids_data.object.pfc_update.primary[li_row]) = 'Y'
lb_newupdatecolumn = (lb_updatecolumns.State(li_item) = 1)
If lb_updatecolumn <> lb_newupdatecolumn Then
lb_changespending = True
If lb_newupdatecolumn Then
ids_data.object.pfc_update.primary[li_row] = 'Y'
Else
ids_data.object.pfc_update.primary[li_row] = 'N'
End If
End If
Next
// Remember if changes were applied.
If lb_changespending Then
ib_changespending = True
End If
Return 1
end event
Name
|
Owner
|
listbox.state |
listbox
|
listbox.text |
listbox
|
listbox.totalitems |
listbox
|
datastore.find |
datastore
|
systemfunctions.len |
systemfunctions
|
systemfunctions.lower |
systemfunctions
|
systemfunctions.trim |
systemfunctions
|
pfc_u_tabpg_dwproperty_srvmultitable.of_setdata |
pfc_u_tabpg_dwproperty_srvmultitable
|