111 lines
3.3 KiB
ObjectPascal
111 lines
3.3 KiB
ObjectPascal
|
|
unit uEditorElegirPersonaContactoCliente;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
|||
|
|
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
|
|||
|
|
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
|
|||
|
|
uIEditorElegirPersonaContactoCliente, uCustomView,
|
|||
|
|
uViewBase, uViewBarraSeleccion, JvExControls, JvComponent, JvgWizardHeader,
|
|||
|
|
DBCGrids, uBizContactosPersonal, uDAInterfaces;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfEditorElegirPersonaContactoCliente = class(TForm, IEditorElegirPersonaContactoCliente)
|
|||
|
|
dsPersonas: TDADataSource;
|
|||
|
|
frViewBarraSeleccion1: TfrViewBarraSeleccion;
|
|||
|
|
JvgWizardHeader1: TJvgWizardHeader;
|
|||
|
|
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 frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
|
|||
|
|
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
|
|||
|
|
procedure DBCtrlGrid1DblClick(Sender: TObject);
|
|||
|
|
procedure ComponenteDblClick(Sender: TObject);
|
|||
|
|
|
|||
|
|
protected
|
|||
|
|
FPersonas: IBizContactoPersonal;
|
|||
|
|
function GetPersonas: IBizContactoPersonal;
|
|||
|
|
procedure SetPersonas(const Value: IBizContactoPersonal);
|
|||
|
|
|
|||
|
|
function GetPersonaSeleccionada: IBizContactoPersonal;
|
|||
|
|
|
|||
|
|
procedure SetMensaje (const AValue: String);
|
|||
|
|
function GetMensaje: String;
|
|||
|
|
public
|
|||
|
|
property Mensaje : String read GetMensaje write SetMensaje;
|
|||
|
|
property Personas: IBizContactoPersonal read GetPersonas write SetPersonas;
|
|||
|
|
property PersonaSeleccionada: IBizContactoPersonal read GetPersonaSeleccionada;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
uDireccionesContactoController;
|
|||
|
|
|
|||
|
|
{ TfEditorDireccionEntrega }
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContactoCliente.DBCtrlGrid1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frViewBarraSeleccion1.actSeleccionar.Execute;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContactoCliente.ComponenteDblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
DBCtrlGrid1DblClick(Sender);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContactoCliente.frViewBarraSeleccion1actCancelarExecute(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ModalResult := mrCancel;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContactoCliente.frViewBarraSeleccion1actSeleccionarExecute(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ModalResult := mrOk;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPersonaContactoCliente.GetPersonas: IBizContactoPersonal;
|
|||
|
|
begin
|
|||
|
|
Result := FPersonas;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPersonaContactoCliente.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;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPersonaContactoCliente.GetMensaje: String;
|
|||
|
|
begin
|
|||
|
|
Result := JvgWizardHeader1.Comments.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContactoCliente.SetPersonas(const Value: IBizContactoPersonal);
|
|||
|
|
begin
|
|||
|
|
FPersonas := Value;
|
|||
|
|
if Assigned(FPersonas) then
|
|||
|
|
dsPersonas.DataTable := FPersonas.DataTable
|
|||
|
|
else
|
|||
|
|
dsPersonas.DataTable := NIL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPersonaContactoCliente.SetMensaje(const AValue: String);
|
|||
|
|
begin
|
|||
|
|
JvgWizardHeader1.Comments.Text := AValue;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|