unit uPluginFacturasProveedor; interface uses uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList, ImgList, Controls, PngImageList, uPlugins_Intf; type TPluginFacturasProveedor = class(TModuleController, IMCFacturasProveedor) actFacturasProveedor: TAction; ExtraImages: TPngImageList; LargeImages: TPngImageList; MainMenu: TMainMenu; ModuleActionList: TActionList; SmallImages: TPngImageList; Compras1: TMenuItem; Facturasdeproveedor1: TMenuItem; procedure actFacturasProveedorExecute(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure VerFacturas(const ID_Proveedor: Integer; const ANombreProveedor : String = ''); end; implementation {$R *.dfm} uses Forms, Dialogs, SysUtils, cxControls, uFacturasProveedorController, uBizFacturasProveedor, uFacturasProveedorViewRegister; function GetModule : TModuleController; begin Result := TPluginFacturasProveedor.Create(NIL); end; exports GetModule name GET_MODULE_FUNC; procedure TPluginFacturasProveedor.actFacturasProveedorExecute(Sender: TObject); var AFacturasProveedorController : IFacturasProveedorController; AFacturasProveedor : IBizFacturaProveedor; begin AFacturasProveedorController := TFacturasProveedorController.Create; AFacturasProveedor := (AFacturasProveedorController.BuscarTodos as IBizFacturaProveedor); AFacturasProveedorController.VerTodos(AFacturasProveedor); end; constructor TPluginFacturasProveedor.Create(AOwner: TComponent); begin inherited; ModuleName := MODULENAME_FACTURAS_PROVEEDOR; uFacturasProveedorViewRegister.RegisterViews; end; destructor TPluginFacturasProveedor.Destroy; begin uFacturasProveedorViewRegister.UnregisterViews; inherited; end; procedure TPluginFacturasProveedor.VerFacturas(const ID_Proveedor: Integer; const ANombreProveedor: String); var AFacturasProveedorController : IFacturasProveedorController; AFacturasProveedor : IBizFacturaProveedor; AText : String; begin AText := Format('Lista de facturas del proveedor %s', [ANombreProveedor]); AFacturasProveedorController := TFacturasProveedorController.Create; try ShowHourglassCursor; try AFacturasProveedor := AFacturasProveedorController.BuscarTodos(ID_Proveedor); finally HideHourglassCursor; end; AFacturasProveedorController.VerTodos(AFacturasProveedor, True, AText); finally AFacturasProveedor := NIL; AFacturasProveedorController := NIL; end; end; initialization RegisterModuleClass(TPluginFacturasProveedor); finalization UnRegisterModuleClass(TPluginFacturasProveedor); end.