81 lines
2.5 KiB
ObjectPascal
81 lines
2.5 KiB
ObjectPascal
unit srvConfiguracion_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:} FactuGES_Intf, uDAClasses, uDAScriptingProvider,
|
|
uDABusinessProcessor, uDADataTable, uDABINAdapter, uDADataStreamer,
|
|
uDABin2DataStreamer;
|
|
|
|
|
|
type
|
|
{ TsrvConfiguracion }
|
|
TsrvConfiguracion = class(TDataAbstractService, IsrvConfiguracion)
|
|
schConfiguracion: TDASchema;
|
|
Bin2DataStreamer: TDABin2DataStreamer;
|
|
procedure DARemoteServiceCreate(Sender: TObject);
|
|
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
|
|
var aConnectionName: string);
|
|
protected
|
|
{ IsrvConfiguracion methods }
|
|
function DarValor(const CODIGO: String): String;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
uses
|
|
{Generated:} FactuGES_Invk, uDAInterfaces, uDataModuleServer, Variants,
|
|
uROClasses;
|
|
|
|
procedure Create_srvConfiguracion(out anInstance : IUnknown);
|
|
begin
|
|
anInstance := TsrvConfiguracion.Create(NIL);
|
|
end;
|
|
|
|
{ srvConfiguracion }
|
|
procedure TsrvConfiguracion.DARemoteServiceCreate(Sender: TObject);
|
|
begin
|
|
SessionManager := dmServer.SessionManager;
|
|
end;
|
|
|
|
function TsrvConfiguracion.DarValor(const CODIGO: String): String;
|
|
var
|
|
ADataSet : IDADataset;
|
|
begin
|
|
try
|
|
ADataSet := schConfiguracion.NewDataset(Connection, 'darValor', ['CODIGO'], [CODIGO]);
|
|
ADataSet.Open;
|
|
if ADataSet.Dataset.RecordCount > 0 then
|
|
Result := ADataSet.Dataset.Fields[0].AsVariant
|
|
else
|
|
RaiseError('Falta variable de configuracion: ' + CODIGO);
|
|
finally
|
|
ADataSet.Close;
|
|
end;
|
|
end;
|
|
|
|
procedure TsrvConfiguracion.DataAbstractServiceBeforeAcquireConnection(
|
|
aSender: TObject; var aConnectionName: string);
|
|
begin
|
|
ConnectionName := dmServer.ConnectionName;
|
|
end;
|
|
|
|
initialization
|
|
TROClassFactory.Create('srvConfiguracion', Create_srvConfiguracion, TsrvConfiguracion_Invoker);
|
|
|
|
finalization
|
|
|
|
end.
|