unit uPluginFamilias;

interface

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

type
  IMCFamilias = interface(IInterface)
  ['{CD2D4FD9-B669-4447-A080-4D797B192A6F}']
  end;

  TPluginFamilias = class(TModuleController, IMCFamilias)
    actFamilias: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Ventas1: TMenuItem;
    Familias1: TMenuItem;
    procedure actFamiliasExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uFamiliasController, uBizFamilias, uFamiliasViewRegister;

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

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginFamilias.actFamiliasExecute(Sender: TObject);
var
  AFamiliasController : IFamiliasController;
  AFamilias : IBizFamilia;
begin
  AFamiliasController := TFamiliasController.Create;
  AFamilias := (AFamiliasController.BuscarTodos as IBizFamilia);
  AFamiliasController.VerTodos(AFamilias);
end;

constructor TPluginFamilias.Create(AOwner: TComponent);
begin
  inherited;
  uFamiliasViewRegister.RegisterViews;
end;

destructor TPluginFamilias.Destroy;
begin
  uFamiliasViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginFamilias);

finalization
  UnRegisterModuleClass(TPluginFamilias);

end.
