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.Tecsitel_FactuGES2/trunk@752 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2008-11-11 16:22:18 +00:00
parent cebe5ab708
commit 7e5074bca1
55 changed files with 1618 additions and 1736 deletions

View File

@ -47,20 +47,20 @@ 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
begin
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; end;

View File

@ -271,20 +271,18 @@ 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;
@ -300,9 +298,13 @@ begin
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;
ShowEmbedded; ShowModal;
finally
Release;
end;
end; end;
finally finally
AEditor := NIL; AEditor := NIL;

View File

@ -143,21 +143,25 @@ begin
APerfilesUsuario := FDataModule.GetPerfiles; APerfilesUsuario := FDataModule.GetPerfiles;
if Assigned(APerfilesUsuario) then if Assigned(APerfilesUsuario) then
begin begin
APerfilesUsuario.Active := True;
ShowHourglassCursor;
try try
APerfilesUsuario.Active := True;
CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor); CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
begin
with (AEditor as IEditorPerfilesUsuario) do with (AEditor as IEditorPerfilesUsuario) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
PerfilesUsuario := APerfilesUsuario; PerfilesUsuario := APerfilesUsuario;
ShowEmbedded; ShowModal;
finally
Release;
AEditor := NIL;
end;
end;
end; end;
finally finally
AEditor := NIL;
APerfilesUsuario := NIL; APerfilesUsuario := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;
@ -170,22 +174,23 @@ begin
FPerfil := FDataModule.GetPerfil(AIDPerfil); FPerfil := FDataModule.GetPerfil(AIDPerfil);
if Assigned(FPerfil) then if Assigned(FPerfil) then
begin begin
FPerfil.Active := True;
ShowHourglassCursor;
try try
FPerfil.Active := True;
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 := FPerfil; PerfilUsuario := FPerfil;
ShowModal; ShowModal;
finally
Release; Release;
AEditor := NIL;
end;
end; end;
finally finally
AEditor := NIL;
FPerfil := NIL; FPerfil := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;
@ -198,21 +203,23 @@ begin
APerfilesUsuario := FDataModule.GetPerfiles; APerfilesUsuario := FDataModule.GetPerfiles;
if Assigned(APerfilesUsuario) then if Assigned(APerfilesUsuario) then
begin begin
APerfilesUsuario.Active := True;
ShowHourglassCursor;
try try
APerfilesUsuario.Active := True;
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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
PerfilesUsuario := APerfilesUsuario; PerfilesUsuario := APerfilesUsuario;
ShowEmbedded; ShowModal;
finally
Release;
AEditor := NIL;
end;
end; end;
finally finally
AEditor := NIL;
APerfilesUsuario := NIL; APerfilesUsuario := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;

View File

@ -758,20 +758,20 @@ 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
begin
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; end;
@ -783,21 +783,23 @@ begin
APerfilesUsuario := FDataModule.GetPerfiles; APerfilesUsuario := FDataModule.GetPerfiles;
if Assigned(APerfilesUsuario) then if Assigned(APerfilesUsuario) then
begin begin
APerfilesUsuario.Active := True;
ShowHourglassCursor;
try try
APerfilesUsuario.Active := True;
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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
PerfilesUsuario := APerfilesUsuario; PerfilesUsuario := APerfilesUsuario;
ShowEmbedded; ShowModal;
finally
Release;
AEditor := NIL;
end;
end; end;
finally finally
AEditor := NIL;
APerfilesUsuario := NIL; APerfilesUsuario := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;
@ -818,20 +820,18 @@ 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;
@ -844,20 +844,22 @@ begin
if Assigned(FUsuarios) then if Assigned(FUsuarios) then
begin begin
FUsuarios.Active := True; FUsuarios.Active := True;
ShowHourglassCursor;
try 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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Usuarios := FUsuarios; Usuarios := FUsuarios;
ShowEmbedded; ShowModal;
finally
Release;
AEditor := NIL;
end;
end; end;
finally finally
AEditor := NIL;
FUsuarios := NIL; FUsuarios := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;
@ -873,19 +875,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

