97 lines
2.6 KiB
ObjectPascal
97 lines
2.6 KiB
ObjectPascal
|
|
unit uEditorElegirPersonaContacto;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
|||
|
|
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
|
|||
|
|
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
|
|||
|
|
uIEditorElegirPersonaContacto, uCustomView, uDialogBase,
|
|||
|
|
uViewBase, uViewBarraSeleccion, JvExControls, JvComponent,
|
|||
|
|
DBCGrids, uBizContactosPersonal, uDAInterfaces, ActnList;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfEditorElegirPersonaContacto = class(TfDialogBase, IEditorElegirPersonaContacto)
|
|||
|
|
dsPersonas: TDADataSource;
|
|||
|
|
DBCtrlGrid1: TDBCtrlGrid;
|
|||
|
|
ePuesto: TDBText;
|
|||
|
|
eTelefono: TDBText;
|
|||
|
|
eNombre: TDBText;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
eMovil: TDBText;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
eFax: TDBText;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
eEMail: TDBText;
|
|||
|
|
procedure DBCtrlGrid1DblClick(Sender: TObject);
|
|||
|
|
procedure ComponenteDblClick(Sender: TObject);
|
|||
|
|
procedure actAceptarExecute(Sender: TObject);
|
|||
|
|
procedure actCancelarExecute(Sender: TObject);
|
|||
|
|
|
|||
|
|
protected
|
|||
|
|
FPersonas: IBizContactoPersonal;
|
|||
|
|
function GetPersonas: IBizContactoPersonal;
|
|||
|
|
procedure SetPersonas(const Value: IBizContactoPersonal);
|
|||
|
|
|
|||
|
|
function GetPersonaSeleccionada: IBizContactoPersonal;
|
|||
|
|
public
|
|||
|
|
property Personas: IBizContactoPersonal read GetPersonas write SetPersonas;
|
|||
|
|
property PersonaSeleccionada: IBizContactoPersonal read GetPersonaSeleccionada;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
uDireccionesContactoController;
|
|||
|
|
|
|||
|
|
{ TfEditorDireccionEntrega }
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContacto.DBCtrlGrid1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
actAceptar.Execute;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContacto.actAceptarExecute(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ModalResult := mrOk;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContacto.actCancelarExecute(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ModalResult := mrCancel;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContacto.ComponenteDblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
DBCtrlGrid1DblClick(Sender);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPersonaContacto.GetPersonas: IBizContactoPersonal;
|
|||
|
|
begin
|
|||
|
|
Result := FPersonas;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPersonaContacto.GetPersonaSeleccionada: IBizContactoPersonal;
|
|||
|
|
begin
|
|||
|
|
// Devuelvo el mismo objeto que recibo pero con el punto de lectura
|
|||
|
|
// posicionado en la direcci<63>n elegida.
|
|||
|
|
Result := FPersonas;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContacto.SetPersonas(const Value: IBizContactoPersonal);
|
|||
|
|
begin
|
|||
|
|
FPersonas := Value;
|
|||
|
|
if Assigned(FPersonas) then
|
|||
|
|
dsPersonas.DataTable := FPersonas.DataTable
|
|||
|
|
else
|
|||
|
|
dsPersonas.DataTable := NIL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
end.
|