Controladores: repaso a la visualización de editores => vista modal -> hacer release / vista embebida -> no hacer release.

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@324 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
David Arranz 2008-11-11 18:52:28 +00:00
parent 4f6fbbb472
commit abaebda04d
60 changed files with 1638 additions and 1851 deletions

View File

@ -224,20 +224,19 @@ var
AEditor : IEditorEjercicio; AEditor : IEditorEjercicio;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEjercicio', IEditorEjercicio, AEditor); CreateEditor('EditorEjercicio', IEditorEjercicio, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorEjercicio) do with (AEditor as IEditorEjercicio) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Ejercicio := AEjercicio; Ejercicio := AEjercicio;
ShowModal; ShowModal;
Release;
end;
finally finally
AEditor := NIL; Release;
HideHourglassCursor; AEditor := NIL
end;
end; end;
end; end;
@ -246,8 +245,7 @@ var
AEditor : IEditorEjercicios; AEditor : IEditorEjercicios;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEjercicios', IEditorEjercicios, AEditor); CreateEditor('EditorEjercicios', IEditorEjercicios, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -256,10 +254,6 @@ begin
Ejercicios := AEjercicios; Ejercicios := AEjercicios;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TEjerciciosController.Eliminar(AEjercicio: IBizEjercicio): Boolean; function TEjerciciosController.Eliminar(AEjercicio: IBizEjercicio): Boolean;

View File

@ -31,20 +31,19 @@ var
AEditor : IEditorDatosBancariosEmpresa; AEditor : IEditorDatosBancariosEmpresa;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorDatosBancariosEmpresa', IEditorDatosBancariosEmpresa, AEditor); CreateEditor('EditorDatosBancariosEmpresa', IEditorDatosBancariosEmpresa, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
DatosBancarios := ADatosBancarios; DatosBancarios := ADatosBancarios;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -262,20 +262,19 @@ var
AEditor : IEditorEmpresa; AEditor : IEditorEmpresa;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpresa', IEditorEmpresa, AEditor); CreateEditor('EditorEmpresa', IEditorEmpresa, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Empresa := AEmpresa; Empresa := AEmpresa;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -284,8 +283,6 @@ procedure TEmpresasController.VerTodos(AEmpresas: IBizEmpresa);
AEditor : IEditorEmpresas;} AEditor : IEditorEmpresas;}
begin begin
{ AEditor := NIL; { AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpresas', IEditorEmpresas, AEditor); CreateEditor('EditorEmpresas', IEditorEmpresas, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -294,10 +291,7 @@ begin
Controller := Self; Controller := Self;
ShowEmbedded; ShowEmbedded;
end; end;
finally }
AEditor := NIL;
HideHourglassCursor;
end;}
end; end;
end. end.

View File

