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

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

View File

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

View File

@ -31,21 +31,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 with AEditor do
with AEditor do begin
begin try
DatosBancarios := ADatosBancarios; DatosBancarios := ADatosBancarios;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

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

View File

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

View File

@ -781,21 +781,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 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TUsuariosController.VerPerfiles; procedure TUsuariosController.VerPerfiles;
@ -804,24 +803,18 @@ var
APerfilesUsuario: IBizPerfilUsuario; APerfilesUsuario: IBizPerfilUsuario;
begin begin
APerfilesUsuario := FDataModule.GetPerfiles; APerfilesUsuario := FDataModule.GetPerfiles;
if Assigned(APerfilesUsuario) then if Assigned(APerfilesUsuario) then
begin begin
APerfilesUsuario.Active := True; APerfilesUsuario.Active := True;
ShowHourglassCursor; CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor); with (AEditor as IEditorPerfilesUsuario) do
if Assigned(AEditor) then begin
with (AEditor as IEditorPerfilesUsuario) do Controller := Self; //OJO ORDEN MUY IMPORTANTE
begin PerfilesUsuario := APerfilesUsuario;
Controller := Self; //OJO ORDEN MUY IMPORTANTE ShowEmbedded;
PerfilesUsuario := APerfilesUsuario; end;
ShowEmbedded;
end;
finally
AEditor := NIL;
APerfilesUsuario := NIL;
HideHourglassCursor;
end;
end; end;
end; end;
@ -841,21 +834,20 @@ 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;
finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor;
end;
end; end;
procedure TUsuariosController.VerUsuarios; procedure TUsuariosController.VerUsuarios;
@ -867,21 +859,14 @@ begin
if Assigned(FUsuarios) then if Assigned(FUsuarios) then
begin begin
FUsuarios.Active := True; FUsuarios.Active := True;
ShowHourglassCursor; CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor); with (AEditor as IEditorUsuarios) do
if Assigned(AEditor) then begin
with (AEditor as IEditorUsuarios) do Controller := Self; //OJO ORDEN MUY IMPORTANTE
begin Usuarios := FUsuarios;
Controller := Self; //OJO ORDEN MUY IMPORTANTE ShowEmbedded;
Usuarios := FUsuarios; end;
ShowEmbedded;
end;
finally
AEditor := NIL;
FUsuarios := NIL;
HideHourglassCursor;
end;
end; end;
end; end;
@ -896,20 +881,19 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;

View File

@ -547,40 +547,37 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then RecuperarObjetos(AAlbaran);
CreateEditor('EditorAlbaranCliente', IEditorAlbaranCliente, AEditor)
else
CreateEditor('EditorAlbaranDevCliente', IEditorAlbaranDevCliente, AEditor);
if Assigned(AEditor) then if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
with (AEditor as IEditorAlbaranCliente) do CreateEditor('EditorAlbaranCliente', IEditorAlbaranCliente, AEditor)
begin else
Controller := Self; //OJO ORDEN MUY IMPORTANTE CreateEditor('EditorAlbaranDevCliente', IEditorAlbaranDevCliente, AEditor);
Albaran := AAlbaran;
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
//MODO CONSULTAR //MODO CONSULTAR
if not EsModificable(AAlbaran) then if not EsModificable(AAlbaran) then
begin begin
SetDataTableReadOnly(AAlbaran.DataTable, True); SetDataTableReadOnly(AAlbaran.DataTable, True);
ReadOnly := True; ReadOnly := True;
end; end;
ShowModal; ShowModal;
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
AEditor.Release; AEditor.Release;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteController.VerDireccionEntrega( procedure TAlbaranesClienteController.VerDireccionEntrega(
@ -589,21 +586,18 @@ 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 try
begin Albaran := AAlbaran;
Albaran := AAlbaran; ShowModal;
ShowModal; finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteController.VerTodosAlbaranes(AAlbarans: IBizAlbaranCliente); procedure TAlbaranesClienteController.VerTodosAlbaranes(AAlbarans: IBizAlbaranCliente);
@ -611,21 +605,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Albaranes := AAlbarans;
Albaranes := AAlbarans; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente); procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente);
@ -633,21 +622,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Albaranes := AAlbarans;
Albaranes := AAlbarans; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAlbaranesClienteController._Vacio: IBizAlbaranCliente; function TAlbaranesClienteController._Vacio: IBizAlbaranCliente;
@ -673,24 +657,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TAlbaranesClienteController.Eliminar(AAlbaran: IBizAlbaranCliente; AllItems: Boolean = false): Boolean; function TAlbaranesClienteController.Eliminar(AAlbaran: IBizAlbaranCliente; AllItems: Boolean = false): Boolean;

