Arreglado el tratamiento de tienda 'Todas'.
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@302 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
parent
22b23d0589
commit
99f3d28230
@ -18,6 +18,7 @@ type
|
||||
TTiendasEmpresaController = class(TControllerBase, ITiendasEmpresaController)
|
||||
private
|
||||
FDataModule : IDataModuleEmpresas;
|
||||
function CrearTiendaTodas: IBizEmpresaTienda;
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
@ -33,11 +34,22 @@ implementation
|
||||
|
||||
uses
|
||||
uDataModuleEmpresas, schEmpresasClient_Intf, uIEditorTiendaEmpresa,
|
||||
uEditorRegistryUtils, cxControls, uFactuGES_App;
|
||||
uEditorRegistryUtils, cxControls, uFactuGES_App, uDataTableUtils;
|
||||
|
||||
function TTiendasEmpresaController.Buscar(const ID: Integer): IBizEmpresaTienda;
|
||||
var
|
||||
ATienda : IBizEmpresaTienda;
|
||||
begin
|
||||
Result := FDataModule.GetTienda(ID);
|
||||
Result := NIL;
|
||||
|
||||
if ID = CTE_ID_TODAS then
|
||||
{ Si ID = 0 entonces hay que devolcer una tienda ficticia para
|
||||
representar a todas las tiendas. }
|
||||
ATienda := CrearTiendaTodas
|
||||
else
|
||||
ATienda := FDataModule.GetTienda(ID);
|
||||
|
||||
Result := ATienda;
|
||||
end;
|
||||
|
||||
function TTiendasEmpresaController.BuscarTodas: IBizEmpresaTienda;
|
||||
@ -84,4 +96,29 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function TTiendasEmpresaController.CrearTiendaTodas: IBizEmpresaTienda;
|
||||
var
|
||||
ATienda: IBizEmpresaTienda;
|
||||
begin
|
||||
ATienda := FDataModule.NewTienda;
|
||||
|
||||
ATienda.DataTable.Open;
|
||||
DesconectarTabla(ATienda.DataTable);
|
||||
try
|
||||
ATienda.Edit;
|
||||
try
|
||||
ATienda.ID := CTE_ID_TODAS;
|
||||
ATienda.ID_EMPRESA := AppFactuGES.EmpresaActiva.ID;
|
||||
ATienda.NOMBRE := CTE_TODAS;
|
||||
finally
|
||||
ATienda.Post;
|
||||
end;
|
||||
finally
|
||||
ConectarTabla(ATienda.DataTable);
|
||||
end;
|
||||
|
||||
Result := ATienda;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user