unit uPluginInventario;

interface

uses
  uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList,
  ImgList, Controls, PngImageList;

type
  IMCInventario = interface(IInterface)
  ['{704855B9-1196-44FF-884E-3EF052533CD4}']
  end;

  TPluginInventario = class(TModuleController, IMCInventario)
    actInventarioAlmacenes: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Logstica1: TMenuItem;
    Inventario1: TMenuItem;
    actInventarioObras: TAction;
    Inventarioobras1: TMenuItem;
    procedure actInventarioAlmacenesExecute(Sender: TObject);
    procedure actInventarioObrasExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uInventarioController, uBizInventario, uInventarioViewRegister;

function GetModule : TModuleController;
begin
  Result := TPluginInventario.Create(NIL);
end;

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginInventario.actInventarioAlmacenesExecute(Sender: TObject);
var
  AInventarioController : IInventarioController;
  AInventario : IBizInventario;

begin
  AInventarioController := TInventarioController.Create;
  AInventario := (AInventarioController.BuscarTodosAlmacenes as IBizInventario);
  AInventarioController.VerTodos(AInventario, CTE_INV_ALMACEN);
end;

procedure TPluginInventario.actInventarioObrasExecute(Sender: TObject);
var
  AInventarioController : IInventarioController;
  AInventario : IBizInventario;

begin
  AInventarioController := TInventarioController.Create;
//  AInventario := (AInventarioController.BuscarTodosObras as IBizInventario);
  AInventarioController.VerTodos(AInventario, CTE_INV_OBRA);
end;

constructor TPluginInventario.Create(AOwner: TComponent);
begin
  inherited;
  uInventarioViewRegister.RegisterViews;
end;

destructor TPluginInventario.Destroy;
begin
  uInventarioViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginInventario);

finalization
  UnRegisterModuleClass(TPluginInventario);

end.