View File

@ -68,24 +68,23 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetEtiquetas(AID, withRefCliente);
try try
AStream := FDataModule.GetEtiquetas(AID, withRefCliente); CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
end; end;
end; end;
@ -95,6 +94,7 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetEtiquetas(AID, withRefCliente); AStream := FDataModule.GetEtiquetas(AID, withRefCliente);
@ -103,13 +103,16 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
LoadFromStream(AStream); try
Print; LoadFromStream(AStream);
Release; Print;
finally
Release;
AEditor := Nil;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
@ -145,29 +148,25 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetRptAlbaranes(AListaID);
try try
AStream := FDataModule.GetRptAlbaranes(AListaID); CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor); begin
if Assigned(AEditor) then try
begin AEditor.Controller := Self;
try AEditor.ListaID := AListaID;
AEditor.Controller := Self; AEditor.Title := 'Albarán - ' + AppFactuGES.EmpresaActiva.NOMBRE;
AEditor.ListaID := AListaID; AEditor.LoadFromStream(AStream);
AEditor.Title := 'Albarán - ' + AppFactuGES.EmpresaActiva.NOMBRE; AEditor.Preview;
AEditor.LoadFromStream(AStream); finally
AEditor.Preview; AEditor.Release;
finally AEditor := Nil;
AEditor.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
end; end;
end; end;
@ -177,6 +176,7 @@ var
AEditor : IEditorAlbaranesClientePreview; AEditor : IEditorAlbaranesClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetRptAlbaranes(AListaID); AStream := FDataModule.GetRptAlbaranes(AListaID);
@ -192,11 +192,11 @@ begin
AEditor.Print; AEditor.Print;
finally finally
AEditor.Release; AEditor.Release;
AEditor := Nil;
end; end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -27,24 +27,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -616,18 +616,18 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then RecuperarObjetos(AAlbaran);
CreateEditor('EditorAlbaranProveedor', IEditorAlbaranProveedor, AEditor)
else
CreateEditor('EditorAlbaranDevProveedor', IEditorAlbaranDevProveedor, AEditor);
if Assigned(AEditor) then if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
with (AEditor as IEditorAlbaranProveedor) do CreateEditor('EditorAlbaranProveedor', IEditorAlbaranProveedor, AEditor)
begin else
CreateEditor('EditorAlbaranDevProveedor', IEditorAlbaranDevProveedor, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranProveedor) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran; Albaran := AAlbaran;
@ -643,12 +643,9 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
AEditor.Release; AEditor.Release;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -657,21 +654,20 @@ var
AEditor : IEditorDireccionEntregaAlbaranProveedor; AEditor : IEditorDireccionEntregaAlbaranProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try //RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta CreateEditor('EditorDireccionEntregaAlbaranProveedor', IEditorDireccionEntregaAlbaranProveedor, AEditor);
CreateEditor('EditorDireccionEntregaAlbaranProveedor', IEditorDireccionEntregaAlbaranProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with (AEditor as IEditorDireccionEntregaAlbaranProveedor) do
with (AEditor as IEditorDireccionEntregaAlbaranProveedor) do begin
begin try
Albaran := AAlbaran; Albaran := AAlbaran;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TAlbaranesProveedorController.VerTodosAlbaranes(AAlbarans: IBizAlbaranProveedor); procedure TAlbaranesProveedorController.VerTodosAlbaranes(AAlbarans: IBizAlbaranProveedor);
@ -679,21 +675,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Albaranes := AAlbarans;
Albaranes := AAlbarans; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor); procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor);
@ -701,21 +692,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Albaranes := AAlbarans;
Albaranes := AAlbarans; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor; function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor;
@ -741,24 +727,23 @@ var
AEditor : IEditorElegirAlbaranesProveedor; AEditor : IEditorElegirAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor);
CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; Controller := Self;
Albaranes := AAlbaran; Albaranes := AAlbaran;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := AlbaranesProveedorSeleccionados; Result := AlbaranesProveedorSeleccionados;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TAlbaranesProveedorController.Eliminar(AAlbaran: IBizAlbaranProveedor; AllItems: Boolean = false): Boolean; function TAlbaranesProveedorController.Eliminar(AAlbaran: IBizAlbaranProveedor; AllItems: Boolean = false): Boolean;