@ -575,8 +575,6 @@ 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
@ -587,10 +585,11 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do with (AEditor as IEditorAlbaranCliente) do
begin begin
try
//MODO CONSULTAR
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran; Albaran := AAlbaran;
//MODO CONSULTAR
if not EsModificable(AAlbaran) then if not EsModificable(AAlbaran) then
begin begin
SetDataTableReadOnly(AAlbaran.DataTable, True); SetDataTableReadOnly(AAlbaran.DataTable, True);
@ -602,12 +601,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(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
AEditor.Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -617,20 +614,19 @@ 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 begin
try
Albaran := AAlbaran; Albaran := AAlbaran;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -641,12 +637,11 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -661,10 +656,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -675,12 +671,11 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -690,14 +685,16 @@ begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaranes := AAlbarans; Albaranes := AAlbarans;
MultiSelect := True; MultiSelect := True;
if AVerModal then if AVerModal then
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -724,23 +721,21 @@ 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

@ -70,25 +70,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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteReportController.EtiquetasPrint(const AID: integer; const withRefCliente: Boolean); procedure TAlbaranesClienteReportController.EtiquetasPrint(const AID: integer; const withRefCliente: Boolean);
@ -97,25 +95,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);
Print; Print;
finally
Release; Release;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
function TAlbaranesClienteReportController.ExportToPDF(const AID: Integer; function TAlbaranesClienteReportController.ExportToPDF(const AID: Integer;
@ -172,8 +168,6 @@ 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);
@ -193,9 +187,6 @@ begin
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteReportController.Print(const AListaID : TIntegerList); procedure TAlbaranesClienteReportController.Print(const AListaID : TIntegerList);

View File

@ -27,23 +27,21 @@ 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

@ -656,8 +656,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
@ -668,6 +667,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;
@ -683,10 +683,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(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -695,19 +695,18 @@ 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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -718,12 +717,11 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -737,10 +735,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -751,12 +750,11 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -770,10 +768,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -800,22 +799,21 @@ 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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -60,25 +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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesProveedorReportController.Print(const AID : String); procedure TAlbaranesProveedorReportController.Print(const AID : String);
@ -95,10 +93,13 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;

View File

@ -27,12 +27,11 @@ 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 +39,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

@ -218,21 +218,19 @@ 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;
@ -242,20 +240,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;
@ -264,18 +261,18 @@ 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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Almacenes := AAlmacenes; Almacenes := AAlmacenes;
ShowEmbedded; ShowEmbedded;
end;
finally finally
HideHourglassCursor; AEditor := NIL;
end;
end; end;
end; end;

View File

@ -441,22 +441,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;
@ -483,18 +482,17 @@ var
AEditor : IEditorArticulos; AEditor : IEditorArticulos;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorArticulos', IEditorArticulos, AEditor); CreateEditor('EditorArticulos', IEditorArticulos, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorArticulos) do with (AEditor as IEditorArticulos) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := Nil; AEditor := Nil;
HideHourglassCursor; end;
end; end;
end; end;
@ -522,23 +520,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,9 @@ begin
AFileName := Fichero; AFileName := Fichero;
Result := True; Result := True;
end; end;
finally
Release; Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -126,6 +126,7 @@ begin
if IsPositiveResult(AEditor.ShowModal) then if IsPositiveResult(AEditor.ShowModal) then
Result := AEditor.ContactosSeleccionados; Result := AEditor.ContactosSeleccionados;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
Application.ProcessMessages; Application.ProcessMessages;
end; end;
@ -148,6 +149,7 @@ begin
if IsPositiveResult(AEditor.ShowModal) then if IsPositiveResult(AEditor.ShowModal) then
Result := AEditor.DireccionSeleccionada; Result := AEditor.DireccionSeleccionada;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
Application.ProcessMessages; Application.ProcessMessages;
end; end;
@ -170,6 +172,7 @@ begin
if IsPositiveResult(AEditor.ShowModal) then if IsPositiveResult(AEditor.ShowModal) then
Result := AEditor.PersonaSeleccionada; Result := AEditor.PersonaSeleccionada;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
Application.ProcessMessages; Application.ProcessMessages;
end; end;
@ -385,19 +388,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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -490,20 +493,19 @@ 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
begin begin
try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -70,20 +70,19 @@ var
AEditor : IEditorDatoBancarioContacto; AEditor : IEditorDatoBancarioContacto;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorDatoBancarioContacto', IEditorDatoBancarioContacto, AEditor); CreateEditor('EditorDatoBancarioContacto', IEditorDatoBancarioContacto, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
DatoBancario := ADatoBancario; DatoBancario := ADatoBancario;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -135,20 +135,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

@ -266,20 +266,19 @@ var
AEditor : IEditorEmpleado; AEditor : IEditorEmpleado;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpleado', IEditorEmpleado, AEditor); CreateEditor('EditorEmpleado', IEditorEmpleado, 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;
@ -288,20 +287,19 @@ var
AEditor : IEditorEmpleados; AEditor : IEditorEmpleados;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpleados', IEditorEmpleados, AEditor); CreateEditor('EditorEmpleados', IEditorEmpleados, 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 := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -58,8 +58,7 @@ var
AEditor : IEditorEtiquetasContactosPreview; AEditor : IEditorEtiquetasContactosPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ListaID); AStream := FDataModule.GetReport(ListaID);
try try
CreateEditor('EditorEtiquetasContactosPreview', IEditorEtiquetasContactosPreview, AEditor); CreateEditor('EditorEtiquetasContactosPreview', IEditorEtiquetasContactosPreview, AEditor);
@ -78,9 +77,6 @@ begin
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TEtiquetasContactosReportController.Print(const ListaID : TIntegerList); procedure TEtiquetasContactosReportController.Print(const ListaID : TIntegerList);

View File

@ -58,8 +58,7 @@ var
AEditor : IEditorFichasEmpleadoPreview; AEditor : IEditorFichasEmpleadoPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ListaID); AStream := FDataModule.GetReport(ListaID);
try try
CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor); CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor);
@ -78,9 +77,6 @@ begin
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TFichasEmpleadoReportController.Print(const ListaID : TIntegerList); procedure TFichasEmpleadoReportController.Print(const ListaID : TIntegerList);

