unit uPluginAlmacenes;

interface

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

type
  IMCAlmacenes = interface(IInterface)
  ['{ED6B467B-B6DD-4E2E-8E54-BCEB8FD0A012}']
  end;

  TPluginAlmacenes = class(TModuleController, IMCAlmacenes)
    actAlmacenes: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Ventas1: TMenuItem;
    Almacenes1: TMenuItem;
    procedure actAlmacenesExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uAlmacenesController, uBizAlmacenes, uAlmacenesViewRegister;

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

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginAlmacenes.actAlmacenesExecute(Sender: TObject);
var
  AAlmacenesController : IAlmacenesController;
  AAlmacenes : IBizAlmacen;

begin
  AAlmacenesController := TAlmacenesController.Create;
  AAlmacenes := (AAlmacenesController.BuscarTodos as IBizAlmacen);
  AAlmacenesController.VerTodos(AAlmacenes);
end;

constructor TPluginAlmacenes.Create(AOwner: TComponent);
begin
  inherited;
  uAlmacenesViewRegister.RegisterViews;
end;

destructor TPluginAlmacenes.Destroy;
begin
  uAlmacenesViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginAlmacenes);

finalization
  UnRegisterModuleClass(TPluginAlmacenes);

end.
