unit uEditorElegirArticulosPedidoProveedor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uEditorElegirArticulos, 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,
  uIEditorElegirArticulosPedidosProveedor, uBizContactos,
  uDAInterfaces, StdCtrls;

type
  TfEditorElegirArticulosPedidoProveedor = class(TfEditorElegirArticulos, IEditorElegirArticulosPedidosProveedor)
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    FProveedor: IBizProveedor;
    function GetProveedor: IBizProveedor;
    procedure SetProveedor(const Value: IBizProveedor);

  protected
    procedure AsignarVista; override;

  public
    property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
  end;


implementation
{$R *.dfm}

uses uViewElegirArticulosPedidosProveedor;

{ TfEditorElegirArticulosPedidoProveedor }

procedure TfEditorElegirArticulosPedidoProveedor.AsignarVista;
begin
  ViewGrid := CreateView(TfrViewElegirArticulosPedidosProveedor) as IViewElegirArticulosPedidosProveedor;
end;

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

function TfEditorElegirArticulosPedidoProveedor.GetProveedor: IBizProveedor;
begin
  Result := FProveedor;
end;

procedure TfEditorElegirArticulosPedidoProveedor.SetProveedor(const Value: IBizProveedor);
begin
  FProveedor := Value;
  if Assigned(FProveedor) then
  begin
    if Assigned(Self.ViewGrid) then
       (Self.ViewGrid as IViewElegirArticulosPedidosProveedor).Proveedor := FProveedor;
  end;
end;

end.
