unit uPluginObras;

interface

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

type
  IMCObras = interface(IInterface)
  ['{BC4A49B9-3CE9-48B5-A404-3468CB87B768}']
  end;

  TPluginObras = class(TModuleController, IMCObras)
    actObras: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Ventas1: TMenuItem;
    Obras1: TMenuItem;
    procedure actObrasExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uObrasController, uBizObras, uObrasViewRegister;

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

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginObras.actObrasExecute(Sender: TObject);
var
  AObrasController : IObrasController;
  AObras : IBizObra;

begin
  AObrasController := TObrasController.Create;
  AObras := (AObrasController.BuscarTodos as IBizObra);
  AObrasController.VerTodos(AObras);
end;

constructor TPluginObras.Create(AOwner: TComponent);
begin
  inherited;
  uObrasViewRegister.RegisterViews;
end;

destructor TPluginObras.Destroy;
begin
  uObrasViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginObras);

finalization
  UnRegisterModuleClass(TPluginObras);

end.