@ -79,20 +79,19 @@ var
AEditor : IEditorTiendaEmpresa; AEditor : IEditorTiendaEmpresa;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorTiendaEmpresa', IEditorTiendaEmpresa, AEditor); CreateEditor('EditorTiendaEmpresa', IEditorTiendaEmpresa, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Tienda := ATienda; Tienda := ATienda;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -781,20 +781,19 @@ begin
raise Exception.Create('Perfil no asignado (VerPerfil)'); raise Exception.Create('Perfil no asignado (VerPerfil)');
APerfil.Active := True; APerfil.Active := True;
ShowHourglassCursor;
try
CreateEditor('EditorPerfilUsuario', IEditorPerfilUsuario, AEditor); CreateEditor('EditorPerfilUsuario', IEditorPerfilUsuario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorPerfilUsuario) do with (AEditor as IEditorPerfilUsuario) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
PerfilUsuario := APerfil; PerfilUsuario := APerfil;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -804,11 +803,10 @@ var
APerfilesUsuario: IBizPerfilUsuario; APerfilesUsuario: IBizPerfilUsuario;
begin begin
APerfilesUsuario := FDataModule.GetPerfiles; APerfilesUsuario := FDataModule.GetPerfiles;
if Assigned(APerfilesUsuario) then if Assigned(APerfilesUsuario) then
begin begin
APerfilesUsuario.Active := True; APerfilesUsuario.Active := True;
ShowHourglassCursor;
try
CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor); CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorPerfilesUsuario) do with (AEditor as IEditorPerfilesUsuario) do
@ -817,11 +815,6 @@ begin
PerfilesUsuario := APerfilesUsuario; PerfilesUsuario := APerfilesUsuario;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
APerfilesUsuario := NIL;
HideHourglassCursor;
end;
end; end;
end; end;
@ -841,20 +834,19 @@ begin
raise Exception.Create('Usuario no asignado (VerUsuario)'); raise Exception.Create('Usuario no asignado (VerUsuario)');
AUser.Active := True; AUser.Active := True;
ShowHourglassCursor;
try
CreateEditor('EditorUsuario', IEditorUsuario, AEditor); CreateEditor('EditorUsuario', IEditorUsuario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorUsuario) do with (AEditor as IEditorUsuario) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Usuario := AUser; Usuario := AUser;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -867,8 +859,6 @@ begin
if Assigned(FUsuarios) then if Assigned(FUsuarios) then
begin begin
FUsuarios.Active := True; FUsuarios.Active := True;
ShowHourglassCursor;
try
CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor); CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorUsuarios) do with (AEditor as IEditorUsuarios) do
@ -877,11 +867,6 @@ begin
Usuarios := FUsuarios; Usuarios := FUsuarios;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
FUsuarios := NIL;
HideHourglassCursor;
end;
end; end;
end; end;
@ -896,19 +881,18 @@ var
begin begin
Result := False; Result := False;
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorLogin', IEditorLogin, AEditor); CreateEditor('EditorLogin', IEditorLogin, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Result := (AEditor.ShowModal = mrOk); Result := (AEditor.ShowModal = mrOk);
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -547,8 +547,7 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran); RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
@ -559,6 +558,7 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do with (AEditor as IEditorAlbaranCliente) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran; Albaran := AAlbaran;
@ -574,12 +574,9 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
AEditor.Release; AEditor.Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -589,20 +586,17 @@ var
AEditor : IEditorDireccionEntregaAlbaranCliente; AEditor : IEditorDireccionEntregaAlbaranCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta //RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaAlbaranCliente', IEditorDireccionEntregaAlbaranCliente, AEditor); CreateEditor('EditorDireccionEntregaAlbaranCliente', IEditorDireccionEntregaAlbaranCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaAlbaranCliente) do with (AEditor as IEditorDireccionEntregaAlbaranCliente) do
begin try
Albaran := AAlbaran; Albaran := AAlbaran;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -611,8 +605,7 @@ var
AEditor : IEditorAlbaranesCliente; AEditor : IEditorAlbaranesCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor); CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -622,10 +615,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente); procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente);
@ -633,8 +622,7 @@ var
AEditor : IEditorAlbaranesDevCliente; AEditor : IEditorAlbaranesDevCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor); CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -644,10 +632,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAlbaranesClienteController._Vacio: IBizAlbaranCliente; function TAlbaranesClienteController._Vacio: IBizAlbaranCliente;
@ -673,23 +657,22 @@ var
AEditor : IEditorElegirAlbaranesCliente; AEditor : IEditorElegirAlbaranesCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor); CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Albaranes := AAlbaran; Albaranes := AAlbaran;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := AlbaranesClienteSeleccionados; Result := AlbaranesClienteSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -68,24 +68,23 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetEtiquetas(AID, withRefCliente); AStream := FDataModule.GetEtiquetas(AID, withRefCliente);
try try
CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor); CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -95,6 +94,7 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetEtiquetas(AID, withRefCliente); AStream := FDataModule.GetEtiquetas(AID, withRefCliente);
@ -103,13 +103,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
@ -145,8 +148,7 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptAlbaranes(AListaID); AStream := FDataModule.GetRptAlbaranes(AListaID);
try try
CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor); CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor);
@ -160,14 +162,11 @@ begin
AEditor.Preview; AEditor.Preview;
finally finally
AEditor.Release; AEditor.Release;
AEditor := Nil;
end; end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -177,6 +176,7 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetRptAlbaranes(AListaID); AStream := FDataModule.GetRptAlbaranes(AListaID);
@ -192,11 +192,11 @@ begin
AEditor.Print; AEditor.Print;
finally finally
AEditor.Release; AEditor.Release;
AEditor := Nil;
end; end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -27,23 +27,22 @@ var
AEditor : IEditorElegirArticulosAlbaranesCliente; AEditor : IEditorElegirArticulosAlbaranesCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor); CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -616,8 +616,7 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran); RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
@ -628,6 +627,7 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorAlbaranProveedor) do with (AEditor as IEditorAlbaranProveedor) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran; Albaran := AAlbaran;
@ -643,12 +643,9 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
AEditor.Release; AEditor.Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -657,20 +654,19 @@ var
AEditor : IEditorDireccionEntregaAlbaranProveedor; AEditor : IEditorDireccionEntregaAlbaranProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta //RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaAlbaranProveedor', IEditorDireccionEntregaAlbaranProveedor, AEditor); CreateEditor('EditorDireccionEntregaAlbaranProveedor', IEditorDireccionEntregaAlbaranProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaAlbaranProveedor) do with (AEditor as IEditorDireccionEntregaAlbaranProveedor) do
begin begin
try
Albaran := AAlbaran; Albaran := AAlbaran;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -679,8 +675,7 @@ var
AEditor : IEditorAlbaranesProveedor; AEditor : IEditorAlbaranesProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesProveedor', IEditorAlbaranesProveedor, AEditor); CreateEditor('EditorAlbaranesProveedor', IEditorAlbaranesProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -690,10 +685,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor); procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor);
@ -701,8 +692,7 @@ var
AEditor : IEditorAlbaranesDevProveedor; AEditor : IEditorAlbaranesDevProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesDevProveedor', IEditorAlbaranesDevProveedor, AEditor); CreateEditor('EditorAlbaranesDevProveedor', IEditorAlbaranesDevProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -712,10 +702,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor; function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor;
@ -741,23 +727,22 @@ var
AEditor : IEditorElegirAlbaranesProveedor; AEditor : IEditorElegirAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor); CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Albaranes := AAlbaran; Albaranes := AAlbaran;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := AlbaranesProveedorSeleccionados; Result := AlbaranesProveedorSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -60,24 +60,23 @@ var
AEditor : IEditorAlbaranesProveedorPreview; AEditor : IEditorAlbaranesProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
try try
CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -95,13 +94,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -27,12 +27,12 @@ var
AEditor : IEditorElegirArticulosAlbaranesProveedor; AEditor : IEditorElegirArticulosAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor); CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
Proveedor := AProveedor; Proveedor := AProveedor;
@ -40,11 +40,10 @@ begin
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -208,21 +208,20 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlmacen); RecuperarObjetos(AAlmacen);
CreateEditor('EditorAlmacen', IEditorAlmacen, AEditor); CreateEditor('EditorAlmacen', IEditorAlmacen, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorAlmacen) do with (AEditor as IEditorAlmacen) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Almacen := AAlmacen; Almacen := AAlmacen;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -232,20 +231,19 @@ var
begin begin
AEditor := NIL; AEditor := NIL;
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorListaAlmacenes', IEditorListaAlmacenes, AEditor); CreateEditor('EditorListaAlmacenes', IEditorListaAlmacenes, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Almacenes := AAlmacenes; Almacenes := AAlmacenes;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := AlmacenSeleccionado; Result := AlmacenSeleccionado;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -254,8 +252,7 @@ var
AEditor : IEditorAlmacenes; AEditor : IEditorAlmacenes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlmacenes', IEditorAlmacenes, AEditor); CreateEditor('EditorAlmacenes', IEditorAlmacenes, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -264,9 +261,6 @@ begin
Almacenes := AAlmacenes; Almacenes := AAlmacenes;
ShowEmbedded; ShowEmbedded;
end; end;
finally
HideHourglassCursor;
end;
end; end;
function TAlmacenesController._Vacio: IBizAlmacen; function TAlmacenesController._Vacio: IBizAlmacen;

View File

