107 lines
3.1 KiB
ObjectPascal
107 lines
3.1 KiB
ObjectPascal
|
|
unit uEditorElegirDireccionEntrega;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
|||
|
|
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
|
|||
|
|
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
|
|||
|
|
uIEditorElegirDireccionEntrega, uCustomView,
|
|||
|
|
uViewBase, uViewBarraSeleccion, JvExControls, JvComponent, JvgWizardHeader,
|
|||
|
|
DBCGrids, uBizDireccionesContacto;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfEditorElegirDireccionEntrega = class(TForm, IEditorElegirDireccionEntrega)
|
|||
|
|
dsDirecciones: TDADataSource;
|
|||
|
|
frViewBarraSeleccion1: TfrViewBarraSeleccion;
|
|||
|
|
JvgWizardHeader1: TJvgWizardHeader;
|
|||
|
|
DBCtrlGrid1: TDBCtrlGrid;
|
|||
|
|
eCalle: TDBText;
|
|||
|
|
ePoblacion: TDBText;
|
|||
|
|
eTelefono: TDBText;
|
|||
|
|
eProvincia: TDBText;
|
|||
|
|
ePersonaContacto: TDBText;
|
|||
|
|
eNombre: TDBText;
|
|||
|
|
eCodigoPostal: TDBText;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
ePorte: TDBText;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
procedure frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
|
|||
|
|
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
|
|||
|
|
procedure DBCtrlGrid1DblClick(Sender: TObject);
|
|||
|
|
|
|||
|
|
protected
|
|||
|
|
FDirecciones: IBizDireccionesContacto;
|
|||
|
|
function GetDireccion: IBizDireccionesContacto;
|
|||
|
|
procedure SetDireccion(const Value: IBizDireccionesContacto);
|
|||
|
|
|
|||
|
|
procedure SetMensaje (const AValue: String);
|
|||
|
|
function GetMensaje: String;
|
|||
|
|
|
|||
|
|
function GetDireccionSeleccionada: IBizDireccionesContacto;
|
|||
|
|
public
|
|||
|
|
property Mensaje : String read GetMensaje write SetMensaje;
|
|||
|
|
property Direccion: IBizDireccionesContacto read GetDireccion write SetDireccion;
|
|||
|
|
property DireccionSeleccionada: IBizDireccionesContacto read GetDireccionSeleccionada;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
uDireccionesContactoController;
|
|||
|
|
|
|||
|
|
{ TfEditorDireccionEntrega }
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirDireccionEntrega.DBCtrlGrid1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frViewBarraSeleccion1.actSeleccionar.Execute;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirDireccionEntrega.frViewBarraSeleccion1actCancelarExecute(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ModalResult := mrCancel;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirDireccionEntrega.frViewBarraSeleccion1actSeleccionarExecute(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ModalResult := mrOk;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirDireccionEntrega.GetDireccion: IBizDireccionesContacto;
|
|||
|
|
begin
|
|||
|
|
Result := FDirecciones;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirDireccionEntrega.GetDireccionSeleccionada: IBizDireccionesContacto;
|
|||
|
|
begin
|
|||
|
|
// Devuelvo el mismo objeto que recibo pero con el punto de lectura
|
|||
|
|
// posicionado en la direcci<63>n elegida.
|
|||
|
|
Result := FDirecciones;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirDireccionEntrega.GetMensaje: String;
|
|||
|
|
begin
|
|||
|
|
Result := JvgWizardHeader1.Comments.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirDireccionEntrega.SetDireccion(const Value: IBizDireccionesContacto);
|
|||
|
|
begin
|
|||
|
|
FDirecciones := Value;
|
|||
|
|
if Assigned(FDirecciones) then
|
|||
|
|
dsDirecciones.DataTable := FDirecciones.DataTable
|
|||
|
|
else
|
|||
|
|
dsDirecciones.DataTable := NIL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirDireccionEntrega.SetMensaje(const AValue: String);
|
|||
|
|
begin
|
|||
|
|
JvgWizardHeader1.Comments.Text := AValue;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|