This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES2/Source/Modulos/Banca electronica/Views/uEditorExportacionNorma19SEPA.pas
2013-12-13 09:42:56 +00:00

229 lines
6.3 KiB
ObjectPascal

unit uEditorExportacionNorma19SEPA;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, pngimage, cxControls, cxContainer, cxEdit,
cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar,
uIEditorExportacionNorma19SEPA, JvExControls, JvComponent, JvgWizardHeader,
JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvFormPlacement,
JvDialogs, Mask, JvExMask, JvToolEdit, ActnList;
type
TfEditorExportacionNorma19SEPA = class(TForm, IEditorExportacionNorma19SEPA)
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;
Label7: TLabel;
edtCodigoIdentif: TcxMaskEdit;
Label8: TLabel;
Label9: TLabel;
edtINE: TcxMaskEdit;
Label10: 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;
function GetCodigoINE: String;
procedure SetCodigoINE(const Value: String);
procedure SetCodigoIdentif(const Value: String);
function GetCodigoIdentif: 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 CodigoIdentif : String read GetCodigoIdentif write SetCodigoIdentif;
property CodigoINE : String read GetCodigoINE write SetCodigoINE;
property FechaCargo : TDateTime read GetFechaCargo write SetFechaCargo;
property Fichero : String read GetFichero write SetFichero;
end;
implementation
{$R *.dfm}
uses
uDialogUtils;
{ TfEditorExportacionNorma32 }
procedure TfEditorExportacionNorma19SEPA.actVolcarExecute(Sender: TObject);
begin
FFichero := JvFilenameEdit1.FileName;
ModalResult := mrOk;
end;
procedure TfEditorExportacionNorma19SEPA.actVolcarUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled :=
(Length(edtCodEntidad.Text) = 4) and
(Length(edtCodAgencia.Text) = 4) and
(Length(JvFilenameEdit1.Text) > 0)
end;
procedure TfEditorExportacionNorma19SEPA.CancelBtnClick(Sender: TObject);
begin
Close;
end;
procedure TfEditorExportacionNorma19SEPA.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 TfEditorExportacionNorma19SEPA.GetCodigoAgencia: String;
begin
Result := edtCodAgencia.Text;
end;
function TfEditorExportacionNorma19SEPA.GetCodigoEntidad: String;
begin
Result := edtCodEntidad.Text;
end;
function TfEditorExportacionNorma19SEPA.GetCodigoINE: String;
begin
Result := edtINE.Text;
end;
function TfEditorExportacionNorma19SEPA.GetFechaCargo: TDateTime;
begin
Result := edtFechaCargo.Date;
end;
function TfEditorExportacionNorma19SEPA.GetFichero: String;
begin
Result := FFichero;
end;
function TfEditorExportacionNorma19SEPA.GetCodigoIdentif: String;
begin
Result := edtCodigoIdentif.Text;
end;
procedure TfEditorExportacionNorma19SEPA.OKBtnClick(Sender: TObject);
var
ASaveDialog : TSaveDialog; // Save dialog variable
AArchivo : string;
ARuta : String;
begin
AArchivo := FFichero;
ARuta := ExtractFilePath(Application.ExeName);
// ASaveDialog := TSaveDialog.Create(nil);
// try
// ASaveDialog.Title := 'Volcar a disco la remesa';
// ASaveDialog.FileName := FFichero;
//
// ASaveDialog.InitialDir := GetCurrentDir;
//
// ASaveDialog.Filter := 'Ficheros de norma 19 (*.C19)|*.C19';
// ASaveDialog.DefaultExt := 'C19';
// ASaveDialog.FilterIndex := 1;
//
// try
// if ASaveDialog.Execute then
// begin
// FFichero := ASaveDialog.FileName;
// ModalResult := mrOk
// end
// else begin
// ModalResult := mrCancel;
// end;
// except
// on e: exception do
// ShowErrorMessage('error', 'error', e);
// end;
// finally
// FreeAndNIL(ASaveDialog);
// end;
{ if SaveFileDialog(Application.Handle, 'C19', 'Ficheros de norma 19 (*.C19)|*.C19',
'c:\', 'Volcar a disco la remesa', FFichero) then}
if SaveFileDialog(Application.Handle, 'C19', 'Ficheros de norma 19 (*.C19)|*.C19',
ARuta, 'Volcar a disco la remesa', AArchivo) then
ModalResult := mrOk
else
ModalResult := mrCancel;
end;
procedure TfEditorExportacionNorma19SEPA.SetCodigoAgencia(const AValue: String);
begin
edtCodAgencia.Text := AValue;
end;
procedure TfEditorExportacionNorma19SEPA.SetCodigoEntidad(const AValue: String);
begin
edtCodEntidad.Text := AValue;
end;
procedure TfEditorExportacionNorma19SEPA.SetCodigoINE(const Value: String);
begin
edtINE.Text := Value;
end;
procedure TfEditorExportacionNorma19SEPA.SetFechaCargo(const AValue: TDateTime);
begin
edtFechaCargo.Date := AValue;
end;
procedure TfEditorExportacionNorma19SEPA.SetFichero(const AValue: String);
begin
FFichero := AValue;
JvFilenameEdit1.InitialDir := ExtractFilePath(Application.ExeName);
JvFilenameEdit1.FileName := JvFilenameEdit1.InitialDir + PathDelim + FFichero;
end;
procedure TfEditorExportacionNorma19SEPA.SetCodigoIdentif(const Value: String);
begin
edtCodigoIdentif.Text := Value;
end;
end.