unit uEditorElegirArticulosFacturaProveedor;

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,
  uIEditorElegirArticulosFacturasProveedor, uBizContactos,
  uDAInterfaces, uViewGridBase, uViewGrid, uViewArticulos;

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

  public
    property Proveedor: IBizProveedor read GetProveedor write SetProveedor;
    constructor Create(AOwner: TComponent); override;

  end;


implementation
{$R *.dfm}

uses uViewElegirArticulosFacturasProveedor;

{ TfEditorElegirArticulosFacturaCliente }

constructor TfEditorElegirArticulosFacturaProveedor.Create(AOwner: TComponent);
begin
  inherited;
  ViewGrid := CreateView(TfrViewElegirArticulosFacturasProveedor) as IViewElegirArticulosFacturasProveedor;
end;

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

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

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

end.
