unit uPluginDelegaciones; interface uses uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList, ImgList, Controls, PngImageList; type IMCDelegaciones = interface(IInterface) ['{A9B7BC9D-BB45-43D3-9A8A-2423F0BE24D8}'] end; TPluginDelegaciones = class(TModuleController, IMCDelegaciones) actDelegaciones: TAction; ExtraImages: TPngImageList; LargeImages: TPngImageList; MainMenu: TMainMenu; ModuleActionList: TActionList; SmallImages: TPngImageList; Ventas1: TMenuItem; Delegaciones1: TMenuItem; procedure actDelegacionesExecute(Sender: TObject); procedure actDelegacionesUpdate(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; end; implementation {$R *.dfm} uses Forms, Dialogs, SysUtils, uFactuGES_App, uDelegacionesController, uBizDelegaciones, uDelegacionesViewRegister; function GetModule : TModuleController; begin Result := TPluginDelegaciones.Create(NIL); end; exports GetModule name GET_MODULE_FUNC; procedure TPluginDelegaciones.actDelegacionesExecute(Sender: TObject); var ADelegacionesController : IDelegacionesController; ADelegaciones : IBizDelegacion; begin ADelegacionesController := TDelegacionesController.Create; ADelegaciones := (ADelegacionesController.BuscarTodos as IBizDelegacion); ADelegacionesController.VerTodos(ADelegaciones); end; procedure TPluginDelegaciones.actDelegacionesUpdate(Sender: TObject); begin (Sender as TAction).Enabled := ((AppFactuGES.UsuarioActivo.ID_PERFIL < CTE_PERFIL_PRESUPUESTOS_INI) or (AppFactuGES.UsuarioActivo.ID_PERFIL > CTE_PERFIL_PRESUPUESTOS_FIN)) and (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ABETO); (Sender as TAction).Visible := ((AppFactuGES.UsuarioActivo.ID_PERFIL < CTE_PERFIL_PRESUPUESTOS_INI) or (AppFactuGES.UsuarioActivo.ID_PERFIL > CTE_PERFIL_PRESUPUESTOS_FIN)) and (AppFactuGES.EmpresaActiva.ID = CTE_EMPRESA_ABETO); end; constructor TPluginDelegaciones.Create(AOwner: TComponent); begin inherited; uDelegacionesViewRegister.RegisterViews; end; destructor TPluginDelegaciones.Destroy; begin uDelegacionesViewRegister.UnregisterViews; inherited; end; initialization RegisterModuleClass(TPluginDelegaciones); finalization UnRegisterModuleClass(TPluginDelegaciones); end.