unit srvRecibosProveedor_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
  { TsrvRecibosProveedor }
  TsrvRecibosProveedor = class(TDataAbstractService, IsrvRecibosProveedor)
    bpRecibosProveedor: TDABusinessProcessor;
    bpPagosProveedor: TDABusinessProcessor;
    bpRecibosCompensados: TDABusinessProcessor;
    Bin2DataStreamer: TDABin2DataStreamer;
    schRecibosProveedor: TDASchema;
    DADataDictionary: TDADataDictionary;
    procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
      const IncludeSchema: Boolean; const MaxRecords: Integer);
    procedure DARemoteServiceCreate(Sender: TObject);
    procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
  end;

implementation

{$R *.dfm}
uses
  Dialogs,
  {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
  schRecibosProveedorClient_Intf, uRestriccionesUsuarioUtils;
//  uRptRecibosProveedor_Server; //, uBizRecibosProveedorServer;

procedure Create_srvRecibosProveedor(out anInstance : IUnknown);
begin
  anInstance := TsrvRecibosProveedor.Create(NIL);
end;

{ srvRecibosProveedor }

procedure TsrvRecibosProveedor.DARemoteServiceBeforeGetDatasetData(
  const Dataset: IDADataset; const IncludeSchema: Boolean;
  const MaxRecords: Integer);
begin
{
  if DataSet.Name = nme_RecibosProveedor then
  begin
    { Aquí se asegura que el usuario sólo accede a Recibos
      de las empresas a las que tiene permiso para acceder
      filtrando DataSet por ID_EMPRESA. }
{    FiltrarAccesoUsuario(Session, Connection, schRecibosProveedor, DataSet, fld_RecibosProveedorID_EMPRESA);
  end;
}
end;

procedure TsrvRecibosProveedor.DARemoteServiceCreate(Sender: TObject);
begin
  SessionManager := dmServer.SessionManager;
end;

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

initialization
  TROClassFactory.Create('srvRecibosProveedor', Create_srvRecibosProveedor, TsrvRecibosProveedor_Invoker);

finalization

end.
