unit uConfFicherosEDI;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uFrameConfiguracion, StdCtrls, ExtCtrls, Mask, JvExMask,
  JvToolEdit, ActnList, JvSpin, cxControls, cxContainer, cxEdit,
  cxTextEdit, cxMaskEdit, cxSpinEdit;

type
  TfrConfFicherosEDI = class(TFrameConfiguracion)
    GroupBox1: TGroupBox;
    edtEntrada: TJvDirectoryEdit;
    Label1: TLabel;
    Label2: TLabel;
    edtAlmacen: TJvDirectoryEdit;
    bElegir1: TButton;
    bElegir2: TButton;
    bAbrir1: TButton;
    bAbrir2: TButton;
    ActionList1: TActionList;
    actAbrir1: TAction;
    actAbrir2: TAction;
    Panel1: TPanel;
    Label3: TLabel;
    edtDias: TcxSpinEdit;
    procedure bElegir1Click(Sender: TObject);
    procedure bElegir2Click(Sender: TObject);
    procedure actAbrir1Update(Sender: TObject);
    procedure actAbrir2Update(Sender: TObject);
    procedure actAbrir1Execute(Sender: TObject);
    procedure actAbrir2Execute(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure Finalize; override;
  public
    procedure Init; override;
  end;

implementation

uses uDataModuleServer, JclShell;

{$R *.dfm}

{ TfrConfFicherosEDI }

procedure TfrConfFicherosEDI.Finalize;
begin
  inherited;
  dmServer.FDirEntrada := edtEntrada.Text;
  dmServer.FDirAlmacen := edtAlmacen.Text;
  dmServer.FDias := edtDias.Value;
end;

procedure TfrConfFicherosEDI.Init;
begin
  inherited;
  edtEntrada.Text := dmServer.FDirEntrada;
  edtAlmacen.Text := dmServer.FDirAlmacen;
  edtDias.Value := dmServer.FDias;
end;

procedure TfrConfFicherosEDI.bElegir1Click(Sender: TObject);
begin
  inherited;
  edtEntrada.DoClick;
end;

procedure TfrConfFicherosEDI.bElegir2Click(Sender: TObject);
begin
  inherited;
  edtAlmacen.DoClick;
end;

procedure TfrConfFicherosEDI.actAbrir1Update(Sender: TObject);
begin
  inherited;
  (Sender as TAction).Enabled := (Length(edtEntrada.Text) > 0)
end;

procedure TfrConfFicherosEDI.actAbrir2Update(Sender: TObject);
begin
  inherited;
  (Sender as TAction).Enabled := (Length(edtAlmacen.Text) > 0)
end;

procedure TfrConfFicherosEDI.actAbrir1Execute(Sender: TObject);
begin
  inherited;
  OpenFolder(edtEntrada.Text);
end;

procedure TfrConfFicherosEDI.actAbrir2Execute(Sender: TObject);
begin
  inherited;
  OpenFolder(edtAlmacen.Text);
end;

end.
