Ahora el cliente guarda la url del servidor en un fichero INI en vez de usar el registros de Windows.
git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@99 c93665c3-c93d-084d-9b98-7d5f4a9c3376
This commit is contained in:
parent
4ecdab79ea
commit
27ff4c32d3
@ -41,6 +41,7 @@ object fConfigurarConexion: TfConfigurarConexion
|
|||||||
Top = 28
|
Top = 28
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 13
|
Height = 13
|
||||||
|
Margins.Bottom = 0
|
||||||
Caption = 'Nombre del servidor:'
|
Caption = 'Nombre del servidor:'
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
@ -48,6 +49,7 @@ object fConfigurarConexion: TfConfigurarConexion
|
|||||||
Top = 60
|
Top = 60
|
||||||
Width = 93
|
Width = 93
|
||||||
Height = 13
|
Height = 13
|
||||||
|
Margins.Bottom = 0
|
||||||
Caption = 'Puerto de escucha:'
|
Caption = 'Puerto de escucha:'
|
||||||
end
|
end
|
||||||
object edtServer: TEdit
|
object edtServer: TEdit
|
||||||
|
|||||||
@ -508,14 +508,6 @@ object dmBase: TdmBase
|
|||||||
Left = 104
|
Left = 104
|
||||||
Top = 16
|
Top = 16
|
||||||
end
|
end
|
||||||
object JvAppRegistryStorage: TJvAppRegistryStorage
|
|
||||||
StorageOptions.BooleanStringTrueValues = 'TRUE, YES, Y'
|
|
||||||
StorageOptions.BooleanStringFalseValues = 'FALSE, NO, N'
|
|
||||||
Root = 'Software\%APPL_NAME%'
|
|
||||||
SubStorages = <>
|
|
||||||
Left = 224
|
|
||||||
Top = 80
|
|
||||||
end
|
|
||||||
object cxIntlPrintSys31: TcxIntlPrintSys3
|
object cxIntlPrintSys31: TcxIntlPrintSys3
|
||||||
Connected = True
|
Connected = True
|
||||||
Version = '3.0'
|
Version = '3.0'
|
||||||
|
|||||||
@ -14,7 +14,6 @@ type
|
|||||||
StyleManager: TJvNavPaneStyleManager;
|
StyleManager: TJvNavPaneStyleManager;
|
||||||
TBXSwitcher: TTBXSwitcher;
|
TBXSwitcher: TTBXSwitcher;
|
||||||
cxIntl: TcxIntl;
|
cxIntl: TcxIntl;
|
||||||
JvAppRegistryStorage: TJvAppRegistryStorage;
|
|
||||||
cxIntlPrintSys31: TcxIntlPrintSys3;
|
cxIntlPrintSys31: TcxIntlPrintSys3;
|
||||||
procedure DAClientDataModuleCreate(Sender: TObject);
|
procedure DAClientDataModuleCreate(Sender: TObject);
|
||||||
procedure DataModuleDestroy(Sender: TObject);
|
procedure DataModuleDestroy(Sender: TObject);
|
||||||
@ -83,7 +82,7 @@ end;
|
|||||||
|
|
||||||
procedure TdmBase.LeerConfiguracion;
|
procedure TdmBase.LeerConfiguracion;
|
||||||
begin
|
begin
|
||||||
dmConexion.TargetURL := JvAppRegistryStorage.ReadString('ServerURL', SERVER_URL);
|
dmConfiguracion.LeerConfiguracion;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TdmBase.OnTBXThemeChange(Sender: TObject);
|
procedure TdmBase.OnTBXThemeChange(Sender: TObject);
|
||||||
@ -96,12 +95,7 @@ end;
|
|||||||
|
|
||||||
procedure TdmBase.SalvarConfiguracion;
|
procedure TdmBase.SalvarConfiguracion;
|
||||||
begin
|
begin
|
||||||
JvAppRegistryStorage.BeginUpdate;
|
dmConfiguracion.SalvarConfiguracion;
|
||||||
try
|
|
||||||
JvAppRegistryStorage.WriteString('ServerURL', dmConexion.TargetURL);
|
|
||||||
finally
|
|
||||||
JvAppRegistryStorage.EndUpdate;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TdmBase.DarVersion: String;
|
function TdmBase.DarVersion: String;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ uses
|
|||||||
uDABINAdapter, uROClient, uROBinMessage, uROWinInetHttpChannel;
|
uDABINAdapter, uROClient, uROBinMessage, uROWinInetHttpChannel;
|
||||||
|
|
||||||
const
|
const
|
||||||
SERVER_URL = 'http://localhost:8099/bin';
|
SERVER_URL = 'http://localhost:8099/bin'; // Dirección por defecto del servidor
|
||||||
|
|
||||||
type
|
type
|
||||||
TdmConexion = class(TDataModule)
|
TdmConexion = class(TDataModule)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Classes, uROServiceComponent, uRORemoteService, uDADataTable,
|
SysUtils, Classes, uROServiceComponent, uRORemoteService, uDADataTable,
|
||||||
uDABINAdapter, uROClient, uROBinMessage, uROWinInetHttpChannel;
|
uDABINAdapter, uROClient, uROBinMessage, uROWinInetHttpChannel, IniFiles;
|
||||||
|
|
||||||
const
|
const
|
||||||
SERVER_URL = 'http://localhost:8099/bin';
|
SERVER_URL = 'http://localhost:8099/bin';
|
||||||
@ -15,8 +15,14 @@ type
|
|||||||
ROMessage: TROBinMessage;
|
ROMessage: TROBinMessage;
|
||||||
DABINAdapter: TDABINAdapter;
|
DABINAdapter: TDABINAdapter;
|
||||||
RORemoteService: TRORemoteService;
|
RORemoteService: TRORemoteService;
|
||||||
|
private
|
||||||
|
FIniFile : TIniFile;
|
||||||
public
|
public
|
||||||
function darValor(const CODIGO: String): Variant;
|
function DarValor(const CODIGO: String): Variant;
|
||||||
|
procedure LeerConfiguracion;
|
||||||
|
procedure SalvarConfiguracion;
|
||||||
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -26,14 +32,39 @@ implementation
|
|||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
uses FactuGES_Intf, Variants;
|
uses
|
||||||
|
Forms, FactuGES_Intf, Variants, uDataModuleConexion;
|
||||||
|
|
||||||
|
|
||||||
{ TdmConfiguracion }
|
{ TdmConfiguracion }
|
||||||
|
|
||||||
function TdmConfiguracion.darValor(const CODIGO: String): Variant;
|
constructor TdmConfiguracion.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
Result := (RORemoteService as IsrvConfiguracion).darValor(CODIGO);
|
inherited;
|
||||||
|
FIniFile := TIniFile.Create(ChangeFileExt(Application.ExeName, '.ini' ) );
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TdmConfiguracion.DarValor(const CODIGO: String): Variant;
|
||||||
|
begin
|
||||||
|
Result := (RORemoteService as IsrvConfiguracion).DarValor(CODIGO);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TdmConfiguracion.Destroy;
|
||||||
|
begin
|
||||||
|
FreeAndNIL(FIniFile);
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TdmConfiguracion.LeerConfiguracion;
|
||||||
|
begin
|
||||||
|
with FIniFile do
|
||||||
|
dmConexion.TargetURL := ReadString('Server', 'URL', SERVER_URL);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TdmConfiguracion.SalvarConfiguracion;
|
||||||
|
begin
|
||||||
|
with FIniFile do
|
||||||
|
WriteString('Server', 'URL', dmConexion.TargetURL);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Reference in New Issue
Block a user