git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@549 0c75b7a4-871f-7646-8a2f-f78d34cc349f
67 lines
1.9 KiB
ObjectPascal
67 lines
1.9 KiB
ObjectPascal
unit uViewDatosClientePresupuesto;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uViewDatosYSeleccionCliente, ImgList, PngImageList, ActnList, DB,
|
|
uDAInterfaces, uDADataTable, dxLayoutControl, StdCtrls, Buttons, cxContainer,
|
|
cxEdit, cxTextEdit, cxDBEdit, cxControls, cxMaskEdit, cxButtonEdit,
|
|
uBizContactos;
|
|
|
|
type
|
|
TfrViewDatosClientePresupuesto = class(TfrViewDatosYSeleccionCliente)
|
|
dxLayoutControl1Item10: TdxLayoutItem;
|
|
edtPersonaContacto: TcxDBButtonEdit;
|
|
dsPresupuesto: TDADataSource;
|
|
actElegirPersonaContacto: TAction;
|
|
procedure edtPersonaContactoPropertiesButtonClick(Sender: TObject;
|
|
AButtonIndex: Integer);
|
|
procedure actElegirPersonaContactoExecute(Sender: TObject);
|
|
protected
|
|
procedure SetCliente(Value: IBizCliente); override;
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses
|
|
uBizContactosPersonal;
|
|
|
|
procedure TfrViewDatosClientePresupuesto.actElegirPersonaContactoExecute(
|
|
Sender: TObject);
|
|
var
|
|
APersona : IBizContactoPersonal;
|
|
begin
|
|
inherited;
|
|
APersona := FController.ElegirPersonaContacto(FCliente.Personal, 'El cliente dispone de personas de contacto dadas de alta en su ficha. Seleccione la que quiere utilizar.');
|
|
if Assigned(APersona) then
|
|
begin
|
|
dsPresupuesto.DataTable.Edit;
|
|
edtPersonaContacto.DataBinding.Field.AsString := APersona.NOMBRE;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrViewDatosClientePresupuesto.edtPersonaContactoPropertiesButtonClick(
|
|
Sender: TObject; AButtonIndex: Integer);
|
|
begin
|
|
inherited;
|
|
actElegirPersonaContacto.Execute;
|
|
end;
|
|
|
|
procedure TfrViewDatosClientePresupuesto.SetCliente(Value: IBizCliente);
|
|
begin
|
|
inherited;
|
|
if Assigned(FCliente) and Assigned(FCliente.Personal) then
|
|
begin
|
|
FCliente.Personal.Open;
|
|
edtPersonaContacto.Properties.Buttons[0].Visible := (FCliente.Personal.RecordCount > 0);
|
|
end;
|
|
end;
|
|
|
|
end.
|