@ -395,22 +395,21 @@ var
AEditor : IEditorArticulo; AEditor : IEditorArticulo;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AArticulo); RecuperarObjetos(AArticulo);
CreateEditor('EditorArticulo', IEditorArticulo, AEditor); CreateEditor('EditorArticulo', IEditorArticulo, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorArticulo) do with (AEditor as IEditorArticulo) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Articulo := AArticulo; Articulo := AArticulo;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -435,8 +434,7 @@ var
AEditor : IEditorArticulos; AEditor : IEditorArticulos;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AArticulos); RecuperarObjetos(AArticulos);
CreateEditor('EditorArticulos', IEditorArticulos, AEditor); CreateEditor('EditorArticulos', IEditorArticulos, AEditor);
@ -447,10 +445,6 @@ begin
Articulos := AArticulos; Articulos := AArticulos;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TArticulosController._Vacio: IBizArticulo; function TArticulosController._Vacio: IBizArticulo;
@ -476,23 +470,22 @@ var
AEditor : IEditorElegirArticulos; AEditor : IEditorElegirArticulos;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulos', IEditorElegirArticulos, AEditor); CreateEditor('EditorElegirArticulos', IEditorElegirArticulos, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -182,12 +182,12 @@ var
begin begin
Result := False; Result := False;
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorExportacionNorma19', IEditorExportacionNorma19, AEditor); CreateEditor('EditorExportacionNorma19', IEditorExportacionNorma19, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
CodigoEntidad := Entidad; CodigoEntidad := Entidad;
CodigoAgencia := Oficina; CodigoAgencia := Oficina;
FechaCargo := AFechaCargo; FechaCargo := AFechaCargo;
@ -201,11 +201,10 @@ begin
AFileName := Fichero; AFileName := Fichero;
Result := True; Result := True;
end; end;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -308,22 +308,20 @@ var
AEditor : IEditorComision; AEditor : IEditorComision;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
// RecuperarObjetos(ARemesaCliente); // RecuperarObjetos(ARemesaCliente);
CreateEditor('EditorComision', IEditorComision, AEditor); CreateEditor('EditorComision', IEditorComision, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorComision) do with (AEditor as IEditorComision) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Comision := AComision; Comision := AComision;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -332,8 +330,7 @@ var
AEditor : IEditorComisiones; AEditor : IEditorComisiones;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorComisiones', IEditorComisiones, AEditor); CreateEditor('EditorComisiones', IEditorComisiones, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -342,10 +339,6 @@ begin
Comisiones := AComision; Comisiones := AComision;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TComisionesController.ElegirFacturasComision(AComision: IBizComisiones): Boolean; function TComisionesController.ElegirFacturasComision(AComision: IBizComisiones): Boolean;

View File

@ -60,24 +60,23 @@ var
AEditor : IEditorComisionesPreview; AEditor : IEditorComisionesPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AComisionID); AStream := FDataModule.GetReport(AComisionID);
try try
CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor); CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -87,6 +86,7 @@ var
AEditor : IEditorComisionesPreview; AEditor : IEditorComisionesPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AComisionID); AStream := FDataModule.GetReport(AComisionID);
@ -95,13 +95,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -275,20 +275,19 @@ var
AEditor : IEditorApunte; AEditor : IEditorApunte;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorApunte', IEditorApunte, AEditor); CreateEditor('EditorApunte', IEditorApunte, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
// Controller := Self; //OJO ORDEN MUY IMPORTANTE // Controller := Self; //OJO ORDEN MUY IMPORTANTE
Apunte := AApunte; Apunte := AApunte;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -298,8 +297,7 @@ var
AEditor : IEditorApuntes; AEditor : IEditorApuntes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorApuntes', IEditorApuntes, AEditor); CreateEditor('EditorApuntes', IEditorApuntes, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -308,10 +306,6 @@ begin
Apuntes := AApuntes; Apuntes := AApuntes;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
} }

View File

@ -238,20 +238,19 @@ var
AEditor : IEditorAsiento; AEditor : IEditorAsiento;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAsiento', IEditorAsiento, AEditor); CreateEditor('EditorAsiento', IEditorAsiento, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Asiento := AAsiento; Asiento := AAsiento;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -260,8 +259,7 @@ var
AEditor : IEditorDiario; AEditor : IEditorDiario;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorDiario', IEditorDiario, AEditor); CreateEditor('EditorDiario', IEditorDiario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -270,10 +268,6 @@ begin
Diario := ADiario; Diario := ADiario;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAsientosController.VerExtracto; procedure TAsientosController.VerExtracto;
@ -281,8 +275,7 @@ var
AEditor : IEditorExtractoMovimientos; AEditor : IEditorExtractoMovimientos;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorExtractoMovimientos', IEditorExtractoMovimientos, AEditor); CreateEditor('EditorExtractoMovimientos', IEditorExtractoMovimientos, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -291,10 +284,6 @@ begin
//En este caso el objeto de negocio recae sobre la vista //En este caso el objeto de negocio recae sobre la vista
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAsientosController.Eliminar(AAsiento: IBizAsiento): Boolean; function TAsientosController.Eliminar(AAsiento: IBizAsiento): Boolean;

View File

