- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10 - Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10 git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
98 lines
3.1 KiB
ObjectPascal
98 lines
3.1 KiB
ObjectPascal
unit OrdersService_Impl;
|
|
|
|
{----------------------------------------------------------------------------}
|
|
{ This unit was automatically generated by the RemObjects SDK after reading }
|
|
{ the RODL file associated with this project . }
|
|
{ }
|
|
{ This is where you are supposed to code the implementation of your objects. }
|
|
{----------------------------------------------------------------------------}
|
|
|
|
interface
|
|
|
|
uses
|
|
{vcl:} Classes, SysUtils,
|
|
{RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
|
|
{Required:} uRORemoteDataModule,
|
|
{Ancestor Implementation:} DataAbstractService_Impl,
|
|
{Used RODLs:} DataAbstract4_Intf,
|
|
{Generated:} MegaDemoLibrary_Intf, uDAClasses, uDADataStreamer,
|
|
uDABinAdapter, uDAScriptingProvider, uDABusinessProcessor;
|
|
|
|
type
|
|
{ TOrdersService }
|
|
TOrdersService = class(TDataAbstractService, IOrdersService)
|
|
bpCustomers: TDABusinessProcessor;
|
|
BinDataStreamer: TDABinDataStreamer;
|
|
Schema: TDASchema;
|
|
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
|
|
var aConnectionName: string);
|
|
private
|
|
protected
|
|
{ IOrdersService methods }
|
|
function GetCustomerOrders(const CustomerID: string): Binary;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
uses
|
|
{Generated:} MegaDemoLibrary_Invk,
|
|
MegaDemoServer_Data, MegaDemoServer_Main;
|
|
|
|
procedure Create_OrdersService(out anInstance: IUnknown);
|
|
begin
|
|
anInstance := TOrdersService.Create(nil);
|
|
end;
|
|
|
|
{ OrdersService }
|
|
|
|
function TOrdersService.GetCustomerOrders(const CustomerID: string): Binary;
|
|
var
|
|
aTableNameArray: StringArray;
|
|
aTableRequestInfoArray: TableRequestInfoArray;
|
|
aTableRequestInfo: TableRequestInfo;
|
|
begin
|
|
// This method reads all the orders of the specified customer and also filters
|
|
// based on the current employee's ID. The employee ID has been previously stored
|
|
// in the session upon the call to LoginService.Login.
|
|
|
|
aTableNameArray := StringArray.Create;
|
|
aTableRequestInfoArray := TableRequestInfoArray.Create;
|
|
try
|
|
aTableNameArray.Add('OrdersByCustomer');
|
|
aTableRequestInfo := aTableRequestInfoArray.Add;
|
|
with aTableRequestInfo do begin
|
|
IncludeSchema := True;
|
|
MaxRecords := -1;
|
|
UserFilter := '';
|
|
with Parameters.Add do begin
|
|
Name := 'CustomerID';
|
|
Value := CustomerID;
|
|
end;
|
|
with Parameters.Add do begin
|
|
Name := 'EmployeeID';
|
|
Value := Session['EmployeeID'];
|
|
end;
|
|
end;
|
|
Result := GetData(aTableNameArray, aTableRequestInfoArray)
|
|
finally
|
|
aTableRequestInfoArray.Free;
|
|
aTableNameArray.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TOrdersService.DataAbstractServiceBeforeAcquireConnection(
|
|
aSender: TObject; var aConnectionName: string);
|
|
begin
|
|
// Reads the connection name from the main form.
|
|
aConnectionName := MegaDemoServer_MainForm.GetSelectedConnectionName;
|
|
end;
|
|
|
|
initialization
|
|
TROClassFactory.Create('OrdersService', Create_OrdersService, TOrdersService_Invoker);
|
|
|
|
finalization
|
|
|
|
end.
|
|
|