107 lines
3.8 KiB
ObjectPascal
107 lines
3.8 KiB
ObjectPascal
|
|
unit srvContactos_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:} DARemoteService_Impl,
|
|||
|
|
{Used RODLs:} DataAbstract_Intf,
|
|||
|
|
{Generated:} FactuGES_Intf, uDADataTable, uDABINAdapter, uDAClasses,
|
|||
|
|
uDAInterfaces, uDAScriptingProvider,
|
|||
|
|
uDABusinessProcessor;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
{ TsrvContactos }
|
|||
|
|
TsrvContactos = class(TDARemoteService, IsrvContactos)
|
|||
|
|
BINAdapter: TDABINAdapter;
|
|||
|
|
Diagrams: TDADiagrams;
|
|||
|
|
bpContactos: TDABusinessProcessor;
|
|||
|
|
bpDatosBancarios: TDABusinessProcessor;
|
|||
|
|
bpCategoriasContactos: TDABusinessProcessor;
|
|||
|
|
bpAgentes: TDABusinessProcessor;
|
|||
|
|
bpClientes: TDABusinessProcessor;
|
|||
|
|
bpProveedores: TDABusinessProcessor;
|
|||
|
|
bpDireccionesContacto: TDABusinessProcessor;
|
|||
|
|
bpAgentesComisiones: TDABusinessProcessor;
|
|||
|
|
bpClientesDescuentos: TDABusinessProcessor;
|
|||
|
|
schContactos: TDASchema;
|
|||
|
|
DataDictionary: TDADataDictionary;
|
|||
|
|
procedure DARemoteServiceBeforeAcquireConnection(Sender: TDARemoteService;
|
|||
|
|
var ConnectionName: string);
|
|||
|
|
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
|||
|
|
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
|||
|
|
procedure DARemoteServiceCreate(Sender: TObject);
|
|||
|
|
public
|
|||
|
|
function GetNextAutoInc(const GeneratorName: string): Integer;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
uses
|
|||
|
|
{Generated:} FactuGES_Invk, Dialogs, uBizContactosServer,
|
|||
|
|
uDataModuleServer, uDatabaseUtils, uUsersManager,
|
|||
|
|
schContactosClient_Intf, uRORemoteDataModule, uBizAgentesServer,
|
|||
|
|
uBizClientesServer, uBizProveedoresServer, uRestriccionesUsuarioUtils;
|
|||
|
|
|
|||
|
|
procedure Create_srvContactos(out anInstance : IUnknown);
|
|||
|
|
begin
|
|||
|
|
anInstance := TsrvContactos.Create(NIL);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
{ TsrvContactos }
|
|||
|
|
|
|||
|
|
procedure TsrvContactos.DARemoteServiceBeforeAcquireConnection(
|
|||
|
|
Sender: TDARemoteService; var ConnectionName: string);
|
|||
|
|
begin
|
|||
|
|
ConnectionName := dmServer.ConnectionName;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TsrvContactos.DARemoteServiceBeforeGetDatasetData(
|
|||
|
|
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
|||
|
|
const MaxRecords: Integer);
|
|||
|
|
begin
|
|||
|
|
if (DataSet.Name <> nme_DatosBancarios) and
|
|||
|
|
(DataSet.Name <> nme_DireccionesContacto) and
|
|||
|
|
(DataSet.Name <> nme_GruposCliente) and
|
|||
|
|
(DataSet.Name <> nme_AgentesComisiones) and
|
|||
|
|
(DataSet.Name <> nme_ClientesDescuentos) and
|
|||
|
|
(DataSet.Name <> nme_ContactosCategorias) then
|
|||
|
|
begin
|
|||
|
|
{ Aqu<EFBFBD> se asegura que el usuario s<EFBFBD>lo accede a contactos
|
|||
|
|
de las empresas a las que tiene permiso para acceder
|
|||
|
|
filtrando DataSet por ID_EMPRESA. }
|
|||
|
|
FiltrarAccesoUsuario(Session, Connection, schContactos, DataSet, fld_ContactosID_EMPRESA);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TsrvContactos.DARemoteServiceCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SessionManager := dmServer.SessionManager;
|
|||
|
|
|
|||
|
|
bpContactos.BusinessRulesID := BIZ_SERVER_CONTACTO;
|
|||
|
|
bpAgentes.BusinessRulesID := BIZ_SERVER_AGENTE;
|
|||
|
|
bpClientes.BusinessRulesID := BIZ_SERVER_CLIENTE;
|
|||
|
|
bpProveedores.BusinessRulesID := BIZ_SERVER_PROVEEDOR;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TsrvContactos.GetNextAutoInc(const GeneratorName: string): Integer;
|
|||
|
|
begin
|
|||
|
|
Result := uDatabaseUtils.GetNextAutoInc(GeneratorName)
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
initialization
|
|||
|
|
TROClassFactory.Create('srvContactos', Create_srvContactos, TsrvContactos_Invoker);
|
|||
|
|
|
|||
|
|
finalization
|
|||
|
|
|
|||
|
|
end.
|