git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@152 f4e31baf-9722-1c47-927c-6f952f962d4b
95 lines
2.2 KiB
ObjectPascal
95 lines
2.2 KiB
ObjectPascal
unit uTiendasEmpresaController;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Forms, Classes, Controls, Contnrs, SysUtils, uDADataTable,
|
|
uIntegerListUtils, uBizEmpresasTiendas, uIDataModuleEmpresas;
|
|
|
|
type
|
|
ITiendasEmpresaController = interface
|
|
['{5DCF4163-7FA0-4560-9E5E-FA2A99EA4F59}']
|
|
procedure VerTienda(ATienda : IBizEmpresasTiendas);
|
|
function DarListaTiendas: TStringList;
|
|
end;
|
|
|
|
TTiendasEmpresaController = class(TInterfacedObject, ITiendasEmpresaController)
|
|
private
|
|
FDataModule : IDataModuleEmpresas;
|
|
public
|
|
procedure VerTienda(ATienda : IBizEmpresasTiendas);
|
|
function DarListaTiendas: TStringList;
|
|
constructor Create; virtual;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{ TTiendasEmpresaController }
|
|
|
|
uses
|
|
uDataModuleEmpresas, schEmpresasClient_Intf, uIEditorTiendaEmpresa,
|
|
uEditorRegistryUtils, cxControls, uFactuGES_App;
|
|
|
|
constructor TTiendasEmpresaController.Create;
|
|
begin
|
|
inherited;
|
|
FDataModule := TDataModuleEmpresas.Create(Nil);
|
|
end;
|
|
|
|
function TTiendasEmpresaController.DarListaTiendas: TStringList;
|
|
var
|
|
ATiendas: IBizEmpresasTiendas;
|
|
i : integer;
|
|
begin
|
|
ATiendas := AppFactuGES.EmpresaActiva.Tiendas;
|
|
ATiendas.DataTable.Active := True;
|
|
|
|
Result := TStringList.Create;
|
|
try
|
|
with Result do
|
|
begin
|
|
Add(Format('%s=%d', [CTE_TODAS, CTE_ID_TODAS]));
|
|
|
|
ATiendas.DataTable.First;
|
|
while not ATiendas.DataTable.EOF do
|
|
begin
|
|
Add(Format('%s=%d', [ATiendas.NOMBRE, ATiendas.ID]));
|
|
ATiendas.DataTable.Next;
|
|
end;
|
|
end;
|
|
finally
|
|
ATiendas := NIL;
|
|
end;
|
|
end;
|
|
|
|
destructor TTiendasEmpresaController.Destroy;
|
|
begin
|
|
FDataModule := Nil;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TTiendasEmpresaController.VerTienda(ATienda: IBizEmpresasTiendas);
|
|
var
|
|
AEditor : IEditorTiendaEmpresa;
|
|
begin
|
|
AEditor := NIL;
|
|
ShowHourglassCursor;
|
|
try
|
|
CreateEditor('EditorTiendaEmpresa', IEditorTiendaEmpresa, AEditor);
|
|
if Assigned(AEditor) then
|
|
with AEditor do
|
|
begin
|
|
Tienda := ATienda;
|
|
Controller := Self;
|
|
ShowModal;
|
|
Release;
|
|
end;
|
|
finally
|
|
AEditor := NIL;
|
|
HideHourglassCursor;
|
|
end;
|
|
end;
|
|
|
|
end.
|