unit srvInventario_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:} uDABusinessProcessor, uDABin2DataStreamer, uDADataStreamer,
  uDAScriptingProvider, uDAClasses,
  FactuGES_Intf, uDAInterfaces;

type
  { TsrvInventario }
  TsrvInventario = class(TDataAbstractService, IsrvInventario)
    bpInventario: TDABusinessProcessor;
    Bin2DataStreamer: TDABin2DataStreamer;
    bpReservas: TDABusinessProcessor;
    schInventario: TDASchema;
    DataDictionary: TDADataDictionary;
    procedure DARemoteServiceAfterGetDatasetData(const Dataset: IDADataset;
      const IncludeSchema: Boolean; const MaxRecords: Integer);
    procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
      var aConnectionName: string);
  end;

implementation

{$R *.dfm}
uses
  {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
  schInventarioClient_Intf, uRestriccionesUsuarioUtils;

procedure Create_srvInventario(out anInstance : IUnknown);
begin
  anInstance := TsrvInventario.Create(NIL);
end;

{ srvInventario }
procedure TsrvInventario.DARemoteServiceAfterGetDatasetData(
  const Dataset: IDADataset; const IncludeSchema: Boolean;
  const MaxRecords: Integer);
begin
{
  if DataSet.Name = nme_Inventario then
  begin
    { Aquí se asegura que el usuario sólo accede a los Articulos
      de las empresas a las que tiene permiso para acceder
      filtrando DataSet por ID_EMPRESA. }
{    FiltrarAccesoUsuario(Session, Connection, schInventario, DataSet, fld_InventarioID_EMPRESA);
  end;
}  
end;

procedure TsrvInventario.DataAbstractServiceBeforeAcquireConnection(
  aSender: TObject; var aConnectionName: string);
begin
  ConnectionName := dmServer.ConnectionName;
end;

initialization
  TROClassFactory.Create('srvInventario', Create_srvInventario, TsrvInventario_Invoker);

finalization

end.
