unit uEditorExportacionNorma19SEPAXML; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, pngimage, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, uIEditorExportacionNorma19SEPAXML, JvExControls, JvComponent, JvgWizardHeader, JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvFormPlacement, JvDialogs, Mask, JvExMask, JvToolEdit, ActnList; type TfEditorExportacionNorma19SEPAXML = class(TForm, IEditorExportacionNorma19SEPAXML) OKBtn: TButton; CancelBtn: TButton; Image1: TImage; Label2: TLabel; Label3: TLabel; edtCodEntidad: TcxMaskEdit; edtCodAgencia: TcxMaskEdit; Bevel1: TBevel; JvFormStorage: TJvFormStorage; JvAppRegistryStorage: TJvAppRegistryStorage; Label1: TLabel; Bevel2: TBevel; JvFilenameEdit1: TJvFilenameEdit; ActionList1: TActionList; actVolcar: TAction; Label5: TLabel; Label6: TLabel; Label4: TLabel; edtFechaCargo: TcxDateEdit; procedure OKBtnClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure CancelBtnClick(Sender: TObject); procedure actVolcarUpdate(Sender: TObject); procedure actVolcarExecute(Sender: TObject); private FFichero : String; protected procedure SetCodigoEntidad(const AValue: String); function GetCodigoEntidad : String; procedure SetCodigoAgencia(const AValue: String); function GetCodigoAgencia : String; procedure SetFechaCargo(const AValue: TDateTime); function GetFechaCargo : TDateTime; procedure SetFichero(const AValue: String); function GetFichero : String; public property CodigoEntidad : String read GetCodigoEntidad write SetCodigoEntidad; property CodigoAgencia : String read GetCodigoAgencia write SetCodigoAgencia; property FechaCargo : TDateTime read GetFechaCargo write SetFechaCargo; property Fichero : String read GetFichero write SetFichero; end; implementation {$R *.dfm} uses uDialogUtils; { TfEditorExportacionNorma32 } procedure TfEditorExportacionNorma19SEPAXML.actVolcarExecute(Sender: TObject); begin FFichero := JvFilenameEdit1.FileName; ModalResult := mrOk; end; procedure TfEditorExportacionNorma19SEPAXML.actVolcarUpdate(Sender: TObject); begin (Sender as TAction).Enabled := (Length(edtCodEntidad.Text) = 4) and (Length(edtCodAgencia.Text) = 4) and (Length(JvFilenameEdit1.Text) > 0) end; procedure TfEditorExportacionNorma19SEPAXML.CancelBtnClick(Sender: TObject); begin Close; end; procedure TfEditorExportacionNorma19SEPAXML.FormCreate(Sender: TObject); var APath : String; begin inherited; with JvFormStorage do begin if Pos('_', Self.Name) = 0 then APath := Self.Name else APath := Copy(Self.Name, 0, (Pos('_', Self.Name)-1)); AppStoragePath := APath; end; edtFechaCargo.Date := Now; end; function TfEditorExportacionNorma19SEPAXML.GetCodigoAgencia: String; begin Result := edtCodAgencia.Text; end; function TfEditorExportacionNorma19SEPAXML.GetCodigoEntidad: String; begin Result := edtCodEntidad.Text; end; function TfEditorExportacionNorma19SEPAXML.GetFechaCargo: TDateTime; begin Result := edtFechaCargo.Date; end; function TfEditorExportacionNorma19SEPAXML.GetFichero: String; begin Result := FFichero; end; procedure TfEditorExportacionNorma19SEPAXML.OKBtnClick(Sender: TObject); var ASaveDialog : TSaveDialog; // Save dialog variable AArchivo : string; ARuta : String; begin AArchivo := FFichero; ARuta := ExtractFilePath(Application.ExeName); { if SaveFileDialog(Application.Handle, 'C19', 'Ficheros de norma 19 (*.C19)|*.C19', 'c:\', 'Volcar a disco la remesa', FFichero) then} if SaveFileDialog(Application.Handle, 'XML', 'Ficheros de norma 19 (*.XML)|*.XML', ARuta, 'Volcar a disco la remesa', AArchivo) then ModalResult := mrOk else ModalResult := mrCancel; end; procedure TfEditorExportacionNorma19SEPAXML.SetCodigoAgencia(const AValue: String); begin edtCodAgencia.Text := AValue; end; procedure TfEditorExportacionNorma19SEPAXML.SetCodigoEntidad(const AValue: String); begin edtCodEntidad.Text := AValue; end; procedure TfEditorExportacionNorma19SEPAXML.SetFechaCargo(const AValue: TDateTime); begin edtFechaCargo.Date := AValue; end; procedure TfEditorExportacionNorma19SEPAXML.SetFichero(const AValue: String); begin FFichero := AValue; JvFilenameEdit1.InitialDir := ExtractFilePath(Application.ExeName); JvFilenameEdit1.FileName := JvFilenameEdit1.InitialDir + PathDelim + FFichero; end; end.