View File

@ -140,20 +140,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

@ -140,20 +140,19 @@ var
AEditor : IEditorGruposEmpleado; AEditor : IEditorGruposEmpleado;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorGruposEmpleado', IEditorGruposEmpleado, AEditor); CreateEditor('EditorGruposEmpleado', IEditorGruposEmpleado, 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
GruposEmpleado := AGruposEmpleado; GruposEmpleado := AGruposEmpleado;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -140,20 +140,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

@ -69,20 +69,18 @@ var
AEditor : IEditorPersonalContacto; AEditor : IEditorPersonalContacto;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPersonalContacto', IEditorPersonalContacto, AEditor); CreateEditor('EditorPersonalContacto', IEditorPersonalContacto, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Personal := APersonal; Personal := APersonal;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
finally
Release; Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -121,22 +121,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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -146,20 +146,20 @@ var
AEditor : IEditorElegirDireccionEntrega; AEditor : IEditorElegirDireccionEntrega;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor); CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Contacto := AProveedor; Contacto := AProveedor;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := DireccionSeleccionada; Result := DireccionSeleccionada;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -312,19 +312,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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -443,20 +443,19 @@ 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
begin begin
try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -152,20 +152,19 @@ var
AEditor : IEditorFabricantes; AEditor : IEditorFabricantes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFabricantes', IEditorFabricantes, AEditor); CreateEditor('EditorFabricantes', IEditorFabricantes, 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
Fabricantes := AFabricantes; Fabricantes := AFabricantes;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; 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

@ -606,14 +606,14 @@ var
AEditor : IEditorFacturaCliente; AEditor : IEditorFacturaCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(AFactura); RecuperarCliente(AFactura);
CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor); 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;
@ -629,12 +629,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);
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -645,12 +643,12 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -664,10 +662,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := Nil; AEditor := Nil;
HideHourglassCursor; end;
end; end;
end; end;
@ -695,23 +694,22 @@ 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