View File

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

View File

@ -27,25 +27,24 @@ 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;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -208,22 +208,21 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TAlmacenesController.VerLista(AAlmacenes: IBizAlmacen): IBizAlmacen; function TAlmacenesController.VerLista(AAlmacenes: IBizAlmacen): IBizAlmacen;
@ -232,21 +231,20 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TAlmacenesController.VerTodos(AAlmacenes: IBizAlmacen); procedure TAlmacenesController.VerTodos(AAlmacenes: IBizAlmacen);
@ -254,19 +252,15 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Almacenes := AAlmacenes;
Almacenes := AAlmacenes; ShowEmbedded;
ShowEmbedded; end;
end;
finally
HideHourglassCursor;
end;
end; end;
function TAlmacenesController._Vacio: IBizAlmacen; function TAlmacenesController._Vacio: IBizAlmacen;

View File

@ -395,23 +395,22 @@ var
AEditor : IEditorArticulo; AEditor : IEditorArticulo;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AArticulo);
CreateEditor('EditorArticulo', IEditorArticulo, AEditor); RecuperarObjetos(AArticulo);
if Assigned(AEditor) then
with (AEditor as IEditorArticulo) do CreateEditor('EditorArticulo', IEditorArticulo, AEditor);
begin if Assigned(AEditor) then
Controller := Self; //OJO ORDEN MUY IMPORTANTE with (AEditor as IEditorArticulo) do
Articulo := AArticulo; begin
ShowModal; try
Release; Controller := Self; //OJO ORDEN MUY IMPORTANTE
end; Articulo := AArticulo;
finally ShowModal;
AEditor := NIL; finally
HideHourglassCursor; Release;
end; AEditor := NIL;
end;
end;
end; end;
procedure TArticulosController.VerProveedor(AArticulo: IBizArticulo); procedure TArticulosController.VerProveedor(AArticulo: IBizArticulo);
@ -435,22 +434,17 @@ var
AEditor : IEditorArticulos; AEditor : IEditorArticulos;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AArticulos);
CreateEditor('EditorArticulos', IEditorArticulos, AEditor); RecuperarObjetos(AArticulos);
if Assigned(AEditor) then
with (AEditor as IEditorArticulos) do CreateEditor('EditorArticulos', IEditorArticulos, AEditor);
begin if Assigned(AEditor) then
Controller := Self; //OJO ORDEN MUY IMPORTANTE with (AEditor as IEditorArticulos) do
Articulos := AArticulos; begin
ShowEmbedded; Controller := Self; //OJO ORDEN MUY IMPORTANTE
end; Articulos := AArticulos;
finally ShowEmbedded;
AEditor := Nil; end;
HideHourglassCursor;
end;
end; end;
function TArticulosController._Vacio: IBizArticulo; function TArticulosController._Vacio: IBizArticulo;
@ -476,24 +470,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TArticulosController.ElegirProveedor(AArticulo: IBizArticulo); procedure TArticulosController.ElegirProveedor(AArticulo: IBizArticulo);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -106,20 +106,21 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirClientes', IEditorElegirClientes, AEditor); CreateEditor('EditorElegirClientes', IEditorElegirClientes, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
Contactos := AContactos; try
Controller := Self; Contactos := AContactos;
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; MultiSelect := AMultiSelect;
if IsPositiveResult(ShowModal) then Mensaje := AMensaje;
Result := ContactosSeleccionados; if IsPositiveResult(ShowModal) then
Release; Result := ContactosSeleccionados;
finally
Release;
AEditor := NIL;
end;
end; end;
finally
AEditor := NIL;
end;
end; end;
function TClientesController.Eliminar(ACliente: IBizContacto; AllItems: Boolean): Boolean; function TClientesController.Eliminar(ACliente: IBizContacto; AllItems: Boolean): Boolean;
@ -385,21 +386,20 @@ var
AEditor : IEditorCliente; AEditor : IEditorCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorCliente', IEditorCliente, AEditor);
CreateEditor('EditorCliente', IEditorCliente, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TClientesController.VerTodos(AContactos: IBizContacto); procedure TClientesController.VerTodos(AContactos: IBizContacto);
@ -407,21 +407,16 @@ 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 Contactos := AContactos;
Contactos := AContactos; Controller := Self;
Controller := Self; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

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

View File

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

View File

@ -142,21 +142,20 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TGruposClienteController.Eliminar(AGrupoCliente: IBizGrupoCliente): Boolean; function TGruposClienteController.Eliminar(AGrupoCliente: IBizGrupoCliente): Boolean;

View File

@ -142,21 +142,20 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TGruposProveedorController.Eliminar(AGrupoProveedor: IBizGrupoProveedor): Boolean; function TGruposProveedorController.Eliminar(AGrupoProveedor: IBizGrupoProveedor): Boolean;

View File

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

View File

@ -90,24 +90,23 @@ var
AEditor : IEditorElegirProveedores; AEditor : IEditorElegirProveedores;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor);
CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ContactosSeleccionados; Result := ContactosSeleccionados;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TProveedoresController.Eliminar(AProveedor: IBizContacto; AllItems: Boolean): Boolean; function TProveedoresController.Eliminar(AProveedor: IBizContacto; AllItems: Boolean): Boolean;
@ -326,21 +325,20 @@ var
AEditor : IEditorProveedor; AEditor : IEditorProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorProveedor', IEditorProveedor, AEditor);
CreateEditor('EditorProveedor', IEditorProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TProveedoresController.VerTodos(AContactos: IBizContacto); procedure TProveedoresController.VerTodos(AContactos: IBizContacto);
@ -348,21 +346,16 @@ 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 Contactos := AContactos;
Contactos := AContactos; Controller := Self;
Controller := Self; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -139,20 +139,21 @@ begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirVendedores', IEditorElegirVendedores, AEditor); CreateEditor('EditorElegirVendedores', IEditorElegirVendedores, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
Contactos := AContactos; try
Controller := Self; Contactos := AContactos;
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; MultiSelect := AMultiSelect;
if IsPositiveResult(ShowModal) then Mensaje := AMensaje;
Result := ContactosSeleccionados; if IsPositiveResult(ShowModal) then
Release; Result := ContactosSeleccionados;
finally
Release;
AEditor := NIL;
end;
end; end;
finally
AEditor := NIL;
end;
end; end;
function TVendedoresController.Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean; function TVendedoresController.Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean;
@ -235,21 +236,20 @@ var
AEditor : IEditorVendedor; AEditor : IEditorVendedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorVendedor', IEditorVendedor, AEditor);
CreateEditor('EditorVendedor', IEditorVendedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TVendedoresController.VerTodos(AContactos: IBizContacto); procedure TVendedoresController.VerTodos(AContactos: IBizContacto);
@ -257,21 +257,16 @@ var
AEditor : IEditorVendedores; AEditor : IEditorVendedores;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorVendedores', IEditorVendedores, AEditor);
CreateEditor('EditorVendedores', IEditorVendedores, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin Contactos := AContactos;
Contactos := AContactos; Controller := Self;
Controller := Self; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -27,24 +27,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -682,36 +682,33 @@ var
AEditor : IEditorFacturaCliente; AEditor : IEditorFacturaCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(AFactura);
CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor);
if Assigned(AEditor) then RecuperarCliente(AFactura);
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
//MODO CONSULTAR CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor);
if not EsModificable(AFactura) then if Assigned(AEditor) then
begin with AEditor do
SetDataTableReadOnly(AFactura.DataTable, True); begin
ReadOnly := True; try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
//MODO CONSULTAR
if not EsModificable(AFactura) then
begin
SetDataTableReadOnly(AFactura.DataTable, True);
ReadOnly := True;
end;
ShowModal;
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
finally
Release;
end; end;
end;
ShowModal;
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TFacturasClienteController.VerTodos(AFacturas: IBizFacturaCliente); procedure TFacturasClienteController.VerTodos(AFacturas: IBizFacturaCliente);
@ -719,21 +716,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Facturas := AFacturas;
Facturas := AFacturas; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TFacturasClienteController._Vacio: IBizFacturaCliente; function TFacturasClienteController._Vacio: IBizFacturaCliente;
@ -760,24 +752,24 @@ 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;
function TFacturasClienteController.Eliminar(AFactura: IBizFacturaCliente; AllItems: Boolean = false): Boolean; function TFacturasClienteController.Eliminar(AFactura: IBizFacturaCliente; AllItems: Boolean = false): Boolean;

View File

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

View File

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

View File

@ -688,14 +688,14 @@ var
AEditor : IEditorFacturaProveedor; AEditor : IEditorFacturaProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(AFactura);
CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor);
if Assigned(AEditor) then RecuperarProveedor(AFactura);
with AEditor do
begin CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura; Factura := AFactura;
@ -711,13 +711,11 @@ 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
AEditor.Release; AEditor.Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TFacturasProveedorController.VerTodos(AFacturas: IBizFacturaProveedor); procedure TFacturasProveedorController.VerTodos(AFacturas: IBizFacturaProveedor);
@ -725,19 +723,14 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Facturas := AFacturas;
Facturas := AFacturas; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end; end;
end; end;
@ -766,25 +759,23 @@ function TFacturasProveedorController.ElegirFacturas(AFacturas: IBizFacturaProve
begin begin
Result := NIL; Result := NIL;
{ {
ShowHourglassCursor; CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin 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; finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor; }
end;
}
end; end;
function TFacturasProveedorController.Eliminar(AFactura: IBizFacturaProveedor; AllItems: Boolean = false): Boolean; function TFacturasProveedorController.Eliminar(AFactura: IBizFacturaProveedor; AllItems: Boolean = false): Boolean;

View File

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

View File

@ -152,21 +152,20 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TFamiliasController.Eliminar(AFamilia: IBizFamilia): Boolean; function TFamiliasController.Eliminar(AFamilia: IBizFamilia): Boolean;

View File

@ -199,19 +199,20 @@ var
AEditor : IEditorFormaPago; AEditor : IEditorFormaPago;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorFormaPago', IEditorFormaPago, AEditor);
CreateEditor('EditorFormaPago', IEditorFormaPago, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then begin
with AEditor do with AEditor do
begin begin
FormaPago := AFormaPago; try
ShowModal; FormaPago := AFormaPago;
Release; ShowModal;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end;
end; end;
end; end;
@ -220,20 +221,19 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TFormasPagoController.Eliminar(AFormaPago: IBizFormaPago): Boolean; function TFormasPagoController.Eliminar(AFormaPago: IBizFormaPago): Boolean;

View File

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

View File

@ -27,23 +27,22 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -326,24 +326,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TInventarioController.Eliminar(AInventario: IBizInventario; Todos: Boolean; ApplyUpdates: Boolean): Boolean; function TInventarioController.Eliminar(AInventario: IBizInventario; Todos: Boolean; ApplyUpdates: Boolean): Boolean;
@ -452,25 +451,24 @@ 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;
if Assigned(APedido) then if Assigned(APedido) then
PedidoProveedor := APedido; PedidoProveedor := APedido;
ShowModal; ShowModal;
Result := ResultadoModalOK; Result := ResultadoModalOK;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TInventarioController.VerReservas(AArticulo: IBizInventario); procedure TInventarioController.VerReservas(AArticulo: IBizInventario);
@ -478,23 +476,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
DetalleReservas := FDataModule.GetDetalleReservas; DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo; Articulo := AArticulo;
// MultiSelect := False; // MultiSelect := False;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TInventarioController.VerTodos(AInventario: IBizInventario); procedure TInventarioController.VerTodos(AInventario: IBizInventario);
@ -502,21 +499,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Inventario := AInventario;
Inventario := AInventario; MultiSelect := False;
MultiSelect := False; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TInventarioController._Vacio: IBizInventario; function TInventarioController._Vacio: IBizInventario;

View File

@ -28,25 +28,24 @@ 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;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -240,23 +240,22 @@ var
begin begin
Result := False; Result := False;
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try RecuperarProveedor(APedido);
RecuperarProveedor(APedido); CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor);
CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
PedidoProveedor := APedido; PedidoProveedor := APedido;
ShowModal; ShowModal;
Release; Result := True;
Result := True; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
destructor TPedidosProveedorController.Destroy; destructor TPedidosProveedorController.Destroy;
@ -368,14 +367,14 @@ var
AEditor : IEditorPedidoProveedor; AEditor : IEditorPedidoProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(APedido);
CreateEditor('EditorPedidoProveedor', IEditorPedidoProveedor, AEditor);
if Assigned(AEditor) then RecuperarObjetos(APedido);
with AEditor do CreateEditor('EditorPedidoProveedor', IEditorPedidoProveedor, AEditor);
begin
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Pedido := APedido; Pedido := APedido;
@ -391,13 +390,11 @@ 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);
finally
AEditor.Release; AEditor.Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TPedidosProveedorController.VerTodos(APedidos: IBizPedidoProveedor); procedure TPedidosProveedorController.VerTodos(APedidos: IBizPedidoProveedor);
@ -405,21 +402,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Pedidos := APedidos;
Pedidos := APedidos; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TPedidosProveedorController.VerDireccionEntrega( procedure TPedidosProveedorController.VerDireccionEntrega(
@ -428,21 +420,20 @@ var
AEditor : IEditorDireccionEntregaPedidoProveedor; AEditor : IEditorDireccionEntregaPedidoProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try //RecuperarObjetos(APedido); <- No descomentar. No hace falta
//RecuperarObjetos(APedido); <- No descomentar. No hace falta CreateEditor('EditorDireccionEntregaPedidoProveedor', IEditorDireccionEntregaPedidoProveedor, AEditor);
CreateEditor('EditorDireccionEntregaPedidoProveedor', IEditorDireccionEntregaPedidoProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with (AEditor as IEditorDireccionEntregaPedidoProveedor) do
with (AEditor as IEditorDireccionEntregaPedidoProveedor) do begin
begin try
Pedido := APedido; Pedido := APedido;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TPedidosProveedorController._Vacio: IBizPedidoProveedor; function TPedidosProveedorController._Vacio: IBizPedidoProveedor;
@ -468,24 +459,23 @@ var
AEditor : IEditorElegirPedidosProveedor; AEditor : IEditorElegirPedidosProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try CreateEditor('EditorElegirPedidosProveedor', IEditorElegirPedidosProveedor, AEditor);
CreateEditor('EditorElegirPedidosProveedor', IEditorElegirPedidosProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; Controller := Self;
Pedidos := APedido; Pedidos := APedido;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := PedidosProveedorSeleccionados; Result := PedidosProveedorSeleccionados;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TPedidosProveedorController.Eliminar(APedido: IBizPedidoProveedor; AllItems: Boolean = false): Boolean; function TPedidosProveedorController.Eliminar(APedido: IBizPedidoProveedor; AllItems: Boolean = false): Boolean;

View File

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

View File

@ -27,24 +27,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -355,14 +355,14 @@ var
AEditor : IEditorPresupuestoCliente; AEditor : IEditorPresupuestoCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(APresupuesto);
CreateEditor('EditorPresupuestoCliente', IEditorPresupuestoCliente, AEditor);
if Assigned(AEditor) then RecuperarObjetos(APresupuesto);
with AEditor do CreateEditor('EditorPresupuestoCliente', IEditorPresupuestoCliente, AEditor);
begin
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Presupuesto := APresupuesto; Presupuesto := APresupuesto;
@ -378,13 +378,11 @@ 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);
finally
AEditor.Release; AEditor.Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TPresupuestosClienteController.VerDireccionEntrega( procedure TPresupuestosClienteController.VerDireccionEntrega(
@ -394,22 +392,20 @@ var
begin begin
{ {
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(APresupuesto); <- No descomentar. No hace falta //RecuperarObjetos(APresupuesto); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaPresupuestoCliente', IEditorDireccionEntregaPresupuestoCliente, AEditor); CreateEditor('EditorDireccionEntregaPresupuestoCliente', IEditorDireccionEntregaPresupuestoCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaPresupuestoCliente) do with (AEditor as IEditorDireccionEntregaPresupuestoCliente) do
begin begin
Presupuesto := APresupuesto; try
ShowModal; Presupuesto := APresupuesto;
Release; ShowModal;
finally
Release;
AEditor := NIL;
end;
end; end;
finally }
AEditor := NIL;
HideHourglassCursor;
end;
}
end; end;
procedure TPresupuestosClienteController.VerTodos(APresupuestos: IBizPresupuestoCliente); procedure TPresupuestosClienteController.VerTodos(APresupuestos: IBizPresupuestoCliente);
@ -417,21 +413,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Presupuestos := APresupuestos;
Presupuestos := APresupuestos; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente; function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente;
@ -457,24 +448,23 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TPresupuestosClienteController.Eliminar(APresupuesto: IBizPresupuestoCliente; AllItems: Boolean = false): Boolean; function TPresupuestosClienteController.Eliminar(APresupuesto: IBizPresupuestoCliente; AllItems: Boolean = false): Boolean;

View File

@ -86,29 +86,24 @@ var
AEditor : IEditorPresupuestosClientePreview; AEditor : IEditorPresupuestosClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; AStream := FDataModule.GetRptPresupuestos(AListaID);
try try
AStream := FDataModule.GetRptPresupuestos(AListaID); CreateEditor('EditorPresupuestosClientePreview', IEditorPresupuestosClientePreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorPresupuestosClientePreview', IEditorPresupuestosClientePreview, AEditor); begin
if Assigned(AEditor) then try
begin AEditor.Controller := Self;
try AEditor.ListaID := AListaID;
AEditor.Controller := Self; AEditor.Title := 'Presupuesto - ' + AppFactuGES.EmpresaActiva.NOMBRE;
AEditor.ListaID := AListaID; AEditor.LoadFromStream(AStream);
AEditor.Title := 'Presupuesto - ' + AppFactuGES.EmpresaActiva.NOMBRE; AEditor.Preview;
AEditor.LoadFromStream(AStream); finally
AEditor.Preview; AEditor.Release;
finally AEditor := Nil;
AEditor.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
end; end;
end; end;
@ -133,11 +128,11 @@ begin
AEditor.Print; AEditor.Print;
finally finally
AEditor.Release; AEditor.Release;
AEditor := Nil;
end; end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -553,22 +553,21 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TRecibosClienteController.VerTodos(ARecibosCliente: IBizRecibosCliente); procedure TRecibosClienteController.VerTodos(ARecibosCliente: IBizRecibosCliente);
@ -576,21 +575,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE RecibosCliente := ARecibosCliente;
RecibosCliente := ARecibosCliente; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TRecibosClienteController.ElegirRecibos(ARecibos: IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente; function TRecibosClienteController.ElegirRecibos(ARecibos: IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente;
@ -598,21 +592,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
Controller := Self; try
RecibosCliente := ARecibos; Controller := Self;
MultiSelect := AMultiSelect; RecibosCliente := ARecibos;
Mensaje := AMensaje; MultiSelect := AMultiSelect;
if IsPositiveResult(ShowModal) then Mensaje := AMensaje;
Result := RecibosClienteSeleccionados; if IsPositiveResult(ShowModal) then
Release; Result := RecibosClienteSeleccionados;
finally
Release;
AEditor := NIL;
end;
end; end;
finally
AEditor := NIL;
end;
end; end;
function TRecibosClienteController.ElegirRecibosCompensados(ARecibo: IBizRecibosCliente): Boolean; function TRecibosClienteController.ElegirRecibosCompensados(ARecibo: IBizRecibosCliente): Boolean;

View File

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

View File

@ -546,22 +546,21 @@ var
AEditor : IEditorReciboProveedor; AEditor : IEditorReciboProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try RecuperarProveedor(ARecibosProveedor);
RecuperarProveedor(ARecibosProveedor); CreateEditor('EditorReciboProveedor', IEditorReciboProveedor, AEditor);
CreateEditor('EditorReciboProveedor', IEditorReciboProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Recibo := ARecibosProveedor; Recibo := ARecibosProveedor;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TRecibosProveedorController.VerTodos(ARecibosProveedor: IBizRecibosProveedor); procedure TRecibosProveedorController.VerTodos(ARecibosProveedor: IBizRecibosProveedor);
@ -569,21 +568,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE RecibosProveedor := ARecibosProveedor;
RecibosProveedor := ARecibosProveedor; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TRecibosProveedorController.ElegirRecibos(ARecibos: IBizRecibosProveedor; AMensaje: String; function TRecibosProveedorController.ElegirRecibos(ARecibos: IBizRecibosProveedor; AMensaje: String;
@ -592,22 +586,23 @@ 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
Controller := Self; try
RecibosProveedor := ARecibos; Controller := Self;
MultiSelect := AMultiSelect; RecibosProveedor := ARecibos;
Mensaje := AMensaje; MultiSelect := AMultiSelect;
if IsPositiveResult(ShowModal) then Mensaje := AMensaje;
Result := RecibosProveedorSeleccionados; if IsPositiveResult(ShowModal) then
Release; Result := RecibosProveedorSeleccionados;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
end; end;
end;
end; end;
function TRecibosProveedorController.ElegirRecibosCompensados(ARecibo: IBizRecibosProveedor): Boolean; function TRecibosProveedorController.ElegirRecibosCompensados(ARecibo: IBizRecibosProveedor): Boolean;

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRecibosProveedorPreview; AEditor : IEditorRecibosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(ID);
try try
AStream := FDataModule.GetReport(ID); CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor);
if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
LoadFromStream(AStream); try
Preview; LoadFromStream(AStream);
Release; Preview;
finally
Release;
AEditor := Nil;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
end; end;
end; end;
@ -92,15 +91,18 @@ begin
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
LoadFromStream(AStream); try
Print; LoadFromStream(AStream);
Release; Print;
end; finally
Release;
AEditor := NIL;
end;
end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

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

View File

@ -222,14 +222,14 @@ var
AEditor : IEditorRemesaCliente; AEditor : IEditorRemesaCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(ARemesaCliente);
CreateEditor('EditorRemesaCliente', IEditorRemesaCliente, AEditor); RecuperarObjetos(ARemesaCliente);
if Assigned(AEditor) then
with (AEditor as IEditorRemesaCliente) do CreateEditor('EditorRemesaCliente', IEditorRemesaCliente, AEditor);
begin if Assigned(AEditor) then
with (AEditor as IEditorRemesaCliente) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaCliente := ARemesaCliente; RemesaCliente := ARemesaCliente;
@ -245,13 +245,11 @@ 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);
finally
AEditor.Release; AEditor.Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TRemesasClienteController.VerTodos(ARemesasCliente: IBizRemesaCliente); procedure TRemesasClienteController.VerTodos(ARemesasCliente: IBizRemesaCliente);
@ -259,21 +257,16 @@ 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 Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE RemesasCliente := ARemesasCliente;
RemesasCliente := ARemesasCliente; MultiSelect := True;
MultiSelect := True; ShowEmbedded;
ShowEmbedded; end;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TRemesasClienteController._Vacio: IBizRemesaCliente; function TRemesasClienteController._Vacio: IBizRemesaCliente;

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRemesasClientePreview; AEditor : IEditorRemesasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(ID);
try try
AStream := FDataModule.GetReport(ID); CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
end; end;
end; end;
@ -86,21 +85,25 @@ var
AEditor : IEditorRemesasClientePreview; AEditor : IEditorRemesasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try 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
LoadFromStream(AStream); try
Print; LoadFromStream(AStream);
Release; Print;
finally
Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

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

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRemesasProveedorPreview; AEditor : IEditorRemesasProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(ID);
try try
AStream := FDataModule.GetReport(ID); CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := NIL;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
end; end;
end; end;
@ -89,19 +88,22 @@ begin
ShowHourglassCursor; ShowHourglassCursor;
try 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
LoadFromStream(AStream); try
Print; LoadFromStream(AStream);
Release; Print;
finally
Release;
AEditor := NIL;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
Release;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -234,20 +234,18 @@ var
AEditor : IEditorTipoIVA; AEditor : IEditorTipoIVA;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorTipoIVA', IEditorTipoIVA, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorTipoIVA', IEditorTipoIVA, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin TipoIVA := ATipoIVA;
TipoIVA := ATipoIVA; ShowModal;
ShowModal; finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor;
end;
end; end;
procedure TTiposIVAController.VerTodos(ATiposIVA: IBizTipoIVA); procedure TTiposIVAController.VerTodos(ATiposIVA: IBizTipoIVA);
@ -255,20 +253,19 @@ 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; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TTiposIVAController.Eliminar(ATipoIVA: IBizTipoIVA): Boolean; function TTiposIVAController.Eliminar(ATipoIVA: IBizTipoIVA): Boolean;
@ -283,7 +280,6 @@ begin
ATipoIVA.Delete; ATipoIVA.Delete;
ATipoIVA.DataTable.ApplyUpdates; ATipoIVA.DataTable.ApplyUpdates;
HideHourglassCursor;
Result := True; Result := True;
finally finally
HideHourglassCursor; HideHourglassCursor;

View File

@ -138,20 +138,19 @@ var
AEditor : IEditorTiposVenta; AEditor : IEditorTiposVenta;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorTiposVenta', IEditorTiposVenta, AEditor);
CreateEditor('EditorTiposVenta', IEditorTiposVenta, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
TiposVenta := ATiposVenta; TiposVenta := ATiposVenta;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
{ {
procedure TTiposVentaController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); procedure TTiposVentaController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable);

View File

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