@ -178,19 +178,17 @@ var
AEditor : IEditorBalance; AEditor : IEditorBalance;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorBalance', IEditorBalance, AEditor); CreateEditor('EditorBalance', IEditorBalance, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Balance := ABalance; Balance := ABalance;
ShowModal; ShowModal;
finally
Release; Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -199,20 +197,19 @@ var
AEditor : IEditorBalances; AEditor : IEditorBalances;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorBalances', IEditorBalances, AEditor); CreateEditor('EditorBalances', IEditorBalances, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Balances := ABalances; Balances := ABalances;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -223,20 +220,21 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirBalances', IEditorElegirBalances, AEditor); CreateEditor('EditorElegirBalances', IEditorElegirBalances, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Balances := ABalances; Balances := ABalances;
Controller := Self; Controller := Self;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := BalancesSeleccionados; Result := BalancesSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TBalancesController.Eliminar(ABalance: IBizBalance): Boolean; function TBalancesController.Eliminar(ABalance: IBizBalance): Boolean;
begin begin

View File

@ -194,20 +194,19 @@ var
AEditor : IEditorCuenta; AEditor : IEditorCuenta;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorCuenta', IEditorCuenta, AEditor); CreateEditor('EditorCuenta', IEditorCuenta, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Cuenta := ACuenta; Cuenta := ACuenta;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -216,8 +215,7 @@ var
AEditor : IEditorCuentas; AEditor : IEditorCuentas;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorCuentas', IEditorCuentas, AEditor); CreateEditor('EditorCuentas', IEditorCuentas, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -226,10 +224,6 @@ begin
Cuentas := ACuentas; Cuentas := ACuentas;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TCuentasController.ElegirBalance(ACuenta: IBizCuenta); procedure TCuentasController.ElegirBalance(ACuenta: IBizCuenta);
@ -268,20 +262,20 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirCuentas', IEditorElegirCuentas, AEditor); CreateEditor('EditorElegirCuentas', IEditorElegirCuentas, AEditor);
try
with AEditor do with AEditor do
begin begin
try
Cuentas := ACuentas; Cuentas := ACuentas;
Controller := Self; Controller := Self;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := CuentasSeleccionados; Result := CuentasSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
procedure TCuentasController.ElegirCuentaEspecial(ACuenta: IBizCuenta); procedure TCuentasController.ElegirCuentaEspecial(ACuenta: IBizCuenta);
var var

View File

@ -178,19 +178,18 @@ var
AEditor : IEditorCuentaEspecial; AEditor : IEditorCuentaEspecial;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorCuentaEspecial', IEditorCuentaEspecial, AEditor); CreateEditor('EditorCuentaEspecial', IEditorCuentaEspecial, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
CuentaEspecial := ACuentaEspecial; CuentaEspecial := ACuentaEspecial;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -199,20 +198,19 @@ var
AEditor : IEditorCuentasEspeciales; AEditor : IEditorCuentasEspeciales;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorCuentasEspeciales', IEditorCuentasEspeciales, AEditor); CreateEditor('EditorCuentasEspeciales', IEditorCuentasEspeciales, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
CuentasEspeciales := ACuentasEspeciales; CuentasEspeciales := ACuentasEspeciales;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -224,20 +222,21 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirCuentasEspeciales', IEditorElegirCuentasEspeciales, AEditor); CreateEditor('EditorElegirCuentasEspeciales', IEditorElegirCuentasEspeciales, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
CuentasEspeciales := ACuentasEspeciales; CuentasEspeciales := ACuentasEspeciales;
Controller := Self; Controller := Self;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := CuentasEspecialesSeleccionados; Result := CuentasEspecialesSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TCuentasEspecialesController.Eliminar(ACuentaEspecial: IBizCuentaEspecial): Boolean; function TCuentasEspecialesController.Eliminar(ACuentaEspecial: IBizCuentaEspecial): Boolean;
begin begin

View File

@ -202,20 +202,19 @@ var
AEditor : IEditorEpigrafe; AEditor : IEditorEpigrafe;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEpigrafe', IEditorEpigrafe, AEditor); CreateEditor('EditorEpigrafe', IEditorEpigrafe, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Epigrafe := AEpigrafe; Epigrafe := AEpigrafe;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -224,8 +223,7 @@ var
AEditor : IEditorEpigrafes; AEditor : IEditorEpigrafes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEpigrafes', IEditorEpigrafes, AEditor); CreateEditor('EditorEpigrafes', IEditorEpigrafes, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -234,10 +232,6 @@ begin
Epigrafes := AEpigrafes; Epigrafes := AEpigrafes;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TEpigrafesController.ElegirEpigrafe(AEpigrafes: IBizEpigrafe; AMensaje: String; AMultiSelect: Boolean): IBizEpigrafe; function TEpigrafesController.ElegirEpigrafe(AEpigrafes: IBizEpigrafe; AMensaje: String; AMultiSelect: Boolean): IBizEpigrafe;
@ -247,20 +241,21 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirEpigrafes', IEditorElegirEpigrafes, AEditor); CreateEditor('EditorElegirEpigrafes', IEditorElegirEpigrafes, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Epigrafes := AEpigrafes; Epigrafes := AEpigrafes;
Controller := Self; Controller := Self;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := EpigrafesSeleccionados; Result := EpigrafesSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TEpigrafesController.Eliminar(AEpigrafe: IBizEpigrafe): Boolean; function TEpigrafesController.Eliminar(AEpigrafe: IBizEpigrafe): Boolean;
begin begin

View File

@ -408,20 +408,19 @@ var
AEditor : IEditorSubCuenta; AEditor : IEditorSubCuenta;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorSubCuenta', IEditorSubCuenta, AEditor); CreateEditor('EditorSubCuenta', IEditorSubCuenta, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
SubCuenta := ASubCuenta; SubCuenta := ASubCuenta;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -455,8 +454,7 @@ var
AEditor : IEditorSubCuentas; AEditor : IEditorSubCuentas;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorSubCuentas', IEditorSubCuentas, AEditor); CreateEditor('EditorSubCuentas', IEditorSubCuentas, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -465,10 +463,6 @@ begin
SubCuentas := ASubCuentas; SubCuentas := ASubCuentas;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TSubCuentasController._Vacio: IBizSubCuenta; function TSubCuentasController._Vacio: IBizSubCuenta;
@ -511,20 +505,21 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirSubCuentas', IEditorElegirSubCuentas, AEditor); CreateEditor('EditorElegirSubCuentas', IEditorElegirSubCuentas, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
SubCuentas := ASubCuentas; SubCuentas := ASubCuentas;
Controller := Self; Controller := Self;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := SubCuentasSeleccionados; Result := SubCuentasSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
procedure TSubCuentasController.ElegirSubCuentaContacto(ASubCuentaContacto: IBizSubCuentasContacto; TipoCuenta: Integer); procedure TSubCuentasController.ElegirSubCuentaContacto(ASubCuentaContacto: IBizSubCuentasContacto; TipoCuenta: Integer);
var var

View File

@ -106,21 +106,22 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirClientes', IEditorElegirClientes, AEditor); CreateEditor('EditorElegirClientes', IEditorElegirClientes, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ContactosSeleccionados; Result := ContactosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TClientesController.Eliminar(ACliente: IBizContacto; AllItems: Boolean): Boolean; function TClientesController.Eliminar(ACliente: IBizContacto; AllItems: Boolean): Boolean;
//En el caso de eliminar almenos un elemento del conjunto se devuelve true //En el caso de eliminar almenos un elemento del conjunto se devuelve true
@ -385,20 +386,19 @@ var
AEditor : IEditorCliente; AEditor : IEditorCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorCliente', IEditorCliente, AEditor); CreateEditor('EditorCliente', IEditorCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -407,8 +407,7 @@ var
AEditor : IEditorClientes; AEditor : IEditorClientes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorClientes', IEditorClientes, AEditor); CreateEditor('EditorClientes', IEditorClientes, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -418,10 +417,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -102,20 +102,19 @@ var
AEditor : IEditorEditorDireccion; AEditor : IEditorEditorDireccion;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorDireccion', IEditorEditorDireccion, AEditor); CreateEditor('EditorDireccion', IEditorEditorDireccion, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Direccion := ADireccion; Direccion := ADireccion;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -58,24 +58,23 @@ var
AEditor : IEditorEtiquetasContactosPreview; AEditor : IEditorEtiquetasContactosPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AContactosID); AStream := FDataModule.GetReport(AContactosID);
try try
CreateEditor('EditorEtiquetasContactosPreview', IEditorEtiquetasContactosPreview, AEditor); CreateEditor('EditorEtiquetasContactosPreview', IEditorEtiquetasContactosPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -93,13 +92,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -142,20 +142,19 @@ var
AEditor : IEditorGruposCliente; AEditor : IEditorGruposCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorGruposCliente', IEditorGruposCliente, AEditor); CreateEditor('EditorGruposCliente', IEditorGruposCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
GruposCliente := AGruposCliente; GruposCliente := AGruposCliente;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -142,20 +142,19 @@ var
AEditor : IEditorGruposProveedor; AEditor : IEditorGruposProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorGruposProveedor', IEditorGruposProveedor, AEditor); CreateEditor('EditorGruposProveedor', IEditorGruposProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
GruposProveedor := AGruposProveedor; GruposProveedor := AGruposProveedor;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -142,20 +142,19 @@ var
AEditor : IEditorProcedenciasCliente; AEditor : IEditorProcedenciasCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorProcedenciasCliente', IEditorProcedenciasCliente, AEditor); CreateEditor('EditorProcedenciasCliente', IEditorProcedenciasCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
ProcedenciasCliente := AProcedenciasCliente; ProcedenciasCliente := AProcedenciasCliente;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -90,23 +90,22 @@ var
AEditor : IEditorElegirProveedores; AEditor : IEditorElegirProveedores;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor); CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ContactosSeleccionados; Result := ContactosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -326,20 +325,19 @@ var
AEditor : IEditorProveedor; AEditor : IEditorProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorProveedor', IEditorProveedor, AEditor); CreateEditor('EditorProveedor', IEditorProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -348,8 +346,7 @@ var
AEditor : IEditorProveedores; AEditor : IEditorProveedores;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorProveedores', IEditorProveedores, AEditor); CreateEditor('EditorProveedores', IEditorProveedores, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -359,10 +356,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -139,21 +139,22 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirVendedores', IEditorElegirVendedores, AEditor); CreateEditor('EditorElegirVendedores', IEditorElegirVendedores, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ContactosSeleccionados; Result := ContactosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TVendedoresController.Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean; function TVendedoresController.Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean;
//En el caso de eliminar almenos un elemento del conjunto se devuelve true //En el caso de eliminar almenos un elemento del conjunto se devuelve true
@ -235,20 +236,19 @@ var
AEditor : IEditorVendedor; AEditor : IEditorVendedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorVendedor', IEditorVendedor, AEditor); CreateEditor('EditorVendedor', IEditorVendedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -257,8 +257,7 @@ var
AEditor : IEditorVendedores; AEditor : IEditorVendedores;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorVendedores', IEditorVendedores, AEditor); CreateEditor('EditorVendedores', IEditorVendedores, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -268,10 +267,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -27,23 +27,22 @@ var
AEditor : IEditorElegirArticulosFacturasCliente; AEditor : IEditorElegirArticulosFacturasCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor); CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -682,14 +682,14 @@ var
AEditor : IEditorFacturaCliente; AEditor : IEditorFacturaCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(AFactura);
CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor);
RecuperarCliente(AFactura);
CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura; Factura := AFactura;
@ -705,12 +705,9 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False); SetDataTableReadOnly(AFactura.DataTable, False);
finally
Release; Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -719,8 +716,7 @@ var
AEditor : IEditorFacturasCliente; AEditor : IEditorFacturasCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor); CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -730,10 +726,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TFacturasClienteController._Vacio: IBizFacturaCliente; function TFacturasClienteController._Vacio: IBizFacturaCliente;
@ -760,23 +752,23 @@ var
AEditor : IEditorElegirFacturasCliente; AEditor : IEditorElegirFacturasCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor); CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Facturas := AFacturas; Facturas := AFacturas;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := FacturasClienteSeleccionados; Result := FacturasClienteSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -60,24 +60,23 @@ var
AEditor : IEditorFacturasClientePreview; AEditor : IEditorFacturasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AFacturaID); AStream := FDataModule.GetReport(AFacturaID);
try try
CreateEditor('EditorFacturasClientePreview', IEditorFacturasClientePreview, AEditor); CreateEditor('EditorFacturasClientePreview', IEditorFacturasClientePreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -95,13 +94,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -28,12 +28,11 @@ var
AEditor : IEditorElegirArticulosFacturasProveedor; AEditor : IEditorElegirArticulosFacturasProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosFacturaProveedor', IEditorElegirArticulosFacturasProveedor, AEditor); CreateEditor('EditorElegirArticulosFacturaProveedor', IEditorElegirArticulosFacturasProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
Proveedor := AProveedor; Proveedor := AProveedor;
@ -41,11 +40,10 @@ begin
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -688,14 +688,14 @@ var
AEditor : IEditorFacturaProveedor; AEditor : IEditorFacturaProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(AFactura);
CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor);
RecuperarProveedor(AFactura);
CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura; Factura := AFactura;
@ -711,12 +711,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False); SetDataTableReadOnly(AFactura.DataTable, False);
AEditor.Release;
end;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -725,8 +723,7 @@ var
AEditor : IEditorFacturasProveedor; AEditor : IEditorFacturasProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFacturasProveedor', IEditorFacturasProveedor, AEditor); CreateEditor('EditorFacturasProveedor', IEditorFacturasProveedor, AEditor);
with AEditor do with AEditor do
begin begin
@ -735,10 +732,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TFacturasProveedorController._Vacio: IBizFacturaProveedor; function TFacturasProveedorController._Vacio: IBizFacturaProveedor;
@ -766,23 +759,21 @@ function TFacturasProveedorController.ElegirFacturas(AFacturas: IBizFacturaProve
begin begin
Result := NIL; Result := NIL;
{ {
ShowHourglassCursor;
try
CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor); CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Facturas := AFacturas; Facturas := AFacturas;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := FacturasProveedoreSeleccionados; Result := FacturasProveedoreSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
} }
end; end;

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorFacturasProveedorPreview; AEditor : IEditorFacturasProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AFacturaID); AStream := FDataModule.GetReport(AFacturaID);
try try
CreateEditor('EditorFacturasProveedorPreview', IEditorFacturasProveedorPreview, AEditor); CreateEditor('EditorFacturasProveedorPreview', IEditorFacturasProveedorPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -95,13 +94,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -152,20 +152,19 @@ var
AEditor : IEditorFamilias; AEditor : IEditorFamilias;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFamilias', IEditorFamilias, AEditor); CreateEditor('EditorFamilias', IEditorFamilias, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Familias := AFamilias; Familias := AFamilias;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -199,19 +199,20 @@ var
AEditor : IEditorFormaPago; AEditor : IEditorFormaPago;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFormaPago', IEditorFormaPago, AEditor); CreateEditor('EditorFormaPago', IEditorFormaPago, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
begin
with AEditor do with AEditor do
begin begin
try
FormaPago := AFormaPago; FormaPago := AFormaPago;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end;
end; end;
end; end;
@ -220,19 +221,18 @@ var
AEditor : IEditorFormasPago; AEditor : IEditorFormasPago;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFormasPago', IEditorFormasPago, AEditor); CreateEditor('EditorFormasPago', IEditorFormasPago, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
FormasPago := AFormasPago; FormasPago := AFormasPago;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -120,22 +120,21 @@ var
begin begin
Result := False; Result := False;
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEntradaSalidaArticulos', IEditorEntradaSalidaArticulos, AEditor); CreateEditor('EditorEntradaSalidaArticulos', IEditorEntradaSalidaArticulos, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Articulos := AArticulos; Articulos := AArticulos;
HistoricoMovimientos := AHistoricoMovimientos; HistoricoMovimientos := AHistoricoMovimientos;
ShowModal; ShowModal;
Result := ResultadoModalOK; Result := ResultadoModalOK;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end;} end;}
@ -144,8 +143,7 @@ var
AEditor : IEditorHistoricoMovimientos; AEditor : IEditorHistoricoMovimientos;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorHistoricoMovimientos', IEditorHistoricoMovimientos, AEditor); CreateEditor('EditorHistoricoMovimientos', IEditorHistoricoMovimientos, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -155,10 +153,6 @@ begin
MultiSelect := False; MultiSelect := False;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function THistoricoMovimientosController._Vacio: IBizHistoricoMovimientos; function THistoricoMovimientosController._Vacio: IBizHistoricoMovimientos;