@ -115,27 +115,26 @@ var
AEditor : IEditorFacturasClientePreview; AEditor : IEditorFacturasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptFacturas(AListaID); AStream := FDataModule.GetRptFacturas(AListaID);
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
AEditor.Controller := Self; AEditor.Controller := Self;
ListaID := AListaID; ListaID := AListaID;
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 TFacturasClienteReportController.Print(const AListaID : TIntegerList); procedure TFacturasClienteReportController.Print(const AListaID : TIntegerList);
@ -152,11 +151,14 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
LoadFromStream(AStream); LoadFromStream(AStream);
Print; Print;
finally
Release; Release;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;

View File

@ -28,12 +28,12 @@ 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 +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

@ -463,14 +463,14 @@ var
AEditor : IEditorFacturaProveedor; AEditor : IEditorFacturaProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(AFactura); RecuperarProveedor(AFactura);
CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor); 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;
@ -486,10 +486,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);
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -500,11 +500,11 @@ 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
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -518,10 +518,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := Nil; AEditor := Nil;
HideHourglassCursor; end;
end; end;
end; end;
@ -550,22 +551,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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
} }
end; end;

View File

@ -59,25 +59,24 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TFacturasProveedorReportController.Print(const AFacturaID : String); procedure TFacturasProveedorReportController.Print(const AFacturaID : String);
@ -95,10 +94,13 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;

View File

@ -145,20 +145,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

@ -178,19 +178,18 @@ 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
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;
@ -199,19 +198,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

