unit uEditorElegirArticulosAlbaranProveedor;

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

type
  TfEditorElegirArticulosAlbaranProveedor = class(TfEditorElegirArticulos, IEditorElegirArticulosAlbaranesProveedor)
    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 uViewElegirArticulosAlbaranesProveedor;

{ TfEditorElegirArticulosAlbaranProveedor }

constructor TfEditorElegirArticulosAlbaranProveedor.Create(AOwner: TComponent);
begin
  inherited;
  ViewGrid := CreateView(TfrViewElegirArticulosAlbaranesProveedor) as IViewElegirArticulosAlbaranesProveedor;
end;

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

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

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

end.