View File

@ -27,22 +27,21 @@ var
AEditor : IEditorElegirArticulosCatalogo; AEditor : IEditorElegirArticulosCatalogo;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosCatalogo', IEditorElegirArticulosCatalogo, AEditor); CreateEditor('EditorElegirArticulosCatalogo', IEditorElegirArticulosCatalogo, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -326,23 +326,22 @@ var
AEditor : IEditorElegirArticulosAlmacen; AEditor : IEditorElegirArticulosAlmacen;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosAlmacen', IEditorElegirArticulosAlmacen, AEditor); CreateEditor('EditorElegirArticulosAlmacen', IEditorElegirArticulosAlmacen, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Inventario := AArticulos; Inventario := AArticulos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -452,12 +451,12 @@ var
begin begin
Result := False; Result := False;
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEntradaSalidaArticulos', IEditorEntradaSalidaArticulos, AEditor); CreateEditor('EditorEntradaSalidaArticulos', IEditorEntradaSalidaArticulos, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Articulos := AArticulos; Articulos := AArticulos;
Inventario := AInventario; Inventario := AInventario;
@ -465,11 +464,10 @@ begin
PedidoProveedor := APedido; PedidoProveedor := APedido;
ShowModal; ShowModal;
Result := ResultadoModalOK; Result := ResultadoModalOK;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -478,22 +476,21 @@ var
AEditor : IEditorDetalleReservas; AEditor : IEditorDetalleReservas;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorDetalleReservas', IEditorDetalleReservas, AEditor); CreateEditor('EditorDetalleReservas', IEditorDetalleReservas, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
// Controller := Self; //OJO ORDEN MUY IMPORTANTE // Controller := Self; //OJO ORDEN MUY IMPORTANTE
DetalleReservas := FDataModule.GetDetalleReservas; DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo; Articulo := AArticulo;
// MultiSelect := False; // MultiSelect := False;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -502,8 +499,7 @@ var
AEditor : IEditorInventario; AEditor : IEditorInventario;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorInventario', IEditorInventario, AEditor); CreateEditor('EditorInventario', IEditorInventario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -513,10 +509,6 @@ begin
MultiSelect := False; MultiSelect := False;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TInventarioController._Vacio: IBizInventario; function TInventarioController._Vacio: IBizInventario;