@ -281,26 +281,21 @@ var
AEditor : IEditorInformeIVAClientesReport; AEditor : IEditorInformeIVAClientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeIVAClientesReport', IEditorInformeIVAClientesReport, AEditor); CreateEditor('EditorInformeIVAClientesReport', IEditorInformeIVAClientesReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de IVA de facturas de cliente'; AEditor.Title := 'Listado de IVA de facturas de cliente';
AStream := FDataModule.GenerarInformeIVAClientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeIVAClientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -310,26 +305,22 @@ var
AEditor : IEditorInformeIVAProveedoresReport; AEditor : IEditorInformeIVAProveedoresReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeIVAProveedoresReport', IEditorInformeIVAProveedoresReport, AEditor); CreateEditor('EditorInformeIVAProveedoresReport', IEditorInformeIVAProveedoresReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de IVA de facturas de proveedor'; AEditor.Title := 'Listado de IVA de facturas de proveedor';
AStream := FDataModule.GenerarInformeIVAProveedores(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeIVAProveedores(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -339,26 +330,22 @@ var
AEditor : IEditorInformeFacturasClienteReport; AEditor : IEditorInformeFacturasClienteReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeFacturasClienteReport', IEditorInformeFacturasClienteReport, AEditor); CreateEditor('EditorInformeFacturasClienteReport', IEditorInformeFacturasClienteReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de cliente'; AEditor.Title := 'Listado de facturas de cliente';
AStream := FDataModule.GenerarInformeListadoFacturasCli(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasCli(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -368,26 +355,22 @@ var
AEditor : IEditorInformeFacturasClientePendientesReport; AEditor : IEditorInformeFacturasClientePendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeFacturasClientePendientesReport', IEditorInformeFacturasClientePendientesReport, AEditor); CreateEditor('EditorInformeFacturasClientePendientesReport', IEditorInformeFacturasClientePendientesReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de cliente pendientes'; AEditor.Title := 'Listado de facturas de cliente pendientes';
AStream := FDataModule.GenerarInformeListadoFacturasCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -397,26 +380,21 @@ var
AEditor : IEditorInformeFacturasProveedorReport; AEditor : IEditorInformeFacturasProveedorReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeFacturasProveedorReport', IEditorInformeFacturasProveedorReport, AEditor); CreateEditor('EditorInformeFacturasProveedorReport', IEditorInformeFacturasProveedorReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de proveedor'; AEditor.Title := 'Listado de facturas de proveedor';
AStream := FDataModule.GenerarInformeListadoFacturasProv(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasProv(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -426,26 +404,21 @@ var
AEditor : IEditorInformeFacturasProveedorPendientesReport; AEditor : IEditorInformeFacturasProveedorPendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeFacturasProveedorPendientesReport', IEditorInformeFacturasProveedorPendientesReport, AEditor); CreateEditor('EditorInformeFacturasProveedorPendientesReport', IEditorInformeFacturasProveedorPendientesReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de proveedor pendientes'; AEditor.Title := 'Listado de facturas de proveedor pendientes';
AStream := FDataModule.GenerarInformeListadoFacturasProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -456,25 +429,21 @@ var
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try
try
CreateEditor('EditorInformePedidosReport', IEditorInformePedidosReport, AEditor); CreateEditor('EditorInformePedidosReport', IEditorInformePedidosReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de pedidos de proveedor'; AEditor.Title := 'Listado de pedidos de proveedor';
AStream := FDataModule.GenerarInformeListadoPedidos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoPedidos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -484,26 +453,22 @@ var
AEditor : IEditorInformePresupuestosReport; AEditor : IEditorInformePresupuestosReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformePresupuestosReport', IEditorInformePresupuestosReport, AEditor); CreateEditor('EditorInformePresupuestosReport', IEditorInformePresupuestosReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de presupuestos de cliente'; AEditor.Title := 'Listado de presupuestos de cliente';
AStream := FDataModule.GenerarInformeListadoPresupuestos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoPresupuestos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -513,25 +478,20 @@ var
AEditor : IEditorInformeRecibosClienteReport; AEditor : IEditorInformeRecibosClienteReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeRecibosClienteReport', IEditorInformeRecibosClienteReport, AEditor); CreateEditor('EditorInformeRecibosClienteReport', IEditorInformeRecibosClienteReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosCliente(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosCliente(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -541,25 +501,21 @@ var
AEditor : IEditorInformeRecibosCliPendientesReport; AEditor : IEditorInformeRecibosCliPendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeRecibosCliPendientesReport', IEditorInformeRecibosCliPendientesReport, AEditor); CreateEditor('EditorInformeRecibosCliPendientesReport', IEditorInformeRecibosCliPendientesReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -570,25 +526,21 @@ var
AEditor : IEditorInformeRecibosProveedorReport; AEditor : IEditorInformeRecibosProveedorReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeRecibosProveedorReport', IEditorInformeRecibosProveedorReport, AEditor); CreateEditor('EditorInformeRecibosProveedorReport', IEditorInformeRecibosProveedorReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosProveedor(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosProveedor(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -598,25 +550,21 @@ var
AEditor : IEditorInformeRecibosProvPendientesReport; AEditor : IEditorInformeRecibosProvPendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
try
CreateEditor('EditorInformeRecibosProvPendientesReport', IEditorInformeRecibosProvPendientesReport, AEditor); CreateEditor('EditorInformeRecibosProvPendientesReport', IEditorInformeRecibosProvPendientesReport, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
HideHourglassCursor;
end; end;
end; end;
@ -634,6 +582,7 @@ begin
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;
@ -649,9 +598,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);
finally
Release; Release;
end; end;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; HideHourglassCursor;
@ -664,20 +614,18 @@ var
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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Facturas := AFacturas; Facturas := AFacturas;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := Nil; AEditor := Nil;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -27,22 +27,20 @@ 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

@ -406,23 +406,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;
@ -532,12 +531,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;
@ -545,11 +544,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;
@ -558,23 +556,22 @@ 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
TipoReservas := ATipoReservas; TipoReservas := ATipoReservas;
DetalleReservas := FDataModule.GetDetalleReservas; DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo; Articulo := AArticulo;
MultiSelect := True; MultiSelect := True;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -583,21 +580,20 @@ 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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
TipoInventario := pTipoInventario; TipoInventario := pTipoInventario;
Inventario := AInventario; Inventario := AInventario;
MultiSelect := False; MultiSelect := False;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -191,10 +191,10 @@ begin
AObra.DataTable.Active := True; AObra.DataTable.Active := True;
CreateEditor('EditorFechaCierreObra', IEditorFechaCierreObra, AEditor); CreateEditor('EditorFechaCierreObra', IEditorFechaCierreObra, AEditor);
try
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorFechaCierreObra) do with (AEditor as IEditorFechaCierreObra) do
begin begin
try
FechaCierre := DateOf(AFecha); FechaCierre := DateOf(AFecha);
if (ShowModal = mrOk) then if (ShowModal = mrOk) then
begin begin
@ -202,10 +202,11 @@ begin
AObra.Ejecuciones.FECHA_FIN := DateOf(FechaCierre); AObra.Ejecuciones.FECHA_FIN := DateOf(FechaCierre);
AObra.Ejecuciones.Post; AObra.Ejecuciones.Post;
end; end;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end;
end; end;
procedure TObrasController.CopiarDireccion(const ACliente: IBizCliente; procedure TObrasController.CopiarDireccion(const ACliente: IBizCliente;
@ -344,21 +345,20 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AObra); RecuperarObjetos(AObra);
CreateEditor('EditorObra', IEditorObra, AEditor); CreateEditor('EditorObra', IEditorObra, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorObra) do with (AEditor as IEditorObra) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Obra := AObra; Obra := AObra;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -367,21 +367,20 @@ var
AEditor : IEditorEjecucionObra; AEditor : IEditorEjecucionObra;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AObra); RecuperarObjetos(AObra);
CreateEditor('EditorEjecucionObra', IEditorEjecucionObra, AEditor); CreateEditor('EditorEjecucionObra', IEditorEjecucionObra, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorEjecucionObra) do with (AEditor as IEditorEjecucionObra) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Obra := AObra; Obra := AObra;
ShowModal; ShowModal;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -391,20 +390,19 @@ var
begin begin
AEditor := NIL; AEditor := NIL;
Result := NIL; Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorListaObras', IEditorListaObras, AEditor); CreateEditor('EditorListaObras', IEditorListaObras, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
try
Obras := AObras; Obras := AObras;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ObraSeleccionado; Result := ObraSeleccionado;
Release;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -413,18 +411,18 @@ var
AEditor : IEditorObras; AEditor : IEditorObras;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorObras', IEditorObras, AEditor); CreateEditor('EditorObras', IEditorObras, 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
Obras := AObras; Obras := AObras;
ShowEmbedded; ShowEmbedded;
end;
finally finally
HideHourglassCursor; AEditor := NIL;
end;
end; end;
end; end;

View File

@ -29,12 +29,11 @@ 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;
@ -42,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

@ -342,21 +342,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;
Result := True; Result := True;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -473,14 +473,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;
@ -496,10 +496,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);
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -510,12 +510,12 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -529,10 +529,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -542,19 +543,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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -581,22 +582,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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -50,6 +50,7 @@ uses
constructor TPedidosProveedorReportController.Create; constructor TPedidosProveedorReportController.Create;
begin begin
inherited;
FDataModule := TDataModulePedidosProveedor.Create(Nil); FDataModule := TDataModulePedidosProveedor.Create(Nil);
end; end;
@ -124,8 +125,7 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor); AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor);
try try
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor); CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
@ -141,14 +141,11 @@ begin
AEditor.Preview; AEditor.Preview;
finally finally
AEditor.Release; AEditor.Release;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
end;
finally finally
HideHourglassCursor; FreeANDNil(AStream)
end; end;
end; end;
@ -159,6 +156,7 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor); AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor);

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

