You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use code snippets to build new sample project: 03-datamodule
procedureTDataModule1.OnCreate(Sender: TObject);
begin
fOrdersProxy := TOrdersProxy.Create(fOwner);
fOrdersDataSource := fOrdersProxy.ConstructDataSource;
end;
procedureTDataModule1.InitOrders(aYear, aMonth: word);
begin
fOrdersProxy.WithFiredacSQL( FDConnection1,
'SELECT OrderID, CustomerID, OrderDate, Freight' +
' FROM {id Orders} WHERE OrderDate between' +
' :StartDate and :EndDate',
[ GetMonthStart(aYear, aMonth),
GetMonthEnd(aYear, aMonth) ],
[ftDate, ftDate])
.Open;
fOrdersInitialized := True;
end;
procedureTDataModule1.InitOrders(aDataSet: TDataSet);
begin
fOrdersProxy.WithDataSet(aDataSet).Open;
fOrdersInitialized := True;
end;
functionTDataModule.CalculateTotalOrders (const aCustomerID: string): Currency;
begin
Result := 0;
procedureForEach(OnElem: TProc);
fOrdersProxy.ForEach(procedure
beginif fOrdersProxy.CustomerID.Value = aCustomerID then
Result := Result + fOrdersProxy.GetTotalOrderValue;
end;
end;
The text was updated successfully, but these errors were encountered:
Use code snippets to build new sample project:
03-datamodule
The text was updated successfully, but these errors were encountered: