CLASS openedge.tutorial.ui.purchaseOrderForm INHERITS Form IMPLEMENTS
IUpdatable : DEF PRIVATE VAR fRecordState AS CHARACTER NO-UNDO. DEF PRIVATE VAR components AS System.ComponentModel.IContainer. DEF PRIVATE VAR fServiceAdapter AS openedge.tutorial.services.ServiceAdapter NO-UNDO. |
METHOD PUBLIC VOID AddRecord():
fServiceAdapter:addRecord (bindingSource1:Handle:get-buffer-handle('ePurchaseOrder')). fRecordState = 'ADD':u. btnSave:Enabled = TRUE. btnCancel:Enabled = TRUE. END METHOD. METHOD PUBLIC VOID DeleteRecord(): fServiceAdapter:removeRecord (bindingSource1:Handle:get-buffer-handle('ePurchaseOrder')). fServiceAdapter:SaveData(). bindingSource1:RefreshAll(). END METHOD. METHOD PUBLIC VOID SaveRecord(): IF fRecordState NE '':u OR bindingSource1:RowModified THEN DO: IF bindingSource1:RowModified THEN bindingSource1:Assign(). fServiceAdapter:SaveData(). btnSave:Enabled = FALSE. btnCancel:Enabled = FALSE. END. END METHOD. METHOD PUBLIC VOID CancelUpdate(): fRecordState = '':u. fServiceAdapter:CancelUpdate (bindingSource1:Handle:get-buffer-handle('ePurchaseOrder')). bindingSource1:RefreshAll(). btnSave:Enabled = FALSE. btnCancel:Enabled = FALSE. END METHOD. |