unit uEditorElegirArticulosPedidoCliente;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, DB, uDADataTable, JvAppStorage,
  JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList,
  StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls,
  JvExComCtrls, JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock,
  TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent, JvNavigationPane,
  uIEditorElegirArticulosPedidosCliente, uBizContactos,
  uDAInterfaces, uViewGridBase, uViewGrid, uViewArticulos, uBizArticulos,
  uEditorElegirArticulos, StdCtrls;

type
  TfEditorElegirArticulosPedidoCliente = class(TfEditorElegirArticulos, IEditorElegirArticulosPedidosCliente)
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    FCliente: IBizCliente;
    function GetCliente: IBizCliente;
    procedure SetCliente(const Value: IBizCliente);
  public
    property Cliente: IBizCliente read GetCliente write SetCliente;
    constructor Create(AOwner: TComponent); override;
  end;


implementation
{$R *.dfm}

uses uGridStatusUtils, uDBSelectionListUtils, uViewElegirArticulosPedidosCliente;

{ TfEditorElegirArticulosPedidoCliente }

constructor TfEditorElegirArticulosPedidoCliente.Create(AOwner: TComponent);
begin
  inherited;
  ViewGrid := CreateView(TfrViewElegirArticulosPedidosCliente) as IViewElegirArticulosPedidosCliente;
end;

procedure TfEditorElegirArticulosPedidoCliente.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  FCliente := Nil;
  inherited;
end;

function TfEditorElegirArticulosPedidoCliente.GetCliente: IBizCliente;
begin
  Result := FCliente;
end;

procedure TfEditorElegirArticulosPedidoCliente.SetCliente(const Value: IBizCliente);
begin
  FCliente := Value;
  if Assigned(FCliente) then
  begin

    if Assigned(Self.ViewGrid) then
       (Self.ViewGrid as IViewElegirArticulosPedidosCliente).Cliente := FCliente;
  end;
end;

end.
