From: <jfu...@us...> - 2007-11-23 18:51:03
|
Revision: 11590 http://jvcl.svn.sourceforge.net/jvcl/?rev=11590&view=rev Author: jfudickar Date: 2007-11-23 10:50:55 -0800 (Fri, 23 Nov 2007) Log Message: ----------- 0004296: Extending TJvDatabaseInsertAction and TJvDatabaseCopyAction - Updated (Mantis #0004296) Modified Paths: -------------- trunk/jvcl/run/JvDBActions.pas Modified: trunk/jvcl/run/JvDBActions.pas =================================================================== --- trunk/jvcl/run/JvDBActions.pas 2007-11-23 18:48:49 UTC (rev 11589) +++ trunk/jvcl/run/JvDBActions.pas 2007-11-23 18:50:55 UTC (rev 11590) @@ -262,16 +262,21 @@ TJvDatabaseBeforeCopyRecord = procedure(DataSet: TDataSet; var RefreshAllowed: Boolean) of object; TJvDatabaseAfterCopyRecord = procedure(DataSet: TDataSet) of object; - TJvDatabaseCopyAction = class(TJvDatabaseInsertAction) + TJvDatabaseCopyAction = class(TJvDatabaseBaseEditAction) private FBeforeCopyRecord: TJvDatabaseBeforeCopyRecord; FAfterCopyRecord: TJvDatabaseAfterCopyRecord; + FInsertType: TJvDatabaseInsertType; FOnCopyRecord: TJvDatabaseOnCopyRecord; public + constructor Create(AOwner: TComponent); override; procedure CopyRecord; procedure UpdateTarget(Target: TObject); override; procedure ExecuteTarget(Target: TObject); override; published + //1 The property defines that the new record is created via the insert or the append method + property InsertType: TJvDatabaseInsertType read FInsertType write FInsertType + default itInsert; property BeforeCopyRecord: TJvDatabaseBeforeCopyRecord read FBeforeCopyRecord write FBeforeCopyRecord; property AfterCopyRecord: TJvDatabaseAfterCopyRecord read FAfterCopyRecord write FAfterCopyRecord; property OnCopyRecord: TJvDatabaseOnCopyRecord read FOnCopyRecord write FOnCopyRecord; @@ -1065,14 +1070,14 @@ end; end; +//=== { TJvDatabaseInsertAction } ============================================ + constructor TJvDatabaseInsertAction.Create(AOwner: TComponent); begin inherited Create(AOwner); FInsertType := itInsert; end; -//=== { TJvDatabaseInsertAction } ============================================ - procedure TJvDatabaseInsertAction.UpdateTarget(Target: TObject); begin SetEnabled(Assigned(DataSet) and not EngineControlsDisabled and @@ -1090,6 +1095,12 @@ //=== { TJvDatabaseCopyAction } ============================================== +constructor TJvDatabaseCopyAction.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FInsertType := itInsert; +end; + procedure TJvDatabaseCopyAction.UpdateTarget(Target: TObject); begin SetEnabled(Assigned(DataSet) and not EngineControlsDisabled and EngineIsActive and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |