git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@10 93f398dd-4eb6-7a46-baf6-13f46f578da2
111 lines
4.0 KiB
ObjectPascal
111 lines
4.0 KiB
ObjectPascal
unit srvPresupuestosCliente_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
|
||
{ TsrvPresupuestosCliente }
|
||
TsrvPresupuestosCliente = class(TDataAbstractService, IsrvPresupuestosCliente)
|
||
Bin2DataStreamer: TDABin2DataStreamer;
|
||
bpPresupuestosCliente: TDABusinessProcessor;
|
||
bpPresupuestosClienteDetalles: TDABusinessProcessor;
|
||
schPresupuestosCliente: TDASchema;
|
||
DADataDictionary: TDADataDictionary;
|
||
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
|
||
var aConnectionName: string);
|
||
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
||
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
||
procedure DARemoteServiceCreate(Sender: TObject);
|
||
protected
|
||
{ IsrvPresupuestosCliente methods }
|
||
function GenerarInforme(const ListaID: TIntegerArray; const VerLogotipo: Boolean): Binary;
|
||
function GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerLogotipo: Boolean): Binary;
|
||
end;
|
||
|
||
implementation
|
||
|
||
{$R *.dfm}
|
||
uses
|
||
Dialogs, uSistemaFunc, uROClasses,
|
||
{Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils,
|
||
schPresupuestosClienteClient_Intf, uRestriccionesUsuarioUtils,
|
||
uRptPresupuestosCliente_Server,
|
||
uBizPresupuestosClienteServer;
|
||
|
||
procedure Create_srvPresupuestosCliente(out anInstance : IUnknown);
|
||
begin
|
||
anInstance := TsrvPresupuestosCliente.Create(NIL);
|
||
end;
|
||
|
||
{ srvPresupuestosCliente }
|
||
|
||
procedure TsrvPresupuestosCliente.DARemoteServiceBeforeGetDatasetData(
|
||
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
||
const MaxRecords: Integer);
|
||
begin
|
||
if DataSet.Name = nme_PresupuestosCliente then
|
||
begin
|
||
{ Aqu<71> se asegura que el usuario s<>lo accede a presupuestos
|
||
de las empresas a las que tiene permiso para acceder
|
||
filtrando DataSet por ID_EMPRESA. }
|
||
FiltrarAccesoUsuario(Session, Connection, schPresupuestosCliente, DataSet, fld_PresupuestosClienteID_EMPRESA);
|
||
end;
|
||
end;
|
||
|
||
procedure TsrvPresupuestosCliente.DARemoteServiceCreate(Sender: TObject);
|
||
begin
|
||
//SessionManager := dmServer.SessionManager;
|
||
bpPresupuestosCliente.BusinessRulesID := BIZ_SERVER_PRESUPUESTOS_CLIENTE;
|
||
end;
|
||
|
||
procedure TsrvPresupuestosCliente.DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
||
begin
|
||
ConnectionName := dmServer.ConnectionName;
|
||
end;
|
||
|
||
function TsrvPresupuestosCliente.GenerarInforme(const ListaID: TIntegerArray; const VerLogotipo: Boolean): Binary;
|
||
var
|
||
AReportGenerator : TRptPresupuestosCliente;
|
||
begin
|
||
AReportGenerator := TRptPresupuestosCliente.Create(nil);
|
||
try
|
||
Result := AReportGenerator.GenerarPresupuesto(ListaID, VerLogotipo);
|
||
finally
|
||
FreeAndNIL(AReportGenerator);
|
||
end;
|
||
end;
|
||
|
||
function TsrvPresupuestosCliente.GenerarInformeEnPDF(const ListaID: TIntegerArray; const VerLogotipo: Boolean): Binary;
|
||
var
|
||
AReportGenerator : TRptPresupuestosCliente;
|
||
begin
|
||
AReportGenerator := TRptPresupuestosCliente.Create(nil);
|
||
try
|
||
Result := AReportGenerator.GenerarPresupuestoEnPDF(ListaID, VerLogotipo);
|
||
finally
|
||
FreeAndNIL(AReportGenerator);
|
||
end;
|
||
end;
|
||
|
||
initialization
|
||
TROClassFactory.Create('srvPresupuestosCliente', Create_srvPresupuestosCliente, TsrvPresupuestosCliente_Invoker);
|
||
|
||
finalization
|
||
|
||
end.
|