@ -472,14 +472,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;
@ -495,12 +495,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
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -511,20 +509,18 @@ procedure TPresupuestosClienteController.VerDireccionEntrega(
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;
@ -536,12 +532,11 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -555,10 +550,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -585,23 +581,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

@ -44,6 +44,7 @@ uses
constructor TPresupuestosClienteReportController.Create; constructor TPresupuestosClienteReportController.Create;
begin begin
inherited;
FDataModule := TDataModulePresupuestosCliente.Create(Nil); FDataModule := TDataModulePresupuestosCliente.Create(Nil);
end; end;
@ -138,8 +139,7 @@ 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);
@ -159,9 +159,6 @@ begin
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TPresupuestosClienteReportController.Print(const AListaID : TIntegerList); procedure TPresupuestosClienteReportController.Print(const AListaID : TIntegerList);

View File

@ -184,8 +184,8 @@ begin
try try
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
AEditor.Release;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
@ -552,21 +552,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;
@ -577,12 +576,12 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -597,10 +596,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -609,21 +609,23 @@ 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;
@ -786,15 +788,19 @@ var
AEditor : IEditorFechaPago; AEditor : IEditorFechaPago;
FechaPago: String; FechaPago: String;
begin begin
try if not Assigned(ARecibosCliente) then
raise Exception.Create ('Recibos de cliente no asignado (ModificarPago)');
//Pedimos la fecha del pago //Pedimos la fecha del pago
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor); CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
FechaPago:= ''; try
FechaPago := '';
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
AEditor.Release;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
end; end;

