git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES2/trunk@79 b2cfbe5a-eba1-4a0c-8b32-7feea0a119f2
124 lines
3.6 KiB
ObjectPascal
124 lines
3.6 KiB
ObjectPascal
unit uPluginTiendaWeb;
|
|
|
|
interface
|
|
|
|
uses
|
|
uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList,
|
|
ImgList, Controls, PngImageList;
|
|
|
|
type
|
|
IMCTiendaWeb = interface(IInterface)
|
|
['{04676BE7-F0C9-4EA6-9909-1E5517C3604E}']
|
|
end;
|
|
|
|
TPluginTiendaWeb = class(TModuleController, IMCTiendaWeb)
|
|
actRecogerPedidos: TAction;
|
|
ExtraImages: TPngImageList;
|
|
LargeImages: TPngImageList;
|
|
MainMenu: TMainMenu;
|
|
ModuleActionList: TActionList;
|
|
SmallImages: TPngImageList;
|
|
actActualizarTienda: TAction;
|
|
actConfigurarTienda: TAction;
|
|
Actualizartienda1: TMenuItem;
|
|
Recogerpedidos1: TMenuItem;
|
|
iendaweb1: TMenuItem;
|
|
Configurartienda1: TMenuItem;
|
|
N1: TMenuItem;
|
|
procedure actRecogerPedidosExecute(Sender: TObject);
|
|
procedure actConfigurarTiendaExecute(Sender: TObject);
|
|
procedure actActualizarTiendaExecute(Sender: TObject);
|
|
procedure actRecogerPedidosUpdate(Sender: TObject);
|
|
procedure actActualizarTiendaUpdate(Sender: TObject);
|
|
procedure actConfigurarTiendaUpdate(Sender: TObject);
|
|
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses
|
|
Forms, Dialogs, SysUtils, uDataModuleUsuarios, uFactuGES_App,
|
|
uTiendaWebController, uBizTiendaWeb, uTiendaWebViewRegister;
|
|
|
|
function GetModule : TModuleController;
|
|
begin
|
|
Result := TPluginTiendaWeb.Create(NIL);
|
|
end;
|
|
|
|
exports
|
|
GetModule name GET_MODULE_FUNC;
|
|
|
|
procedure TPluginTiendaWeb.actActualizarTiendaExecute(Sender: TObject);
|
|
var
|
|
ATiendaWebController : ITiendaWebController;
|
|
ATiendaWeb : IBizTiendaWeb;
|
|
begin
|
|
ATiendaWebController := TTiendaWebController.Create;
|
|
ATiendaWeb := ATiendaWebController.Buscar(AppFactuGES.EmpresaActiva.ID);
|
|
ATiendaWebController.ActualizarTienda(ATiendaWeb);
|
|
end;
|
|
|
|
procedure TPluginTiendaWeb.actActualizarTiendaUpdate(Sender: TObject);
|
|
begin
|
|
//La tienda solo estará activa para la empresa Luis León Representaciones
|
|
(Sender as TAction).Enabled := (AppFactuGES.EmpresaActiva.ID = 1)
|
|
end;
|
|
|
|
procedure TPluginTiendaWeb.actConfigurarTiendaExecute(Sender: TObject);
|
|
var
|
|
ATiendaWebController : ITiendaWebController;
|
|
ATiendaWeb : IBizTiendaWeb;
|
|
begin
|
|
ATiendaWebController := TTiendaWebController.Create;
|
|
ATiendaWeb := ATiendaWebController.Buscar(AppFactuGES.EmpresaActiva.ID);
|
|
ATiendaWebController.Ver(ATiendaWeb);
|
|
end;
|
|
|
|
procedure TPluginTiendaWeb.actConfigurarTiendaUpdate(Sender: TObject);
|
|
begin
|
|
//La tienda solo estará activa para la empresa Luis León Representaciones
|
|
(Sender as TAction).Enabled := (AppFactuGES.EmpresaActiva.ID = 1)
|
|
end;
|
|
|
|
procedure TPluginTiendaWeb.actRecogerPedidosExecute(Sender: TObject);
|
|
var
|
|
ATiendaWebController : ITiendaWebController;
|
|
ATiendaWeb : IBizTiendaWeb;
|
|
begin
|
|
ATiendaWebController := TTiendaWebController.Create;
|
|
ATiendaWeb := ATiendaWebController.Buscar(AppFactuGES.EmpresaActiva.ID);
|
|
ATiendaWebController.DescargarPedidos(ATiendaWeb);
|
|
end;
|
|
|
|
procedure TPluginTiendaWeb.actRecogerPedidosUpdate(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
//La tienda solo estará activa para la empresa Luis León Representaciones
|
|
(Sender as TAction).Enabled := (AppFactuGES.EmpresaActiva.ID = 1)
|
|
end;
|
|
|
|
constructor TPluginTiendaWeb.Create(AOwner: TComponent);
|
|
begin
|
|
inherited;
|
|
uTiendaWebViewRegister.RegisterViews;
|
|
end;
|
|
|
|
destructor TPluginTiendaWeb.Destroy;
|
|
begin
|
|
uTiendaWebViewRegister.UnregisterViews;
|
|
inherited;
|
|
end;
|
|
|
|
initialization
|
|
RegisterModuleClass(TPluginTiendaWeb);
|
|
|
|
finalization
|
|
UnRegisterModuleClass(TPluginTiendaWeb);
|
|
|
|
end.
|