Browse Source

Patch from Luigi Siciliano to implement Action support in TDataLink

git-svn-id: trunk@12395 -
michael 16 years ago
parent
commit
7f068012c8
2 changed files with 21 additions and 0 deletions
  1. 19 0
      packages/fcl-db/src/base/datasource.inc
  2. 2 0
      packages/fcl-db/src/base/db.pas

+ 19 - 0
packages/fcl-db/src/base/datasource.inc

@@ -300,6 +300,25 @@ begin
   end;
   end;
 end;
 end;
 
 
+function TDataLink.ExecuteAction(Action: TBasicAction): Boolean;
+begin
+ if Action.HandlesTarget(DataSource) then
+ begin
+   Action.ExecuteTarget(DataSource);
+   Result := True;
+ end
+ else Result := False;
+end;
+
+function TDataLink.UpdateAction(Action: TBasicAction): Boolean;
+begin
+ if Action.HandlesTarget(DataSource) then
+ begin
+   Action.UpdateTarget(DataSource);
+   Result := True;
+ end
+ else Result := False;
+end;
 
 
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------

+ 2 - 0
packages/fcl-db/src/base/db.pas

@@ -1409,6 +1409,8 @@ type
     destructor Destroy; override;
     destructor Destroy; override;
     function  Edit: Boolean;
     function  Edit: Boolean;
     procedure UpdateRecord;
     procedure UpdateRecord;
+    function ExecuteAction(Action: TBasicAction): Boolean; virtual;
+    function UpdateAction(Action: TBasicAction): Boolean; virtual;
     property Active: Boolean read FActive;
     property Active: Boolean read FActive;
     property ActiveRecord: Integer read GetActiveRecord write SetActiveRecord;
     property ActiveRecord: Integer read GetActiveRecord write SetActiveRecord;
     property BOF: Boolean read GetBOF;
     property BOF: Boolean read GetBOF;