forked from academiadocodigo/TBGWebCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Maps.Dataset.pas
172 lines (146 loc) · 4.03 KB
/
Maps.Dataset.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
unit Maps.Dataset;
interface
uses
Interfaces,
Data.DB,
Generics.Collections;
type
TModelMapsDataset<T : IInterface> = class(TInterfacedObject, iModelMapsDataSet<T>)
private
[weak]
FParent : T;
FDataSet : TDataSet;
FLatName : String;
FLngName : String;
FLabelName : String;
FValueName : String;
FAddressName : String;
FIdAddressName : String;
FInfoName : String;
public
constructor Create(Parent : T);
destructor Destroy; override;
class function New(Parent : T) : iModelMapsDataSet<T>;
function DataSet (Value : TDataSet) : iModelMapsDataSet<T>; overload;
function LatName(Value : String) : iModelMapsDataSet<T>; overload;
function LngName(Value : String) : iModelMapsDataSet<T>; overload;
function LabelName(Value : String) : iModelMapsDataSet<T>; overload;
function ValueName(Value : String) : iModelMapsDataSet<T>; overload;
function AddressName(Value : String) : iModelMapsDataSet<T>; overload;
function IdAddressName(Value : String) : iModelMapsDataSet<T>; overload;
function InfoName(Value : String) : iModelMapsDataSet<T>; overload;
function DataSet : TDataSet; overload;
function LatName : String; overload;
function LngName : String; overload;
function LabelName : String; overload;
function ValueName : String; overload;
function AddressName : String; overload;
function IdAddressName : String; overload;
function InfoName : String; overload;
function &End : T;
end;
implementation
uses
Injection;
{ TModelGenericDataset<T> }
function TModelMapsDataset<T>.AddressName(Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FAddressName := Value;
end;
function TModelMapsDataset<T>.AddressName: String;
begin
Result := FAddressName;
end;
constructor TModelMapsDataset<T>.Create(Parent: T);
begin
{$IF RTLVERSION > 27 }
TInjection.Weak(@FParent, Parent);
{$ELSE}
FParent := Parent;
{$IFEND}
FLatName := 'Lat';
FLngName := 'Lng';
FLabelName := 'Label';
FValueName := 'Value';
FAddressName := 'Address';
FIdAddressName := 'IdAddress';
FInfoName := 'Info';
end;
function TModelMapsDataset<T>.DataSet: TDataSet;
begin
Result := FDataSet;
end;
function TModelMapsDataset<T>.DataSet(Value: TDataSet): iModelMapsDataSet<T>;
begin
Result := Self;
FDataSet := Value;
end;
destructor TModelMapsDataset<T>.Destroy;
begin
inherited;
end;
function TModelMapsDataset<T>.&End: T;
begin
Result :=FParent;
end;
function TModelMapsDataset<T>.IdAddressName(
Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FIdAddressName := Value;
end;
function TModelMapsDataset<T>.IdAddressName: String;
begin
Result := FIdAddressName;
end;
function TModelMapsDataset<T>.InfoName: String;
begin
Result := FInfoName;
end;
function TModelMapsDataset<T>.InfoName(Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FInfoName := Value;
end;
function TModelMapsDataset<T>.LabelName(Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FLabelName := Value;
end;
function TModelMapsDataset<T>.LabelName: String;
begin
Result := FLabelName;
end;
function TModelMapsDataset<T>.LatName(Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FLatName := Value;
end;
function TModelMapsDataset<T>.LatName: String;
begin
Result := FLatName;
end;
function TModelMapsDataset<T>.LngName(Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FLngName := Value;
end;
function TModelMapsDataset<T>.LngName: String;
begin
Result := FLngName
end;
class function TModelMapsDataset<T>.New(Parent: T): iModelMapsDataSet<T>;
begin
Result := Self.Create(Parent);
end;
function TModelMapsDataset<T>.ValueName: String;
begin
Result := FValueName;
end;
function TModelMapsDataset<T>.ValueName(Value: String): iModelMapsDataSet<T>;
begin
Result := Self;
FValueName := Value;
end;
end.