Componentes.Terceros.RemObj.../internal/5.0.23.613/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.pas
david 2824855ea7 - Modificación del paquete RemObjects_Core_D10 para que sea un paquete de runtime/designtime (antes era designtime sólo)
- 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
2007-09-10 14:06:19 +00:00

85 lines
2.5 KiB
ObjectPascal

unit NewService_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,
{Ancestor Implementation:} DataAbstractService_Impl,
{Used RODLs:} DataAbstract4_Intf,
{Generated:} QuantumGrid4Library_Intf, uDAScriptingProvider, uDABusinessProcessor,
uDAClasses, uDADataStreamer, uDABinAdapter;
const
{ Dataset names for Schema }
ds_Customers = 'Customers';
ds_Orders = 'Orders';
ds_AllOrders = 'AllOrders';
type
{ TNewService }
TNewService = class(TDataAbstractService, INewService)
BinAdapter: TDABinDataStreamer;
bsCustomers: TDABusinessProcessor;
bsOrders: TDABusinessProcessor;
Schema: TDASchema;
DataDictionary: TDADataDictionary;
bsAllOrders: TDABusinessProcessor;
private
protected
{ INewService methods }
function GetCustomers: Binary;
function UpdateCustomers(const IncomingData: Binary): Binary;
function GetOrders(const CustomerID: String): Binary;
end;
implementation
{$R *.dfm}
uses
{Generated:} QuantumGrid4Library_Invk, QuantumGrid4_ServerData, uDAInterfaces;
procedure Create_NewService(out anInstance : IUnknown);
begin
anInstance := TNewService.Create(NIL);
end;
{ TNewService }
function TNewService.GetCustomers: Binary;
begin
result := Binary.Create;
BinAdapter.Initialize(result, aiWrite);
BinAdapter.WriteDataset(Schema.NewDataset(Connection, ds_Customers), [woRows]);
BinAdapter.Finalize;
end;
function TNewService.GetOrders(const CustomerID: String): Binary;
begin
result := Binary.Create;
BinAdapter.Initialize(result, aiWrite);
BinAdapter.WriteDataset(Schema.NewDataset(Connection, ds_Orders,['CustomerID'], [CustomerID]), [woRows]);
BinAdapter.Finalize;
end;
function TNewService.UpdateCustomers(const IncomingData: Binary): Binary;
begin
result := UpdateData(IncomingData);
end;
initialization
TROClassFactory.Create('NewService', Create_NewService, TNewService_Invoker);
finalization
end.