View File

@ -59,8 +59,7 @@ var
AEditor : IEditorRecibosClientePreview; AEditor : IEditorRecibosClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ListaID); AStream := FDataModule.GetReport(ListaID);
try try
CreateEditor('EditorRecibosClientePreview', IEditorRecibosClientePreview, AEditor); CreateEditor('EditorRecibosClientePreview', IEditorRecibosClientePreview, AEditor);
@ -79,9 +78,6 @@ begin
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TRecibosClienteReportController.Print(const ListaID : TIntegerList); procedure TRecibosClienteReportController.Print(const ListaID : TIntegerList);

View File

@ -169,12 +169,13 @@ begin
//Pedimos la fecha del pago //Pedimos la fecha del pago
if (Length(FechaPago) = 0) then if (Length(FechaPago) = 0) then
begin begin
try
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor); CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
try
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
finally finally
Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
@ -528,20 +529,20 @@ var
AEditor : IEditorReciboProveedor; AEditor : IEditorReciboProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(ARecibosProveedor); RecuperarCliente(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;
end;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -552,12 +553,12 @@ 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
begin begin
try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -570,10 +571,11 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end;
finally finally
if AVerModal then
Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
@ -583,20 +585,21 @@ 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;
end;
finally finally
AEditor := NIL; Release;
end;
end; end;
end; end;
@ -758,14 +761,15 @@ var
AEditor : IEditorFechaPagoProveedor; AEditor : IEditorFechaPagoProveedor;
FechaPago: String; FechaPago: String;
begin begin
try
//Pedimos la fecha del pago //Pedimos la fecha del pago
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor); CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
try
FechaPago:= ''; FechaPago:= '';
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
end; end;

View File

@ -58,25 +58,24 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TRecibosProveedorReportController.Print(const ID : integer); procedure TRecibosProveedorReportController.Print(const ID : integer);
@ -93,10 +92,13 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;

View File

@ -130,20 +130,17 @@ procedure TReferenciasController.VerTodos(AReferencias: IBizReferencia);
var var
AEditor : IEditorReferencias; AEditor : IEditorReferencias;
begin begin
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;
{ {

View File

@ -218,14 +218,13 @@ 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;
@ -241,12 +240,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;
@ -255,20 +252,19 @@ 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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesasCliente := ARemesasCliente; RemesasCliente := ARemesasCliente;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := Nil; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -58,25 +58,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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TRemesasClienteReportController.Print(const ID : String); procedure TRemesasClienteReportController.Print(const ID : String);
@ -93,10 +91,13 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;

View File

@ -218,14 +218,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;
@ -241,12 +240,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;
@ -255,20 +252,18 @@ 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
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesasProveedor := ARemesasProveedor; RemesasProveedor := ARemesasProveedor;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end;
finally finally
AEditor := Nil; AEditor := Nil;
HideHourglassCursor; end;
end; end;
end; end;

View File

@ -58,25 +58,24 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil; AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TRemesasProveedorReportController.Print(const ID : String); procedure TRemesasProveedorReportController.Print(const ID : String);
@ -94,10 +93,13 @@ 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;
end; end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
end; end;

View File

@ -212,19 +212,16 @@ 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;
finally
Release; Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -233,19 +230,17 @@ 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;

View File

@ -144,20 +144,17 @@ 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;
finally
Release; Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;