Tecsitel_FactuGES2/Source/Modulos/Contactos/Views/uEditorElegirPersonaContacto.pas
david 1662789ccc * Ticket #166 -> En los pedidos a proveedor poder elegir una dirección si el proveedor tiene varias sucursales
* Repaso a presupuestos (apariencia de editor ficha).
* Limpieza de código repetido en contactos.

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@784 0c75b7a4-871f-7646-8a2f-f78d34cc349f
2008-11-27 16:14:51 +00:00

111 lines
3.2 KiB
ObjectPascal
Raw Blame History

unit uEditorElegirPersonaContacto;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
uIEditorElegirPersonaContacto, uCustomView,
uViewBase, uViewBarraSeleccion, JvExControls, JvComponent, JvgWizardHeader,
DBCGrids, uBizContactosPersonal, uDAInterfaces;
type
TfEditorElegirPersonaContacto = class(TForm, IEditorElegirPersonaContacto)
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 TfEditorElegirPersonaContacto.DBCtrlGrid1DblClick(Sender: TObject);
begin
frViewBarraSeleccion1.actSeleccionar.Execute;
end;
procedure TfEditorElegirPersonaContacto.ComponenteDblClick(Sender: TObject);
begin
DBCtrlGrid1DblClick(Sender);
end;
procedure TfEditorElegirPersonaContacto.frViewBarraSeleccion1actCancelarExecute(
Sender: TObject);
begin
ModalResult := mrCancel;
end;
procedure TfEditorElegirPersonaContacto.frViewBarraSeleccion1actSeleccionarExecute(
Sender: TObject);
begin
ModalResult := mrOk;
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;
function TfEditorElegirPersonaContacto.GetMensaje: String;
begin
Result := JvgWizardHeader1.Comments.Text;
end;
procedure TfEditorElegirPersonaContacto.SetPersonas(const Value: IBizContactoPersonal);
begin
FPersonas := Value;
if Assigned(FPersonas) then
dsPersonas.DataTable := FPersonas.DataTable
else
dsPersonas.DataTable := NIL;
end;
procedure TfEditorElegirPersonaContacto.SetMensaje(const AValue: String);
begin
JvgWizardHeader1.Comments.Text := AValue;
end;
end.