git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@963 0c75b7a4-871f-7646-8a2f-f78d34cc349f
197 lines
5.3 KiB
ObjectPascal
197 lines
5.3 KiB
ObjectPascal
unit uEditorExportacionNorma19;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, ExtCtrls, StdCtrls, pngimage, cxControls, cxContainer, cxEdit,
|
|
cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar,
|
|
uIEditorExportacionNorma19, JvExControls, JvComponent,
|
|
JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvFormPlacement,
|
|
JvDialogs, Mask, JvExMask, JvToolEdit, ActnList;
|
|
|
|
type
|
|
TfEditorExportacionNorma19 = class(TForm, IEditorExportacionNorma19)
|
|
OKBtn: TButton;
|
|
CancelBtn: TButton;
|
|
Image1: TImage;
|
|
edtFechaCargo: TcxDateEdit;
|
|
Label2: TLabel;
|
|
Label3: TLabel;
|
|
Label4: TLabel;
|
|
edtCodEntidad: TcxMaskEdit;
|
|
edtCodAgencia: TcxMaskEdit;
|
|
lblTitle: TLabel;
|
|
lblComments: TLabel;
|
|
Bevel1: TBevel;
|
|
JvFormStorage: TJvFormStorage;
|
|
JvAppRegistryStorage: TJvAppRegistryStorage;
|
|
Label1: TLabel;
|
|
Bevel2: TBevel;
|
|
JvFilenameEdit1: TJvFilenameEdit;
|
|
ActionList1: TActionList;
|
|
actVolcar: TAction;
|
|
Label5: TLabel;
|
|
Label6: TLabel;
|
|
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: Integer);
|
|
function GetCodigoEntidad : Integer;
|
|
|
|
procedure SetCodigoAgencia(const AValue: Integer);
|
|
function GetCodigoAgencia : Integer;
|
|
|
|
procedure SetFechaCargo(const AValue: TDateTime);
|
|
function GetFechaCargo : TDateTime;
|
|
|
|
procedure SetFichero(const AValue: String);
|
|
function GetFichero : String;
|
|
public
|
|
property CodigoEntidad : Integer read GetCodigoEntidad write SetCodigoEntidad;
|
|
property CodigoAgencia : Integer read GetCodigoAgencia write SetCodigoAgencia;
|
|
property FechaCargo : TDateTime read GetFechaCargo write SetFechaCargo;
|
|
property Fichero : String read GetFichero write SetFichero;
|
|
end;
|
|
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses
|
|
uDialogUtils;
|
|
|
|
{ TfEditorExportacionNorma19 }
|
|
|
|
procedure TfEditorExportacionNorma19.actVolcarExecute(Sender: TObject);
|
|
begin
|
|
FFichero := JvFilenameEdit1.FileName;
|
|
ModalResult := mrOk;
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.actVolcarUpdate(Sender: TObject);
|
|
begin
|
|
(Sender as TAction).Enabled :=
|
|
(Length(edtCodEntidad.Text) = 4) and
|
|
(Length(edtCodAgencia.Text) = 4) and
|
|
(Length(JvFilenameEdit1.Text) > 0)
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.CancelBtnClick(Sender: TObject);
|
|
begin
|
|
Close;
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.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 TfEditorExportacionNorma19.GetCodigoAgencia: Integer;
|
|
begin
|
|
Result := StrToInt(edtCodAgencia.Text);
|
|
end;
|
|
|
|
function TfEditorExportacionNorma19.GetCodigoEntidad: Integer;
|
|
begin
|
|
Result := StrToInt(edtCodEntidad.Text);
|
|
end;
|
|
|
|
function TfEditorExportacionNorma19.GetFechaCargo: TDateTime;
|
|
begin
|
|
Result := edtFechaCargo.Date;
|
|
end;
|
|
|
|
function TfEditorExportacionNorma19.GetFichero: String;
|
|
begin
|
|
Result := FFichero;
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.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 TfEditorExportacionNorma19.SetCodigoAgencia(const AValue: Integer);
|
|
begin
|
|
edtCodAgencia.Text := IntToStr(AValue);
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.SetCodigoEntidad(const AValue: Integer);
|
|
begin
|
|
edtCodEntidad.Text := IntToStr(AValue);
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.SetFechaCargo(const AValue: TDateTime);
|
|
begin
|
|
edtFechaCargo.Date := AValue;
|
|
end;
|
|
|
|
procedure TfEditorExportacionNorma19.SetFichero(const AValue: String);
|
|
begin
|
|
FFichero := AValue;
|
|
JvFilenameEdit1.InitialDir := ExtractFilePath(Application.ExeName);
|
|
JvFilenameEdit1.FileName := JvFilenameEdit1.InitialDir + PathDelim + FFichero;
|
|
end;
|
|
|
|
end.
|