uViewDatosYSeleccionCliente: poder cargar un cliente a partir de su ID.
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@201 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
9321382e5c
commit
bec1558551
@ -22,6 +22,10 @@ type
|
|||||||
procedure SetCliente(Value: IBizCliente);
|
procedure SetCliente(Value: IBizCliente);
|
||||||
property Cliente: IBizCliente read GetCliente write SetCliente;
|
property Cliente: IBizCliente read GetCliente write SetCliente;
|
||||||
|
|
||||||
|
function GetID_Cliente: integer;
|
||||||
|
procedure SetID_Cliente(const Value: integer);
|
||||||
|
property ID_Cliente: integer read GetID_Cliente write SetID_Cliente;
|
||||||
|
|
||||||
function GetOnClienteChanged : TNotifyEvent;
|
function GetOnClienteChanged : TNotifyEvent;
|
||||||
procedure SetOnClienteChanged (const Value : TNotifyEvent);
|
procedure SetOnClienteChanged (const Value : TNotifyEvent);
|
||||||
property OnClienteChanged : TNotifyEvent read GetOnClienteChanged
|
property OnClienteChanged : TNotifyEvent read GetOnClienteChanged
|
||||||
@ -83,14 +87,16 @@ type
|
|||||||
function GetOnClienteChanged : TNotifyEvent;
|
function GetOnClienteChanged : TNotifyEvent;
|
||||||
procedure SetOnClienteChanged (const Value : TNotifyEvent);
|
procedure SetOnClienteChanged (const Value : TNotifyEvent);
|
||||||
procedure SetReadOnly(Value: Boolean); override;
|
procedure SetReadOnly(Value: Boolean); override;
|
||||||
|
function GetID_Cliente: integer;
|
||||||
|
procedure SetID_Cliente(const Value: integer);
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
destructor Destroy; override;
|
||||||
property Controller: IClientesController read GetController write SetController;
|
property Controller: IClientesController read GetController write SetController;
|
||||||
property Cliente: IBizCliente read GetCliente write SetCliente;
|
property Cliente: IBizCliente read GetCliente write SetCliente;
|
||||||
property OnClienteChanged : TNotifyEvent read GetOnClienteChanged write SetOnClienteChanged;
|
property OnClienteChanged : TNotifyEvent read GetOnClienteChanged write SetOnClienteChanged;
|
||||||
property MsgElegirCliente : String read GetMsgElegirCliente write SetMsgElegirCliente;
|
property MsgElegirCliente : String read GetMsgElegirCliente write SetMsgElegirCliente;
|
||||||
|
property ID_Cliente: integer read GetID_Cliente write SetID_Cliente;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -125,15 +131,15 @@ var
|
|||||||
ACliente : IBizCliente;
|
ACliente : IBizCliente;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
ACliente := (FController.Nuevo as IBizCliente);
|
ACliente := (Controller.Nuevo as IBizCliente);
|
||||||
FController.Ver(ACliente);
|
Controller.Ver(ACliente);
|
||||||
Cliente := ACliente;
|
Cliente := ACliente;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDatosYSeleccionCliente.actVerContactoExecute(Sender: TObject);
|
procedure TfrViewDatosYSeleccionCliente.actVerContactoExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
FController.Ver(Cliente);
|
Controller.Ver(Cliente);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrViewDatosYSeleccionCliente.actVerContactoUpdate(Sender: TObject);
|
procedure TfrViewDatosYSeleccionCliente.actVerContactoUpdate(Sender: TObject);
|
||||||
@ -146,6 +152,13 @@ constructor TfrViewDatosYSeleccionCliente.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
FMsgElegirCliente := '';
|
FMsgElegirCliente := '';
|
||||||
|
FController := NIL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TfrViewDatosYSeleccionCliente.Destroy;
|
||||||
|
begin
|
||||||
|
FController := NIL;
|
||||||
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TfrViewDatosYSeleccionCliente.GetCliente: IBizCliente;
|
function TfrViewDatosYSeleccionCliente.GetCliente: IBizCliente;
|
||||||
@ -155,9 +168,18 @@ end;
|
|||||||
|
|
||||||
function TfrViewDatosYSeleccionCliente.GetController: IClientesController;
|
function TfrViewDatosYSeleccionCliente.GetController: IClientesController;
|
||||||
begin
|
begin
|
||||||
|
if not Assigned(FController) then
|
||||||
|
FController := TClientesController.Create;
|
||||||
Result := FController;
|
Result := FController;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TfrViewDatosYSeleccionCliente.GetID_Cliente: integer;
|
||||||
|
begin
|
||||||
|
Result := -1;
|
||||||
|
if Assigned(FCliente) then
|
||||||
|
Result := FCliente.ID;
|
||||||
|
end;
|
||||||
|
|
||||||
function TfrViewDatosYSeleccionCliente.GetMsgElegirCliente: String;
|
function TfrViewDatosYSeleccionCliente.GetMsgElegirCliente: String;
|
||||||
begin
|
begin
|
||||||
Result := FMsgElegirCliente;
|
Result := FMsgElegirCliente;
|
||||||
@ -181,9 +203,17 @@ end;
|
|||||||
|
|
||||||
procedure TfrViewDatosYSeleccionCliente.SetController(Value: IClientesController);
|
procedure TfrViewDatosYSeleccionCliente.SetController(Value: IClientesController);
|
||||||
begin
|
begin
|
||||||
|
if Assigned(FController) then
|
||||||
|
FController := NIL;
|
||||||
|
|
||||||
FController := Value;
|
FController := Value;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrViewDatosYSeleccionCliente.SetID_Cliente(const Value: integer);
|
||||||
|
begin
|
||||||
|
Self.Cliente := IBizCliente(Controller.Buscar(Value));
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrViewDatosYSeleccionCliente.SetMsgElegirCliente(
|
procedure TfrViewDatosYSeleccionCliente.SetMsgElegirCliente(
|
||||||
const Value: String);
|
const Value: String);
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user