View File

@ -28,12 +28,12 @@ var
AEditor : IEditorElegirArticulosPedidosProveedor; AEditor : IEditorElegirArticulosPedidosProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosPedidoProveedor', IEditorElegirArticulosPedidosProveedor, AEditor); CreateEditor('EditorElegirArticulosPedidoProveedor', IEditorElegirArticulosPedidosProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
Proveedor := AProveedor; Proveedor := AProveedor;
@ -41,11 +41,10 @@ begin
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -240,22 +240,21 @@ var
begin begin
Result := False; Result := False;
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(APedido); RecuperarProveedor(APedido);
CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor); CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
PedidoProveedor := APedido; PedidoProveedor := APedido;
ShowModal; ShowModal;
Release;
Result := True; Result := True;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -368,14 +367,14 @@ var
AEditor : IEditorPedidoProveedor; AEditor : IEditorPedidoProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(APedido); RecuperarObjetos(APedido);
CreateEditor('EditorPedidoProveedor', IEditorPedidoProveedor, AEditor); CreateEditor('EditorPedidoProveedor', IEditorPedidoProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Pedido := APedido; Pedido := APedido;
@ -391,12 +390,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(APedido.DataTable, False); SetDataTableReadOnly(APedido.DataTable, False);
AEditor.Release;
end;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -405,8 +402,7 @@ var
AEditor : IEditorPedidosProveedor; AEditor : IEditorPedidosProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPedidosProveedor', IEditorPedidosProveedor, AEditor); CreateEditor('EditorPedidosProveedor', IEditorPedidosProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -416,10 +412,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TPedidosProveedorController.VerDireccionEntrega( procedure TPedidosProveedorController.VerDireccionEntrega(
@ -428,20 +420,19 @@ var
AEditor : IEditorDireccionEntregaPedidoProveedor; AEditor : IEditorDireccionEntregaPedidoProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(APedido); <- No descomentar. No hace falta //RecuperarObjetos(APedido); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaPedidoProveedor', IEditorDireccionEntregaPedidoProveedor, AEditor); CreateEditor('EditorDireccionEntregaPedidoProveedor', IEditorDireccionEntregaPedidoProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaPedidoProveedor) do with (AEditor as IEditorDireccionEntregaPedidoProveedor) do
begin begin
try
Pedido := APedido; Pedido := APedido;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -468,23 +459,22 @@ var
AEditor : IEditorElegirPedidosProveedor; AEditor : IEditorElegirPedidosProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirPedidosProveedor', IEditorElegirPedidosProveedor, AEditor); CreateEditor('EditorElegirPedidosProveedor', IEditorElegirPedidosProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Pedidos := APedido; Pedidos := APedido;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := PedidosProveedorSeleccionados; Result := PedidosProveedorSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -60,24 +60,23 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
try try
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor); CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -87,6 +86,7 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
@ -95,13 +95,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -27,23 +27,22 @@ var
AEditor : IEditorElegirArticulosPresupuestosCliente; AEditor : IEditorElegirArticulosPresupuestosCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosPresupuestosCliente', IEditorElegirArticulosPresupuestosCliente, AEditor); CreateEditor('EditorElegirArticulosPresupuestosCliente', IEditorElegirArticulosPresupuestosCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -355,14 +355,14 @@ var
AEditor : IEditorPresupuestoCliente; AEditor : IEditorPresupuestoCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(APresupuesto); RecuperarObjetos(APresupuesto);
CreateEditor('EditorPresupuestoCliente', IEditorPresupuestoCliente, AEditor); CreateEditor('EditorPresupuestoCliente', IEditorPresupuestoCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Presupuesto := APresupuesto; Presupuesto := APresupuesto;
@ -378,12 +378,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(APresupuesto.DataTable, False); SetDataTableReadOnly(APresupuesto.DataTable, False);
AEditor.Release;
end;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -394,20 +392,18 @@ var
begin begin
{ {
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(APresupuesto); <- No descomentar. No hace falta //RecuperarObjetos(APresupuesto); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaPresupuestoCliente', IEditorDireccionEntregaPresupuestoCliente, AEditor); CreateEditor('EditorDireccionEntregaPresupuestoCliente', IEditorDireccionEntregaPresupuestoCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaPresupuestoCliente) do with (AEditor as IEditorDireccionEntregaPresupuestoCliente) do
begin begin
try
Presupuesto := APresupuesto; Presupuesto := APresupuesto;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
} }
end; end;
@ -417,8 +413,7 @@ var
AEditor : IEditorPresupuestosCliente; AEditor : IEditorPresupuestosCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPresupuestosCliente', IEditorPresupuestosCliente, AEditor); CreateEditor('EditorPresupuestosCliente', IEditorPresupuestosCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -428,10 +423,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente; function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente;
@ -457,23 +448,22 @@ var
AEditor : IEditorElegirPresupuestosCliente; AEditor : IEditorElegirPresupuestosCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirPresupuestosCliente', IEditorElegirPresupuestosCliente, AEditor); CreateEditor('EditorElegirPresupuestosCliente', IEditorElegirPresupuestosCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
Presupuestos := APresupuesto; Presupuestos := APresupuesto;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := PresupuestosClienteSeleccionados; Result := PresupuestosClienteSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -86,8 +86,6 @@ var
AEditor : IEditorPresupuestosClientePreview; AEditor : IEditorPresupuestosClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptPresupuestos(AListaID); AStream := FDataModule.GetRptPresupuestos(AListaID);
try try
CreateEditor('EditorPresupuestosClientePreview', IEditorPresupuestosClientePreview, AEditor); CreateEditor('EditorPresupuestosClientePreview', IEditorPresupuestosClientePreview, AEditor);
@ -101,14 +99,11 @@ begin
AEditor.Preview; AEditor.Preview;
finally finally
AEditor.Release; AEditor.Release;
AEditor := Nil;
end; end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -133,11 +128,11 @@ begin
AEditor.Print; AEditor.Print;
finally finally
AEditor.Release; AEditor.Release;
AEditor := Nil;
end; end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -553,21 +553,20 @@ var
AEditor : IEditorReciboCliente; AEditor : IEditorReciboCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(ARecibosCliente); RecuperarCliente(ARecibosCliente);
CreateEditor('EditorReciboCliente', IEditorReciboCliente, AEditor); CreateEditor('EditorReciboCliente', IEditorReciboCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Recibo := ARecibosCliente; Recibo := ARecibosCliente;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -576,8 +575,7 @@ var
AEditor : IEditorRecibosCliente; AEditor : IEditorRecibosCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRecibosCliente', IEditorRecibosCliente, AEditor); CreateEditor('EditorRecibosCliente', IEditorRecibosCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -587,10 +585,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TRecibosClienteController.ElegirRecibos(ARecibos: IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente; function TRecibosClienteController.ElegirRecibos(ARecibos: IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente;
@ -598,22 +592,24 @@ var
AEditor : IEditorElegirRecibosCliente; AEditor : IEditorElegirRecibosCliente;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirRecibosCliente', IEditorElegirRecibosCliente, AEditor); CreateEditor('EditorElegirRecibosCliente', IEditorElegirRecibosCliente, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
RecibosCliente := ARecibos; RecibosCliente := ARecibos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := RecibosClienteSeleccionados; Result := RecibosClienteSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TRecibosClienteController.ElegirRecibosCompensados(ARecibo: IBizRecibosCliente): Boolean; function TRecibosClienteController.ElegirRecibosCompensados(ARecibo: IBizRecibosCliente): Boolean;
var var

View File

@ -59,25 +59,23 @@ var
AEditor : IEditorRecibosClientePreview; AEditor : IEditorRecibosClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRecibosClientePreview', IEditorRecibosClientePreview, AEditor); CreateEditor('EditorRecibosClientePreview', IEditorRecibosClientePreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TRecibosClienteReportController.Print(const ID : String); procedure TRecibosClienteReportController.Print(const ID : String);
@ -94,13 +92,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.LoadFromStream(AStream); AEditor.LoadFromStream(AStream);
AEditor.Print; AEditor.Print;
finally
AEditor.Release; AEditor.Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -546,21 +546,20 @@ var
AEditor : IEditorReciboProveedor; AEditor : IEditorReciboProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(ARecibosProveedor); RecuperarProveedor(ARecibosProveedor);
CreateEditor('EditorReciboProveedor', IEditorReciboProveedor, AEditor); CreateEditor('EditorReciboProveedor', IEditorReciboProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Recibo := ARecibosProveedor; Recibo := ARecibosProveedor;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -569,8 +568,7 @@ var
AEditor : IEditorRecibosProveedor; AEditor : IEditorRecibosProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRecibosProveedor', IEditorRecibosProveedor, AEditor); CreateEditor('EditorRecibosProveedor', IEditorRecibosProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
@ -580,10 +578,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TRecibosProveedorController.ElegirRecibos(ARecibos: IBizRecibosProveedor; AMensaje: String; function TRecibosProveedorController.ElegirRecibos(ARecibos: IBizRecibosProveedor; AMensaje: String;
@ -592,23 +586,24 @@ var
AEditor : IEditorElegirRecibosProveedor; AEditor : IEditorElegirRecibosProveedor;
begin begin
Result := NIL; Result := NIL;
try
CreateEditor('EditorElegirRecibosProveedor', IEditorElegirRecibosProveedor, AEditor); CreateEditor('EditorElegirRecibosProveedor', IEditorElegirRecibosProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; Controller := Self;
RecibosProveedor := ARecibos; RecibosProveedor := ARecibos;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := RecibosProveedorSeleccionados; Result := RecibosProveedorSeleccionados;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
end;
function TRecibosProveedorController.ElegirRecibosCompensados(ARecibo: IBizRecibosProveedor): Boolean; function TRecibosProveedorController.ElegirRecibosCompensados(ARecibo: IBizRecibosProveedor): Boolean;
var var

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRecibosProveedorPreview; AEditor : IEditorRecibosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor); CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -94,13 +93,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -132,21 +132,21 @@ var
AEditor : IEditorReferencias; AEditor : IEditorReferencias;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorReferencias', IEditorReferencias, AEditor); CreateEditor('EditorReferencias', IEditorReferencias, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Referencias := AReferencias; Referencias := AReferencias;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
end;
{ {
procedure TReferenciasController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); procedure TReferenciasController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable);
begin begin

View File

@ -222,14 +222,14 @@ var
AEditor : IEditorRemesaCliente; AEditor : IEditorRemesaCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(ARemesaCliente); RecuperarObjetos(ARemesaCliente);
CreateEditor('EditorRemesaCliente', IEditorRemesaCliente, AEditor); CreateEditor('EditorRemesaCliente', IEditorRemesaCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorRemesaCliente) do with (AEditor as IEditorRemesaCliente) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaCliente := ARemesaCliente; RemesaCliente := ARemesaCliente;
@ -245,12 +245,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(ARemesaCliente.DataTable, False); SetDataTableReadOnly(ARemesaCliente.DataTable, False);
AEditor.Release;
end;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -259,8 +257,7 @@ var
AEditor : IEditorRemesasCliente; AEditor : IEditorRemesasCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRemesasCliente', IEditorRemesasCliente, AEditor); CreateEditor('EditorRemesasCliente', IEditorRemesasCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorRemesasCliente) do with (AEditor as IEditorRemesasCliente) do
@ -270,10 +267,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TRemesasClienteController._Vacio: IBizRemesaCliente; function TRemesasClienteController._Vacio: IBizRemesaCliente;

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRemesasClientePreview; AEditor : IEditorRemesasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor); CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -86,6 +85,7 @@ var
AEditor : IEditorRemesasClientePreview; AEditor : IEditorRemesasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
@ -94,13 +94,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -222,14 +222,13 @@ var
AEditor : IEditorRemesaProveedor; AEditor : IEditorRemesaProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(ARemesaProveedor);
RecuperarObjetos(ARemesaProveedor);
CreateEditor('EditorRemesaProveedor', IEditorRemesaProveedor, AEditor); CreateEditor('EditorRemesaProveedor', IEditorRemesaProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorRemesaProveedor) do with (AEditor as IEditorRemesaProveedor) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaProveedor := ARemesaProveedor; RemesaProveedor := ARemesaProveedor;
@ -245,12 +244,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(ARemesaProveedor.DataTable, False); SetDataTableReadOnly(ARemesaProveedor.DataTable, False);
AEditor.Release;
end;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -259,8 +256,7 @@ var
AEditor : IEditorRemesasProveedor; AEditor : IEditorRemesasProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRemesasProveedor', IEditorRemesasProveedor, AEditor); CreateEditor('EditorRemesasProveedor', IEditorRemesasProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorRemesasProveedor) do with (AEditor as IEditorRemesasProveedor) do
@ -270,10 +266,6 @@ begin
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TRemesasProveedorController._Vacio: IBizRemesaProveedor; function TRemesasProveedorController._Vacio: IBizRemesaProveedor;

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRemesasProveedorPreview; AEditor : IEditorRemesasProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor); CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -95,13 +94,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
Release;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -234,19 +234,17 @@ var
AEditor : IEditorTipoIVA; AEditor : IEditorTipoIVA;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorTipoIVA', IEditorTipoIVA, AEditor); CreateEditor('EditorTipoIVA', IEditorTipoIVA, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
TipoIVA := ATipoIVA; TipoIVA := ATipoIVA;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -255,19 +253,18 @@ var
AEditor : IEditorTiposIVA; AEditor : IEditorTiposIVA;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorTiposIVA', IEditorTiposIVA, AEditor); CreateEditor('EditorTiposIVA', IEditorTiposIVA, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
TiposIVA := ATiposIVA; TiposIVA := ATiposIVA;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -283,7 +280,6 @@ begin
ATipoIVA.Delete; ATipoIVA.Delete;
ATipoIVA.DataTable.ApplyUpdates; ATipoIVA.DataTable.ApplyUpdates;
HideHourglassCursor;
Result := True; Result := True;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -138,19 +138,18 @@ var
AEditor : IEditorTiposVenta; AEditor : IEditorTiposVenta;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorTiposVenta', IEditorTiposVenta, AEditor); CreateEditor('EditorTiposVenta', IEditorTiposVenta, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
TiposVenta := ATiposVenta; TiposVenta := ATiposVenta;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
{ {

View File

@ -152,20 +152,19 @@ var
AEditor : IEditorUnidadesMedida; AEditor : IEditorUnidadesMedida;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorUnidadesMedida', IEditorUnidadesMedida, AEditor); CreateEditor('EditorUnidadesMedida', IEditorUnidadesMedida, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
UnidadesMedida := AUnidadesMedida; UnidadesMedida := AUnidadesMedida;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;