- Servidor: mejorada la forma de llamar a los servicios desde otros servicios.
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@301 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
098fa7175a
commit
22b23d0589
@ -349,6 +349,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ if Result then
|
||||||
|
// Para que el servidor cree la sesión del usuario
|
||||||
|
FDataModule.Login(User, Password);}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TUsuariosController.Create;
|
constructor TUsuariosController.Create;
|
||||||
|
|||||||
@ -423,4 +423,11 @@ inherited DataModuleUsuarios: TDataModuleUsuarios
|
|||||||
Left = 272
|
Left = 272
|
||||||
Top = 136
|
Top = 136
|
||||||
end
|
end
|
||||||
|
object srvLogin: TRORemoteService
|
||||||
|
Message = dmConexion.ROMessage
|
||||||
|
Channel = dmConexion.ROChannel
|
||||||
|
ServiceName = 'srvLogin'
|
||||||
|
Left = 40
|
||||||
|
Top = 208
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -20,6 +20,7 @@ type
|
|||||||
ds_USUARIOS: TDADataSource;
|
ds_USUARIOS: TDADataSource;
|
||||||
tbl_PERFILES: TDAMemDataTable;
|
tbl_PERFILES: TDAMemDataTable;
|
||||||
ds_PERFILES: TDADataSource;
|
ds_PERFILES: TDADataSource;
|
||||||
|
srvLogin: TRORemoteService;
|
||||||
procedure DataModuleCreate(Sender: TObject);
|
procedure DataModuleCreate(Sender: TObject);
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -38,6 +39,9 @@ type
|
|||||||
|
|
||||||
procedure InicializarUserControl (AUserControl : TUserControl);
|
procedure InicializarUserControl (AUserControl : TUserControl);
|
||||||
function DarTiendaUsuario(const ID_Usuario: Integer; var AID_Tienda: Integer; var ATienda: String) : Boolean;
|
function DarTiendaUsuario(const ID_Usuario: Integer; var AID_Tienda: Integer; var ATienda: String) : Boolean;
|
||||||
|
|
||||||
|
function Login(const AUser: String; const APassword: String): Boolean;
|
||||||
|
procedure Logout;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -476,5 +480,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TDataModuleUsuarios.Login(const AUser: String; const APassword: String): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (srvLogin as IsrvLogin).Login(AUser, APassword);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TDataModuleUsuarios.Logout;
|
||||||
|
begin
|
||||||
|
(srvLogin as IsrvLogin).Logout;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -19,6 +19,9 @@ type
|
|||||||
function GetPerfil(const ID : Integer) : IBizPerfilUsuario;
|
function GetPerfil(const ID : Integer) : IBizPerfilUsuario;
|
||||||
|
|
||||||
function DarTiendaUsuario(const ID_Usuario: Integer; var AID_Tienda: Integer; var ATienda: String) : Boolean;
|
function DarTiendaUsuario(const ID_Usuario: Integer; var AID_Tienda: Integer; var ATienda: String) : Boolean;
|
||||||
|
|
||||||
|
function Login(const AUser: String; const APassword: String): Boolean;
|
||||||
|
procedure Logout;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|||||||
@ -19,22 +19,26 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Variants, uDAClasses, uBusinessUtils, uROClasses, uDataModuleServer,
|
Variants, uDAClasses, uBusinessUtils, uROClasses, uDataModuleServer,
|
||||||
srvContabilidad_Impl;
|
SysUtils, uROServer, FactuGES_Intf;
|
||||||
|
|
||||||
{ TBizAsientosServer }
|
{ TBizAsientosServer }
|
||||||
|
|
||||||
procedure TBizAsientosServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
procedure TBizAsientosServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
|
var
|
||||||
|
AContabilidadService : IsrvContabilidad;
|
||||||
|
Intf : IInterface;
|
||||||
|
AClientID : TGUID;
|
||||||
begin
|
begin
|
||||||
case Sender.CurrentChange.ChangeType of
|
case Sender.CurrentChange.ChangeType of
|
||||||
ctInsert, ctUpdate: begin
|
ctInsert, ctUpdate: begin
|
||||||
//Si el orden del asiento no ha sido asignado le asignamos uno nosotros
|
//Si el orden del asiento no ha sido asignado le asignamos uno nosotros
|
||||||
if (ORDENIsNull) or (ORDEN = 0) then
|
if (ORDENIsNull) or (ORDEN = 0) then
|
||||||
begin
|
begin
|
||||||
with TsrvContabilidad.Create(Nil) do
|
CreateGUID(AClientID);
|
||||||
begin
|
|
||||||
ORDEN := DarNumOrden;
|
GetClassFactory('srvContabilidad').CreateInstance(AClientID, Intf);
|
||||||
Free;
|
AContabilidadService := Intf as IsrvContabilidad;
|
||||||
end;
|
ORDEN := AContabilidadService.DarNumOrdenAsiento;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -38,13 +38,13 @@ type
|
|||||||
procedure DARemoteServiceCreate(Sender: TObject);
|
procedure DARemoteServiceCreate(Sender: TObject);
|
||||||
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string);
|
||||||
private
|
private
|
||||||
function darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
function DarEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
|
|
||||||
public
|
public
|
||||||
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer; const CLIENTE: String): Boolean;
|
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer; const CLIENTE: String): Boolean;
|
||||||
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ES_ACREEDOR: Integer; const ID_EMPRESA: Integer; const PROVEEDOR: String): Boolean;
|
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ES_ACREEDOR: Integer; const ID_EMPRESA: Integer; const PROVEEDOR: String): Boolean;
|
||||||
function DarNumOrden : Integer;
|
function DarNumOrdenAsiento : Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -226,14 +226,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TsrvContabilidad.darEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
function TsrvContabilidad.DarEjercicioActivo(const ID_EMPRESA: Integer): Integer;
|
||||||
|
var
|
||||||
|
AEjerciciosService : IsrvEjercicios;
|
||||||
|
Intf : IInterface;
|
||||||
|
AClientID : TGUID;
|
||||||
begin
|
begin
|
||||||
with TsrvEjercicios.Create(NIL) do
|
CreateGUID(AClientID);
|
||||||
try
|
|
||||||
Result := DarEjercicioActivo(ID_EMPRESA)
|
GetClassFactory('srvEjercicios').CreateInstance(AClientID, Intf);
|
||||||
finally
|
AEjerciciosService := Intf as IsrvEjercicios;
|
||||||
Free;
|
Result := AEjerciciosService.darEjercicioActivo(ID_EMPRESA)
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsrvContabilidad.DARemoteServiceCreate(Sender: TObject);
|
procedure TsrvContabilidad.DARemoteServiceCreate(Sender: TObject);
|
||||||
@ -242,7 +245,7 @@ begin
|
|||||||
bpAsientos.BusinessRulesID := BIZ_SERVER_ASIENTOS;
|
bpAsientos.BusinessRulesID := BIZ_SERVER_ASIENTOS;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TsrvContabilidad.DarNumOrden: Integer;
|
function TsrvContabilidad.DarNumOrdenAsiento: Integer;
|
||||||
var
|
var
|
||||||
AConn : IDAConnection;
|
AConn : IDAConnection;
|
||||||
dsData: IDADataset;
|
dsData: IDADataset;
|
||||||
|
|||||||
@ -15,6 +15,7 @@ type
|
|||||||
FReferenciaAutomatica : Boolean;
|
FReferenciaAutomatica : Boolean;
|
||||||
function DarReferencia : String;
|
function DarReferencia : String;
|
||||||
function IncrementarReferencia : Boolean;
|
function IncrementarReferencia : Boolean;
|
||||||
|
procedure CrearCuentaContable(aChange: TDADeltaChange);
|
||||||
protected
|
protected
|
||||||
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
|
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
|
||||||
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
|
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
|
||||||
@ -28,7 +29,8 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
uDataModuleServer, uDAClasses, srvContabilidad_Impl,
|
uDataModuleServer, uDAClasses, srvContabilidad_Impl,
|
||||||
schContactosClient_Intf, uBusinessUtils;
|
schContactosClient_Intf, uBusinessUtils, FactuGES_Intf,
|
||||||
|
uROServer, SysUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
REF_CLIENTE = 'REF_CLIENTE';
|
REF_CLIENTE = 'REF_CLIENTE';
|
||||||
@ -51,6 +53,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBizClienteServer.CrearCuentaContable(aChange: TDADeltaChange);
|
||||||
|
var
|
||||||
|
AContabilidadService : IsrvContabilidad;
|
||||||
|
Intf : IInterface;
|
||||||
|
AClientID : TGUID;
|
||||||
|
|
||||||
|
ANombre: string;
|
||||||
|
AIDEmpresa: Integer;
|
||||||
|
AIDCliente: Integer;
|
||||||
|
AIDTienda: Integer;
|
||||||
|
begin
|
||||||
|
AIDCliente := aChange.NewValueByName[fld_ClientesID];
|
||||||
|
AIDTienda := aChange.NewValueByName[fld_ClientesID_TIENDA];
|
||||||
|
AIDEmpresa := aChange.NewValueByName[fld_ClientesID_EMPRESA];
|
||||||
|
ANombre := aChange.NewValueByName[fld_ClientesNOMBRE];
|
||||||
|
|
||||||
|
CreateGUID(AClientID);
|
||||||
|
GetClassFactory('srvContabilidad').CreateInstance(AClientID, Intf);
|
||||||
|
AContabilidadService := Intf as IsrvContabilidad;
|
||||||
|
|
||||||
|
if not AContabilidadService.TieneCuentaAsociada(AIDCliente, AIDEmpresa) then
|
||||||
|
AContabilidadService.AnadirSubCuentaCliente(AIDCliente, AIDTienda, AIDEmpresa, ANombre);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TBizClienteServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
procedure TBizClienteServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
begin
|
begin
|
||||||
FReferenciaAutomatica := False;
|
FReferenciaAutomatica := False;
|
||||||
@ -105,12 +131,6 @@ var
|
|||||||
ASchema : TDASchema;
|
ASchema : TDASchema;
|
||||||
ACurrentConn : IDAConnection;
|
ACurrentConn : IDAConnection;
|
||||||
ACommand : IDASQLCommand;
|
ACommand : IDASQLCommand;
|
||||||
|
|
||||||
idCliente: integer;
|
|
||||||
idTienda: integer;
|
|
||||||
idEmpresa: integer;
|
|
||||||
Nombre: string;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
@ -142,20 +162,10 @@ begin
|
|||||||
|
|
||||||
|
|
||||||
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
||||||
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0)
|
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0) and
|
||||||
and (aChange.NewValueByName[fld_ClientesTIENE_SUBCUENTA] = 0) then
|
(aChange.NewValueByName[fld_ClientesTIENE_SUBCUENTA] = 0) then
|
||||||
begin
|
begin
|
||||||
with TsrvContabilidad.Create(NIL) do
|
CrearCuentaContable(aChange);
|
||||||
try
|
|
||||||
IdCliente := aChange.NewValueByName[fld_ClientesID];
|
|
||||||
IdTienda := aChange.NewValueByName[fld_ClientesID_TIENDA];
|
|
||||||
IdEmpresa := aChange.NewValueByName[fld_ClientesID_EMPRESA];
|
|
||||||
Nombre := aChange.NewValueByName[fld_ClientesNOMBRE];
|
|
||||||
if not TieneCuentaAsociada(idCliente, idEmpresa) then
|
|
||||||
AnadirSubCuentaCliente(idCliente, idTienda, idEmpresa, Nombre);
|
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
@ -169,11 +179,6 @@ var
|
|||||||
ASchema : TDASchema;
|
ASchema : TDASchema;
|
||||||
ACurrentConn : IDAConnection;
|
ACurrentConn : IDAConnection;
|
||||||
ACommand : IDASQLCommand;
|
ACommand : IDASQLCommand;
|
||||||
|
|
||||||
idCliente: integer;
|
|
||||||
idTienda: integer;
|
|
||||||
idEmpresa: integer;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
@ -205,20 +210,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
||||||
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0)
|
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0) and
|
||||||
and (aChange.NewValueByName[fld_ClientesTIENE_SUBCUENTA] = 0) then
|
(aChange.NewValueByName[fld_ClientesTIENE_SUBCUENTA] = 0) then
|
||||||
begin
|
begin
|
||||||
with TsrvContabilidad.Create(NIL) do
|
CrearCuentaContable(aChange);
|
||||||
try
|
|
||||||
IdCliente := aChange.NewValueByName[fld_ClientesID];
|
|
||||||
IdTienda := aChange.NewValueByName[fld_ClientesID_TIENDA];
|
|
||||||
IdEmpresa := aChange.NewValueByName[fld_ClientesID_EMPRESA];
|
|
||||||
Nombre := aChange.NewValueByName[fld_ClientesNOMBRE];
|
|
||||||
if not TieneCuentaAsociada(idCliente, idEmpresa) then
|
|
||||||
AnadirSubCuentaCliente(idCliente, idTienda, idEmpresa, Nombre);
|
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
|
|||||||
@ -15,6 +15,7 @@ type
|
|||||||
FReferenciaAutomatica : Boolean;
|
FReferenciaAutomatica : Boolean;
|
||||||
function DarReferencia : String;
|
function DarReferencia : String;
|
||||||
function IncrementarReferencia : Boolean;
|
function IncrementarReferencia : Boolean;
|
||||||
|
procedure CrearCuentaContable(aChange: TDADeltaChange);
|
||||||
protected
|
protected
|
||||||
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
|
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
|
||||||
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
|
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
|
||||||
@ -28,7 +29,8 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
uDataModuleServer, uDAClasses, srvContabilidad_Impl,
|
uDataModuleServer, uDAClasses, srvContabilidad_Impl,
|
||||||
schContactosClient_Intf, uBusinessUtils;
|
schContactosClient_Intf, uBusinessUtils, FactuGES_Intf,
|
||||||
|
uROServer, SysUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
REF_PROVEEDOR = 'REF_PROVEEDOR';
|
REF_PROVEEDOR = 'REF_PROVEEDOR';
|
||||||
@ -51,6 +53,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBizProveedorServer.CrearCuentaContable(aChange: TDADeltaChange);
|
||||||
|
var
|
||||||
|
AIDProveedor: Integer;
|
||||||
|
bEsAcreedor: Integer;
|
||||||
|
ANombre: string;
|
||||||
|
AIDEmpresa: Integer;
|
||||||
|
|
||||||
|
Intf: IInterface;
|
||||||
|
AContabilidadService: IsrvContabilidad;
|
||||||
|
AClientID: TGUID;
|
||||||
|
begin
|
||||||
|
AIDProveedor := aChange.NewValueByName[fld_ProveedoresID];
|
||||||
|
bEsAcreedor := aChange.NewValueByName[fld_ProveedoresES_ACREEDOR];
|
||||||
|
AIDEmpresa := aChange.NewValueByName[fld_ProveedoresID_EMPRESA];
|
||||||
|
ANombre := aChange.NewValueByName[fld_ProveedoresNOMBRE];
|
||||||
|
|
||||||
|
CreateGUID(AClientID);
|
||||||
|
GetClassFactory('srvContabilidad').CreateInstance(AClientID, Intf);
|
||||||
|
AContabilidadService := Intf as IsrvContabilidad;
|
||||||
|
|
||||||
|
if not AContabilidadService.TieneCuentaAsociada(AIDProveedor, AIDEmpresa) then
|
||||||
|
AContabilidadService.AnadirSubCuentaProveedor(AIDProveedor, bEsAcreedor, AIDEmpresa, ANombre);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TBizProveedorServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
procedure TBizProveedorServer.BeforeProcessDelta(Sender: TDABusinessProcessor; const aDelta: IDADelta);
|
||||||
begin
|
begin
|
||||||
FReferenciaAutomatica := False;
|
FReferenciaAutomatica := False;
|
||||||
@ -102,15 +129,9 @@ end;
|
|||||||
|
|
||||||
procedure TBizProveedorServer.Insert_Datos_Contacto(aChange: TDADeltaChange);
|
procedure TBizProveedorServer.Insert_Datos_Contacto(aChange: TDADeltaChange);
|
||||||
var
|
var
|
||||||
ASchema : TDASchema;
|
|
||||||
ACurrentConn : IDAConnection;
|
ACurrentConn : IDAConnection;
|
||||||
ACommand : IDASQLCommand;
|
ACommand : IDASQLCommand;
|
||||||
|
ASchema : TDASchema;
|
||||||
idProveedor: integer;
|
|
||||||
EsAcreedor: integer;
|
|
||||||
idEmpresa: integer;
|
|
||||||
Nombre: string;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
@ -140,22 +161,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
||||||
if (aChange.NewValueByName[fld_ProveedoresIGNORAR_CONTABILIDAD] = 0)
|
if (aChange.NewValueByName[fld_ProveedoresIGNORAR_CONTABILIDAD] = 0) and
|
||||||
and (aChange.NewValueByName[fld_ProveedoresTIENE_SUBCUENTA] = 0) then
|
(aChange.NewValueByName[fld_ProveedoresTIENE_SUBCUENTA] = 0) then
|
||||||
begin
|
begin
|
||||||
with TsrvContabilidad.Create(NIL) do
|
CrearCuentaContable(aChange);
|
||||||
try
|
|
||||||
IdProveedor := aChange.NewValueByName[fld_ProveedoresID];
|
|
||||||
EsAcreedor := aChange.NewValueByName[fld_ProveedoresES_ACREEDOR];
|
|
||||||
IdEmpresa := aChange.NewValueByName[fld_ProveedoresID_EMPRESA];
|
|
||||||
Nombre := aChange.NewValueByName[fld_ProveedoresNOMBRE];
|
|
||||||
if not TieneCuentaAsociada(IdProveedor, IdEmpresa) then
|
|
||||||
AnadirSubCuentaProveedor(IdProveedor, EsAcreedor, IdEmpresa, Nombre);
|
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
ACommand := NIL;
|
ACommand := NIL;
|
||||||
end;
|
end;
|
||||||
@ -167,12 +177,6 @@ var
|
|||||||
ASchema : TDASchema;
|
ASchema : TDASchema;
|
||||||
ACurrentConn : IDAConnection;
|
ACurrentConn : IDAConnection;
|
||||||
ACommand : IDASQLCommand;
|
ACommand : IDASQLCommand;
|
||||||
|
|
||||||
idProveedor: integer;
|
|
||||||
EsAcreedor: integer;
|
|
||||||
idEmpresa: integer;
|
|
||||||
Nombre: string;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
@ -203,20 +207,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
//En caso de no ignorar contabilidad se deberá dar de alta una cuenta para el cliente si el usuario no la ha asignado
|
||||||
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0)
|
if (aChange.NewValueByName[fld_ClientesIGNORAR_CONTABILIDAD] = 0) and
|
||||||
and (aChange.NewValueByName[fld_ClientesTIENE_SUBCUENTA] = 0) then
|
(aChange.NewValueByName[fld_ClientesTIENE_SUBCUENTA] = 0) then
|
||||||
begin
|
begin
|
||||||
with TsrvContabilidad.Create(NIL) do
|
CrearCuentaContable(aChange);
|
||||||
try
|
|
||||||
IdProveedor := aChange.NewValueByName[fld_ProveedoresID];
|
|
||||||
EsAcreedor := aChange.NewValueByName[fld_ProveedoresEs_ACREEDOR];
|
|
||||||
IdEmpresa := aChange.NewValueByName[fld_ProveedoresID_EMPRESA];
|
|
||||||
Nombre := aChange.NewValueByName[fld_ProveedoresNOMBRE];
|
|
||||||
if not TieneCuentaAsociada(IdProveedor, IdEmpresa) then
|
|
||||||
AnadirSubCuentaProveedor(IdProveedor, EsAcreedor, IdEmpresa, Nombre);
|
|
||||||
finally
|
|
||||||
Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
<Interfaces>
|
<Interfaces>
|
||||||
<Interface Name="Default" UID="{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}">
|
<Interface Name="Default" UID="{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}">
|
||||||
<Operations>
|
<Operations>
|
||||||
<Operation Name="Login" UID="{849EDFCE-0C6A-4D3C-B9E9-7770C5A7F0A4}">
|
<Operation Name="Login2" UID="{849EDFCE-0C6A-4D3C-B9E9-7770C5A7F0A4}">
|
||||||
<Parameters>
|
<Parameters>
|
||||||
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
||||||
</Parameter>
|
</Parameter>
|
||||||
@ -48,6 +48,16 @@
|
|||||||
</Parameter>
|
</Parameter>
|
||||||
</Parameters>
|
</Parameters>
|
||||||
</Operation>
|
</Operation>
|
||||||
|
<Operation Name="Login" UID="{2BA6C933-4C83-4931-80C7-4D3E32C46A26}">
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="Result" DataType="Boolean" Flag="Result">
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="User" DataType="String" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
<Parameter Name="Password" DataType="String" Flag="In" >
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
</Operation>
|
||||||
<Operation Name="Logout" UID="{3E5391BA-B717-44BB-88DC-C48CB3F7C789}">
|
<Operation Name="Logout" UID="{3E5391BA-B717-44BB-88DC-C48CB3F7C789}">
|
||||||
<Parameters>
|
<Parameters>
|
||||||
</Parameters>
|
</Parameters>
|
||||||
@ -439,6 +449,12 @@
|
|||||||
</Parameter>
|
</Parameter>
|
||||||
</Parameters>
|
</Parameters>
|
||||||
</Operation>
|
</Operation>
|
||||||
|
<Operation Name="DarNumOrdenAsiento" UID="{D22D8C7D-A8E9-4B30-BAEE-7D856C7F6C1F}">
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="Result" DataType="Integer" Flag="Result">
|
||||||
|
</Parameter>
|
||||||
|
</Parameters>
|
||||||
|
</Operation>
|
||||||
</Operations>
|
</Operations>
|
||||||
</Interface>
|
</Interface>
|
||||||
</Interfaces>
|
</Interfaces>
|
||||||
|
|||||||
@ -185,7 +185,8 @@ type
|
|||||||
{ IsrvLogin }
|
{ IsrvLogin }
|
||||||
IsrvLogin = interface(IDataAbstractService)
|
IsrvLogin = interface(IDataAbstractService)
|
||||||
['{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}']
|
['{399F9DB4-1B34-4140-AB6E-3BC10C0A7034}']
|
||||||
function Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
function Login2(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
||||||
|
function Login(const User: String; const Password: String): Boolean;
|
||||||
procedure Logout;
|
procedure Logout;
|
||||||
function Ping: Boolean;
|
function Ping: Boolean;
|
||||||
end;
|
end;
|
||||||
@ -200,7 +201,8 @@ type
|
|||||||
protected
|
protected
|
||||||
function __GetInterfaceName:string; override;
|
function __GetInterfaceName:string; override;
|
||||||
|
|
||||||
function Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
function Login2(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
||||||
|
function Login(const User: String; const Password: String): Boolean;
|
||||||
procedure Logout;
|
procedure Logout;
|
||||||
function Ping: Boolean;
|
function Ping: Boolean;
|
||||||
end;
|
end;
|
||||||
@ -622,6 +624,7 @@ type
|
|||||||
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer; const CLIENTE: String): Boolean;
|
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer; const CLIENTE: String): Boolean;
|
||||||
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ES_ACREEDOR: Integer; const ID_EMPRESA: Integer; const PROVEEDOR: String): Boolean;
|
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ES_ACREEDOR: Integer; const ID_EMPRESA: Integer; const PROVEEDOR: String): Boolean;
|
||||||
|
function DarNumOrdenAsiento: Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ CosrvContabilidad }
|
{ CosrvContabilidad }
|
||||||
@ -637,6 +640,7 @@ type
|
|||||||
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
function TieneCuentaAsociada(const ID_CONTACTO: Integer; const ID_EMPRESA: Integer): Boolean;
|
||||||
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer; const CLIENTE: String): Boolean;
|
function AnadirSubCuentaCliente(const ID_CONTACTO: Integer; const ID_TIENDA: Integer; const ID_EMPRESA: Integer; const CLIENTE: String): Boolean;
|
||||||
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ES_ACREEDOR: Integer; const ID_EMPRESA: Integer; const PROVEEDOR: String): Boolean;
|
function AnadirSubCuentaProveedor(const ID_CONTACTO: Integer; const ES_ACREEDOR: Integer; const ID_EMPRESA: Integer; const PROVEEDOR: String): Boolean;
|
||||||
|
function DarNumOrdenAsiento: Integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ IsrvUnidadesMedida }
|
{ IsrvUnidadesMedida }
|
||||||
@ -1033,11 +1037,11 @@ begin
|
|||||||
result := 'srvLogin';
|
result := 'srvLogin';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TsrvLogin_Proxy.Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
function TsrvLogin_Proxy.Login2(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
LoginInfo := nil;
|
LoginInfo := nil;
|
||||||
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'Login');
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'Login2');
|
||||||
__Message.Write('User', TypeInfo(String), User, []);
|
__Message.Write('User', TypeInfo(String), User, []);
|
||||||
__Message.Write('Password', TypeInfo(String), Password, []);
|
__Message.Write('Password', TypeInfo(String), Password, []);
|
||||||
__Message.Finalize;
|
__Message.Finalize;
|
||||||
@ -1052,6 +1056,23 @@ begin
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsrvLogin_Proxy.Login(const User: String; const Password: String): Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'Login');
|
||||||
|
__Message.Write('User', TypeInfo(String), User, []);
|
||||||
|
__Message.Write('Password', TypeInfo(String), Password, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
|
||||||
|
__TransportChannel.Dispatch(__Message);
|
||||||
|
|
||||||
|
__Message.Read('Result', TypeInfo(Boolean), result, []);
|
||||||
|
finally
|
||||||
|
__Message.UnsetAttributes(__TransportChannel);
|
||||||
|
__Message.FreeStream;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TsrvLogin_Proxy.Logout;
|
procedure TsrvLogin_Proxy.Logout;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
@ -1732,6 +1753,21 @@ begin
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TsrvContabilidad_Proxy.DarNumOrdenAsiento: Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarNumOrdenAsiento');
|
||||||
|
__Message.Finalize;
|
||||||
|
|
||||||
|
__TransportChannel.Dispatch(__Message);
|
||||||
|
|
||||||
|
__Message.Read('Result', TypeInfo(Integer), result, []);
|
||||||
|
finally
|
||||||
|
__Message.UnsetAttributes(__TransportChannel);
|
||||||
|
__Message.FreeStream;
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
|
||||||
{ CosrvUnidadesMedida }
|
{ CosrvUnidadesMedida }
|
||||||
|
|
||||||
class function CosrvUnidadesMedida.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUnidadesMedida;
|
class function CosrvUnidadesMedida.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvUnidadesMedida;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ type
|
|||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
published
|
published
|
||||||
|
procedure Invoke_Login2(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
procedure Invoke_Ping(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_Ping(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
@ -193,6 +194,7 @@ type
|
|||||||
procedure Invoke_TieneCuentaAsociada(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_TieneCuentaAsociada(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
procedure Invoke_AnadirSubCuentaCliente(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_AnadirSubCuentaCliente(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
procedure Invoke_AnadirSubCuentaProveedor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure Invoke_AnadirSubCuentaProveedor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
procedure Invoke_DarNumOrdenAsiento(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TsrvUnidadesMedida_Invoker = class(TDataAbstractService_Invoker)
|
TsrvUnidadesMedida_Invoker = class(TDataAbstractService_Invoker)
|
||||||
@ -275,8 +277,8 @@ end;
|
|||||||
|
|
||||||
{ TsrvLogin_Invoker }
|
{ TsrvLogin_Invoker }
|
||||||
|
|
||||||
procedure TsrvLogin_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure TsrvLogin_Invoker.Invoke_Login2(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
{ function Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean; }
|
{ function Login2(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean; }
|
||||||
var
|
var
|
||||||
User: String;
|
User: String;
|
||||||
Password: String;
|
Password: String;
|
||||||
@ -289,9 +291,9 @@ begin
|
|||||||
__Message.Read('User', TypeInfo(String), User, []);
|
__Message.Read('User', TypeInfo(String), User, []);
|
||||||
__Message.Read('Password', TypeInfo(String), Password, []);
|
__Message.Read('Password', TypeInfo(String), Password, []);
|
||||||
|
|
||||||
lResult := (__Instance as IsrvLogin).Login(User, Password, LoginInfo);
|
lResult := (__Instance as IsrvLogin).Login2(User, Password, LoginInfo);
|
||||||
|
|
||||||
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvLogin', 'LoginResponse');
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvLogin', 'Login2Response');
|
||||||
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
||||||
__Message.Write('LoginInfo', TypeInfo(FactuGES_Intf.TRdxLoginInfo), LoginInfo, []);
|
__Message.Write('LoginInfo', TypeInfo(FactuGES_Intf.TRdxLoginInfo), LoginInfo, []);
|
||||||
__Message.Finalize;
|
__Message.Finalize;
|
||||||
@ -307,6 +309,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TsrvLogin_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
{ function Login(const User: String; const Password: String): Boolean; }
|
||||||
|
var
|
||||||
|
User: String;
|
||||||
|
Password: String;
|
||||||
|
lResult: Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
__Message.Read('User', TypeInfo(String), User, []);
|
||||||
|
__Message.Read('Password', TypeInfo(String), Password, []);
|
||||||
|
|
||||||
|
lResult := (__Instance as IsrvLogin).Login(User, Password);
|
||||||
|
|
||||||
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvLogin', 'LoginResponse');
|
||||||
|
__Message.Write('Result', TypeInfo(Boolean), lResult, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
__Message.UnsetAttributes(__Transport);
|
||||||
|
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TsrvLogin_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure TsrvLogin_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
{ procedure Logout; }
|
{ procedure Logout; }
|
||||||
begin
|
begin
|
||||||
@ -887,6 +911,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TsrvContabilidad_Invoker.Invoke_DarNumOrdenAsiento(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
{ function DarNumOrdenAsiento: Integer; }
|
||||||
|
var
|
||||||
|
lResult: Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
lResult := (__Instance as IsrvContabilidad).DarNumOrdenAsiento;
|
||||||
|
|
||||||
|
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvContabilidad', 'DarNumOrdenAsientoResponse');
|
||||||
|
__Message.Write('Result', TypeInfo(Integer), lResult, []);
|
||||||
|
__Message.Finalize;
|
||||||
|
__Message.UnsetAttributes(__Transport);
|
||||||
|
|
||||||
|
finally
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TsrvComisiones_Invoker }
|
{ TsrvComisiones_Invoker }
|
||||||
|
|
||||||
procedure TsrvComisiones_Invoker.Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
procedure TsrvComisiones_Invoker.Invoke_GenerateReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -58,8 +58,6 @@ uses
|
|||||||
uBizPedidosProveedorServer in '..\Modulos\Pedidos a proveedor\Model\uBizPedidosProveedorServer.pas',
|
uBizPedidosProveedorServer in '..\Modulos\Pedidos a proveedor\Model\uBizPedidosProveedorServer.pas',
|
||||||
uBizAlbaranProveedorServer in '..\Modulos\Albaranes de proveedor\Model\uBizAlbaranProveedorServer.PAS',
|
uBizAlbaranProveedorServer in '..\Modulos\Albaranes de proveedor\Model\uBizAlbaranProveedorServer.PAS',
|
||||||
uBizFacturasProveedorServer in '..\Modulos\Facturas de proveedor\Model\uBizFacturasProveedorServer.pas',
|
uBizFacturasProveedorServer in '..\Modulos\Facturas de proveedor\Model\uBizFacturasProveedorServer.pas',
|
||||||
schAlmacenesClient_Intf in '..\Modulos\Almacenes\Model\schAlmacenesClient_Intf.pas',
|
|
||||||
schAlmacenesServer_Intf in '..\Modulos\Almacenes\Model\schAlmacenesServer_Intf.pas',
|
|
||||||
schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas',
|
schArticulosClient_Intf in '..\Modulos\Articulos\Model\schArticulosClient_Intf.pas',
|
||||||
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas',
|
schArticulosServer_Intf in '..\Modulos\Articulos\Model\schArticulosServer_Intf.pas',
|
||||||
srvRemesasCliente_Impl in '..\Modulos\Remesas de cliente\Servidor\srvRemesasCliente_Impl.pas' {srvRemesasCliente: TDataAbstractService},
|
srvRemesasCliente_Impl in '..\Modulos\Remesas de cliente\Servidor\srvRemesasCliente_Impl.pas' {srvRemesasCliente: TDataAbstractService},
|
||||||
@ -125,7 +123,9 @@ uses
|
|||||||
schEjerciciosClient_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosClient_Intf.pas',
|
schEjerciciosClient_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosClient_Intf.pas',
|
||||||
schEjerciciosServer_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosServer_Intf.pas',
|
schEjerciciosServer_Intf in '..\ApplicationBase\Ejercicios\Model\schEjerciciosServer_Intf.pas',
|
||||||
schUsuariosClient_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosClient_Intf.pas',
|
schUsuariosClient_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosClient_Intf.pas',
|
||||||
schUsuariosServer_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosServer_Intf.pas';
|
schUsuariosServer_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosServer_Intf.pas',
|
||||||
|
schAlmacenesClient_Intf in '..\Modulos\Almacenes\Model\schAlmacenesClient_Intf.pas',
|
||||||
|
schAlmacenesServer_Intf in '..\Modulos\Almacenes\Model\schAlmacenesServer_Intf.pas';
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
{$R ..\Servicios\RODLFile.res}
|
{$R ..\Servicios\RODLFile.res}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ BEGIN
|
|||||||
VALUE "FileVersion", "2.2.3.0\0"
|
VALUE "FileVersion", "2.2.3.0\0"
|
||||||
VALUE "ProductName", "FactuGES (Servidor)\0"
|
VALUE "ProductName", "FactuGES (Servidor)\0"
|
||||||
VALUE "ProductVersion", "2.2.3.0\0"
|
VALUE "ProductVersion", "2.2.3.0\0"
|
||||||
VALUE "CompileDate", "lunes, 28 de julio de 2008 12:58\0"
|
VALUE "CompileDate", "miércoles, 30 de julio de 2008 12:09\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@ -31,7 +31,8 @@ type
|
|||||||
procedure DataAbstractServiceCreate(Sender: TObject);
|
procedure DataAbstractServiceCreate(Sender: TObject);
|
||||||
private
|
private
|
||||||
protected
|
protected
|
||||||
function Login(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
function Login2(const User: String; const Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
||||||
|
function Login(const User: String; const Password: String): Boolean;
|
||||||
procedure Logout;
|
procedure Logout;
|
||||||
function Ping: Boolean;
|
function Ping: Boolean;
|
||||||
end;
|
end;
|
||||||
@ -63,7 +64,68 @@ begin
|
|||||||
SessionManager := dmServer.SessionManager;
|
SessionManager := dmServer.SessionManager;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TsrvLogin.Login(const User, Password: String; out LoginInfo: TRdxLoginInfo): Boolean;
|
function TsrvLogin.Login(const User, Password: String): Boolean;
|
||||||
|
var
|
||||||
|
dsUser,
|
||||||
|
dsPerfiles,
|
||||||
|
dsEmpresas : IDADataset;
|
||||||
|
LoginInfo : TRdxLoginInfo;
|
||||||
|
begin
|
||||||
|
LoginInfo := NIL;
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
dsUser := schLogin.NewDataset(Connection, 'UsuarioPermitido', ['Usuario', 'Pass'], [User, Password]);
|
||||||
|
|
||||||
|
if (dsUser.RecordCount = 1) then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
LoginInfo := TRdxLoginInfo.Create();
|
||||||
|
with LoginInfo do
|
||||||
|
begin
|
||||||
|
UserID := dsUser.FieldValues[0];
|
||||||
|
Usuario := User;
|
||||||
|
SessionID := GUIDToString(Session.SessionID);
|
||||||
|
Perfiles := StringArray.Create();
|
||||||
|
Empresas := TRdxEmpresasArray.Create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Asigna los perfiles del usuario
|
||||||
|
LoginInfo.Perfiles.Clear;
|
||||||
|
dsPerfiles := schLogin.NewDataset(Connection, 'PerfilesUsuario', ['ID_USUARIO'], [LoginInfo.UserID]);
|
||||||
|
while not dsPerfiles.EOF do
|
||||||
|
begin
|
||||||
|
LoginInfo.Perfiles.Add(VarToStr(dsPerfiles.FieldValues[0]));
|
||||||
|
dsPerfiles.Next;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Asigna las empresas del usuario
|
||||||
|
LoginInfo.Empresas.Clear;
|
||||||
|
dsEmpresas := schLogin.NewDataset(Connection, 'EmpresasUsuario', ['ID_USUARIO'], [LoginInfo.UserID]);
|
||||||
|
while not dsEmpresas.EOF do
|
||||||
|
begin
|
||||||
|
LoginInfo.Empresas.Add(dsEmpresas.FieldValues[0]);
|
||||||
|
dsEmpresas.Next;
|
||||||
|
end;
|
||||||
|
|
||||||
|
SesionesHelper.SaveSessionObject(Session, SESION_LOGININFO, LoginInfo);
|
||||||
|
|
||||||
|
Result := True;
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
begin
|
||||||
|
ShowMessage(e.Message);
|
||||||
|
raise
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
// Invalid login. The temporary session is not to be kept.
|
||||||
|
DestroySession;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TsrvLogin.Login2(const User, Password: String;
|
||||||
|
out LoginInfo: TRdxLoginInfo): Boolean;
|
||||||
var
|
var
|
||||||
dsUser,
|
dsUser,
|
||||||
dsPerfiles,
|
dsPerfiles,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user