git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/tags/1.0.9@15 c93665c3-c93d-084d-9b98-7d5f4a9c3376
72 lines
1.7 KiB
ObjectPascal
72 lines
1.7 KiB
ObjectPascal
unit uConexionOSC;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uFrameConfiguracion, ActnList, StdCtrls, cxControls, cxContainer,
|
|
cxEdit, cxTextEdit, cxDBEdit;
|
|
|
|
type
|
|
TfrConexionOSC = class(TFrameConfiguracion)
|
|
GroupBox1: TGroupBox;
|
|
Label1: TLabel;
|
|
Label3: TLabel;
|
|
Label4: TLabel;
|
|
Label5: TLabel;
|
|
bComprobar: TButton;
|
|
ActionList1: TActionList;
|
|
actAceptar: TAction;
|
|
actCancelar: TAction;
|
|
actComprobar: TAction;
|
|
edtBDSERVER: TcxTextEdit;
|
|
edtBDUSER: TcxTextEdit;
|
|
edtBDPASS: TcxTextEdit;
|
|
edtBDNAME: TcxTextEdit;
|
|
procedure actComprobarExecute(Sender: TObject);
|
|
protected
|
|
procedure Finalize; override;
|
|
public
|
|
procedure Init; override;
|
|
end;
|
|
|
|
var
|
|
frConexionOSC: TfrConexionOSC;
|
|
|
|
implementation
|
|
|
|
uses
|
|
uTiendaWebUtils, uDataModuleServer;
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TfrConexionOSC.actComprobarExecute(Sender: TObject);
|
|
var
|
|
AErrorMsg : String;
|
|
begin
|
|
if HayConexionConTienda(edtBDSERVER.Text, edtBDNAME.Text,
|
|
edtBDUSER.Text, edtBDPASS.Text, AErrorMsg) then
|
|
ShowMessage('Conexión válida con la tienda')
|
|
else
|
|
ShowMessage('No se ha podido establecer la conexión con la tienda web.' +
|
|
#10#13 + #10#13 + AErrorMsg);
|
|
end;
|
|
|
|
procedure TfrConexionOSC.Finalize;
|
|
begin
|
|
dmServer.FOSCServer := edtBDSERVER.Text;
|
|
dmServer.FOSCDBName := edtBDNAME.Text;
|
|
dmServer.FOSCUser := edtBDUSER.Text;
|
|
dmServer.FOSCPass := Encrypt(edtBDPASS.Text);
|
|
end;
|
|
|
|
procedure TfrConexionOSC.Init;
|
|
begin
|
|
edtBDSERVER.Text := dmServer.FOSCServer;
|
|
edtBDNAME.Text := dmServer.FOSCDBName;
|
|
edtBDUSER.Text := dmServer.FOSCUser;
|
|
edtBDPASS.Text := Decrypt(dmServer.FOSCPass);
|
|
end;
|
|
|
|
end.
|