This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranDevCliente.pas

97 lines
2.8 KiB
ObjectPascal

unit uViewAlbaranDevCliente;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewAlbaranCliente, cxGraphics, ActnList, DB, uDADataTable,
dxLayoutControl, StdCtrls, cxDropDownEdit, cxLookupEdit, cxDBLookupEdit,
cxDBLookupComboBox, cxTextEdit, Buttons, uCustomView, uViewBase,
uViewDatosYSeleccionCliente, cxDBEdit, cxMemo, cxContainer, cxEdit,
cxMaskEdit, cxCalendar, cxControls, uBizAlbaranesCliente;
type
TfrViewAlbaranDevCliente = class(TfrViewAlbaranCliente)
dxLayoutControl1Item17: TdxLayoutItem;
eReferenciaAlbaranCli: TcxTextEdit;
dxLayoutControl1Item25: TdxLayoutItem;
Button2: TButton;
dxLayoutControl1Group16: TdxLayoutGroup;
actVerAlbaranCli: TAction;
procedure actVerAlbaranCliExecute(Sender: TObject);
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure actVerAlbaranCliUpdate(Sender: TObject);
procedure frViewClienteAlbaranactElegirContactoUpdate(Sender: TObject);
protected
FAlbaranAsociado : IBizAlbaranCliente;
procedure SetAlbaran(const Value: IBizAlbaranCliente); override;
end;
var
frViewAlbaranDevCliente: TfrViewAlbaranDevCliente;
implementation
{$R *.dfm}
procedure TfrViewAlbaranDevCliente.actVerAlbaranCliExecute(Sender: TObject);
begin
inherited;
Controller.Ver(FAlbaranAsociado);
end;
procedure TfrViewAlbaranDevCliente.actVerAlbaranCliUpdate(Sender: TObject);
begin
if (Sender as TAction).Enabled then
(Sender as TAction).Enabled := Assigned(FAlbaranAsociado);
end;
procedure TfrViewAlbaranDevCliente.CustomViewCreate(Sender: TObject);
begin
inherited;
FAlbaranAsociado := NIL;
end;
procedure TfrViewAlbaranDevCliente.CustomViewDestroy(Sender: TObject);
begin
FAlbaranAsociado := NIL;
inherited;
end;
procedure TfrViewAlbaranDevCliente.frViewClienteAlbaranactElegirContactoUpdate(
Sender: TObject);
begin
inherited;
if (Sender as TAction).Enabled then
(Sender as TAction).Enabled := not Assigned(FAlbaranAsociado);
end;
procedure TfrViewAlbaranDevCliente.SetAlbaran(const Value: IBizAlbaranCliente);
begin
inherited;
if Assigned(FAlbaran) then
begin
FAlbaranAsociado := NIL;
if (FAlbaran.ID_ALBARAN_DEV > 0) then
begin
FAlbaranAsociado := Controller.Buscar(FAlbaran.ID_ALBARAN_DEV);
if Assigned(FAlbaranAsociado) then
begin
FAlbaranAsociado.DataTable.Active := True;
eReferenciaAlbaranCli.Text := FAlbaranAsociado.REFERENCIA
end
else
eReferenciaAlbaranCli.Text := '';
end
else
eReferenciaAlbaranCli.Text := 'No hay pedido asociado';
end
else begin
FAlbaranAsociado := NIL;
end;
end;
end.