Tecsitel_FactuGES2/Source/Modulos/Recibos de cliente/Plugin/uPluginRecibosCliente.pas

98 lines
2.5 KiB
ObjectPascal

unit uPluginRecibosCliente;
interface
uses
uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList,
ImgList, Controls, PngImageList, uPlugins_Intf;
type
TPluginRecibosCliente = class(TModuleController, IMCRecibosCliente)
actRecibosCliente: TAction;
ExtraImages: TPngImageList;
LargeImages: TPngImageList;
MainMenu: TMainMenu;
ModuleActionList: TActionList;
SmallImages: TPngImageList;
Compras1: TMenuItem;
RecibosdeCliente1: TMenuItem;
procedure actRecibosClienteExecute(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure VerRecibos(const ID_Cliente: Integer;
const ANombreCliente : String = '');
end;
implementation
{$R *.dfm}
uses
Forms, Dialogs, SysUtils, cxControls,
uRecibosClienteController, uBizRecibosCliente, uRecibosClienteViewRegister;
function GetModule : TModuleController;
begin
Result := TPluginRecibosCliente.Create(NIL);
end;
exports
GetModule name GET_MODULE_FUNC;
procedure TPluginRecibosCliente.actRecibosClienteExecute(Sender: TObject);
var
ARecibosClienteController : IRecibosClienteController;
ARecibosCliente : IBizRecibosCliente;
begin
ARecibosClienteController := TRecibosClienteController.Create;
ARecibosCliente := (ARecibosClienteController.BuscarTodos as IBizRecibosCliente);
ARecibosClienteController.VerTodos(ARecibosCliente);
end;
constructor TPluginRecibosCliente.Create(AOwner: TComponent);
begin
inherited;
ModuleName := MODULENAME_RECIBOS_CLIENTE;
uRecibosClienteViewRegister.RegisterViews;
end;
destructor TPluginRecibosCliente.Destroy;
begin
uRecibosClienteViewRegister.UnregisterViews;
inherited;
end;
procedure TPluginRecibosCliente.VerRecibos(const ID_Cliente: Integer;
const ANombreCliente: String);
var
ARecibosController : IRecibosClienteController;
ARecibos : IBizRecibosCliente;
AText : String;
begin
AText := Format('Lista de recibos del cliente %s', [ANombreCliente]);
ARecibosController := TRecibosClienteController.Create;
try
ShowHourglassCursor;
try
ARecibos := ARecibosController.BuscarTodos(ID_Cliente);
finally
HideHourglassCursor;
end;
ARecibosController.VerTodos(ARecibos, True, AText);
finally
ARecibos := NIL;
ARecibosController := NIL;
end;
end;
initialization
RegisterModuleClass(TPluginRecibosCliente);
finalization
UnRegisterModuleClass(TPluginRecibosCliente);
end.