git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@151 93f398dd-4eb6-7a46-baf6-13f46f578da2
94 lines
2.7 KiB
ObjectPascal
94 lines
2.7 KiB
ObjectPascal
unit uEditorDireccionEntregaAlbaranCliente;
|
|
|
|
interface
|
|
|
|
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
|
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
|
|
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
|
|
uIEditorDireccionEntregaAlbaranCliente, uBizAlbaranesCliente, uDAInterfaces,
|
|
cxMemo;
|
|
|
|
type
|
|
TfEditorDireccionEntregaAlbaranCliente = class(TForm, IEditorDireccionEntregaAlbaranCliente)
|
|
OKBtn: TButton;
|
|
CancelBtn: TButton;
|
|
Bevel1: TBevel;
|
|
eDireccion2: TDBEdit;
|
|
ePoblacion: TDBEdit;
|
|
eProvincia: TDBEdit;
|
|
eCodigoPostal: TDBEdit;
|
|
Label1: TLabel;
|
|
Label2: TLabel;
|
|
Label3: TLabel;
|
|
Label4: TLabel;
|
|
dsDireccion: TDADataSource;
|
|
Label6: TLabel;
|
|
ePersonaContacto: TDBEdit;
|
|
Label7: TLabel;
|
|
eTelefono: TDBEdit;
|
|
eDireccion: TcxDBMemo;
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
private
|
|
pDireccion: String;
|
|
pPoblacion: String;
|
|
pProvincia: String;
|
|
pCodigoPostal: String;
|
|
pPersonaContacto: String;
|
|
pTelefono: String;
|
|
|
|
FAlbaran : IBizAlbaranCliente;
|
|
function GetAlbaran: IBizAlbaranCliente;
|
|
procedure SetAlbaran(const Value: IBizAlbaranCliente);
|
|
property Albaran: IBizAlbaranCliente read GetAlbaran write SetAlbaran;
|
|
end;
|
|
|
|
implementation
|
|
{$R *.dfm}
|
|
|
|
|
|
{ TfEditorDireccionEntrega }
|
|
|
|
procedure TfEditorDireccionEntregaAlbaranCliente.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
begin
|
|
//En el caso de cancelar se recuperan los valores iniciales
|
|
if (Self.ModalResult <> mrOk) and (dsDireccion.DataTable.State in dsEditModes) then
|
|
begin
|
|
eDireccion.EditValue := pDireccion;
|
|
ePoblacion.Field.Value := pPoblacion;
|
|
eProvincia.Field.Value := pProvincia;
|
|
eCodigoPostal.Field.Value := pCodigoPostal;
|
|
ePersonaContacto.Field.Value := pPersonaContacto;
|
|
eTelefono.Field.Value := pTelefono;
|
|
end;
|
|
end;
|
|
|
|
procedure TfEditorDireccionEntregaAlbaranCliente.FormShow(Sender: TObject);
|
|
begin
|
|
//Guardamos los valores iniciales por si al final el usuario cancela
|
|
pDireccion := eDireccion.Text;
|
|
pPoblacion := ePoblacion.Text;
|
|
pProvincia := eProvincia.Text;
|
|
pCodigoPostal := eCodigoPostal.Text;
|
|
pPersonaContacto := ePersonaContacto.Text;
|
|
pTelefono := eTelefono.Text;
|
|
end;
|
|
|
|
function TfEditorDireccionEntregaAlbaranCliente.GetAlbaran: IBizAlbaranCliente;
|
|
begin
|
|
Result := FAlbaran;
|
|
end;
|
|
|
|
procedure TfEditorDireccionEntregaAlbaranCliente.SetAlbaran(const Value: IBizAlbaranCliente);
|
|
begin
|
|
FAlbaran := Value;
|
|
if Assigned(FAlbaran) then
|
|
dsDireccion.DataTable := FAlbaran.DataTable
|
|
else
|
|
dsDireccion.DataTable := NIL;
|
|
end;
|
|
|
|
end.
|