-
Notifications
You must be signed in to change notification settings - Fork 11
/
CustomDataSetParams.pas
50 lines (40 loc) · 1.02 KB
/
CustomDataSetParams.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
unit CustomDataSetParams;
interface
uses
ParamManager,
Data.DB,
Datasnap.DBClient;
type
TCustomDataSetParams = class(TCustomRemoteParams)
public
function CreateParamItem: TParamItem; override;
procedure Refresh; override;
function DataSet: TClientDataSet; virtual; abstract;
function CompanyField: TField; virtual;
function UserField: TField; virtual;
function BlobField: TBlobField; virtual; abstract;
function NameField: TField; virtual; abstract;
function ValueField: TField; virtual; abstract;
end;
implementation
uses
DataSetParamItem,
System.SysUtils;
function TCustomDataSetParams.CompanyField: TField;
begin
Result := nil;
end;
function TCustomDataSetParams.CreateParamItem: TParamItem;
begin
Result := TDataSetParamItem.Create(Self);
end;
procedure TCustomDataSetParams.Refresh;
begin
if (DataSet <> nil) and DataSet.Active and (DataSet.ChangeCount = 0) then
DataSet.Refresh;
end;
function TCustomDataSetParams.UserField: TField;
begin
Result := nil;
end;
end.