unit uPluginArticulos;

interface

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

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

  TPluginArticulos = class(TModuleController, IMCArticulos)
    actArticulos: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    N1: TMenuItem;
    Articulos1: TMenuItem;
    procedure actArticulosExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uArticulosController, uBizArticulos, uArticulosViewRegister;

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

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginArticulos.actArticulosExecute(Sender: TObject);
var
  AArticulosController : IArticulosController;

begin
  AArticulosController := TArticulosController.Create;
  AArticulosController.VerTodos;
end;

constructor TPluginArticulos.Create(AOwner: TComponent);
begin
  inherited;
  uArticulosViewRegister.RegisterViews;
end;

destructor TPluginArticulos.Destroy;
begin
  uArticulosViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginArticulos);

finalization
  UnRegisterModuleClass(TPluginArticulos);

end.
