unit uPluginFabricantes;

interface

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

type
  IMCFabricantes = interface(IInterface)
  ['{F7C8960F-5ECE-492B-8D6C-D068DAA66E6C}']
  end;

  TPluginFabricantes = class(TModuleController, IMCFabricantes)
    actFabricantes: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Ventas1: TMenuItem;
    Fabricantes1: TMenuItem;
    procedure actFabricantesExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uFabricantesController, uBizFabricantes, uFabricantesViewRegister;

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

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginFabricantes.actFabricantesExecute(Sender: TObject);
var
  AFabricantesController : IFabricantesController;
  AFabricantes : IBizFabricante;
begin
  AFabricantesController := TFabricantesController.Create;
  AFabricantes := (AFabricantesController.BuscarTodos as IBizFabricante);
  AFabricantesController.VerTodos(AFabricantes);
end;

constructor TPluginFabricantes.Create(AOwner: TComponent);
begin
  inherited;
  uFabricantesViewRegister.RegisterViews;
end;

destructor TPluginFabricantes.Destroy;
begin
  uFabricantesViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginFabricantes);

finalization
  UnRegisterModuleClass(TPluginFabricantes);

end.
