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

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@752 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2008-11-11 16:22:18 +00:00
parent cebe5ab708
commit 7e5074bca1
55 changed files with 1618 additions and 1736 deletions

View File

@ -47,20 +47,20 @@ var
AEditor : IEditorDatosBancariosEmpresa; AEditor : IEditorDatosBancariosEmpresa;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorDatosBancariosEmpresa', IEditorDatosBancariosEmpresa, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorDatosBancariosEmpresa', IEditorDatosBancariosEmpresa, AEditor); begin
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
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -271,21 +271,19 @@ var
AEditor : IEditorEmpresa; AEditor : IEditorEmpresa;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpresa', IEditorEmpresa, AEditor); CreateEditor('EditorEmpresa', IEditorEmpresa, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
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);
@ -300,9 +298,13 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
Contactos := AContactos; try
Controller := Self; Contactos := AContactos;
ShowEmbedded; Controller := Self;
ShowModal;
finally
Release;
end;
end; end;
finally finally
AEditor := NIL; AEditor := NIL;

View File

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

View File

@ -758,20 +758,20 @@ begin
raise Exception.Create('Perfil no asignado (VerPerfil)'); raise Exception.Create('Perfil no asignado (VerPerfil)');
APerfil.Active := True; APerfil.Active := True;
ShowHourglassCursor; CreateEditor('EditorPerfilUsuario', IEditorPerfilUsuario, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorPerfilUsuario', IEditorPerfilUsuario, AEditor); begin
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; end;
@ -783,21 +783,23 @@ begin
APerfilesUsuario := FDataModule.GetPerfiles; APerfilesUsuario := FDataModule.GetPerfiles;
if Assigned(APerfilesUsuario) then if Assigned(APerfilesUsuario) then
begin begin
APerfilesUsuario.Active := True;
ShowHourglassCursor;
try try
APerfilesUsuario.Active := True;
CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor); CreateEditor('EditorPerfilesUsuario', IEditorPerfilesUsuario, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorPerfilesUsuario) do with (AEditor as IEditorPerfilesUsuario) do
begin begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE try
PerfilesUsuario := APerfilesUsuario; Controller := Self; //OJO ORDEN MUY IMPORTANTE
ShowEmbedded; PerfilesUsuario := APerfilesUsuario;
end; ShowModal;
finally
Release;
AEditor := NIL;
end;
end;
finally finally
AEditor := NIL;
APerfilesUsuario := NIL; APerfilesUsuario := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;
@ -818,21 +820,19 @@ begin
raise Exception.Create('Usuario no asignado (VerUsuario)'); raise Exception.Create('Usuario no asignado (VerUsuario)');
AUser.Active := True; AUser.Active := True;
ShowHourglassCursor; CreateEditor('EditorUsuario', IEditorUsuario, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorUsuario', IEditorUsuario, AEditor); with (AEditor as IEditorUsuario) do
if Assigned(AEditor) then begin
with (AEditor as IEditorUsuario) do try
begin
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;
@ -844,20 +844,22 @@ begin
if Assigned(FUsuarios) then if Assigned(FUsuarios) then
begin begin
FUsuarios.Active := True; FUsuarios.Active := True;
ShowHourglassCursor;
try try
CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor); CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorUsuarios) do with (AEditor as IEditorUsuarios) do
begin begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE try
Usuarios := FUsuarios; Controller := Self; //OJO ORDEN MUY IMPORTANTE
ShowEmbedded; Usuarios := FUsuarios;
ShowModal;
finally
Release;
AEditor := NIL;
end;
end; end;
finally finally
AEditor := NIL;
FUsuarios := NIL; FUsuarios := NIL;
HideHourglassCursor;
end; end;
end; end;
end; end;
@ -873,20 +875,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
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TUsuariosController.FiltrarEmpresa(AUsuario: IBizUsuario); procedure TUsuariosController.FiltrarEmpresa(AUsuario: IBizUsuario);

View File

@ -575,22 +575,21 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; RecuperarObjetos(AAlbaran);
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
CreateEditor('EditorAlbaranCliente', IEditorAlbaranCliente, AEditor) CreateEditor('EditorAlbaranCliente', IEditorAlbaranCliente, AEditor)
else else
CreateEditor('EditorAlbaranDevCliente', IEditorAlbaranDevCliente, AEditor); CreateEditor('EditorAlbaranDevCliente', IEditorAlbaranDevCliente, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do
begin
try
//MODO CONSULTAR //MODO CONSULTAR
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
if not EsModificable(AAlbaran) then if not EsModificable(AAlbaran) then
begin begin
SetDataTableReadOnly(AAlbaran.DataTable, True); SetDataTableReadOnly(AAlbaran.DataTable, True);
@ -602,13 +601,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(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
AEditor.Release; Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesClienteController.VerDireccionEntrega( procedure TAlbaranesClienteController.VerDireccionEntrega(
@ -617,21 +614,20 @@ var
AEditor : IEditorDireccionEntregaAlbaranCliente; AEditor : IEditorDireccionEntregaAlbaranCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try //RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta CreateEditor('EditorDireccionEntregaAlbaranCliente', IEditorDireccionEntregaAlbaranCliente, AEditor);
CreateEditor('EditorDireccionEntregaAlbaranCliente', IEditorDireccionEntregaAlbaranCliente, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with (AEditor as IEditorDireccionEntregaAlbaranCliente) do
with (AEditor as IEditorDireccionEntregaAlbaranCliente) do begin
begin try
Albaran := AAlbaran; Albaran := AAlbaran;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TAlbaranesClienteController.VerTodosAlbaranes(AAlbarans: IBizAlbaranCliente; procedure TAlbaranesClienteController.VerTodosAlbaranes(AAlbarans: IBizAlbaranCliente;
@ -641,12 +637,11 @@ var
AEditor : IEditorAlbaranesCliente; AEditor : IEditorAlbaranesCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -661,11 +656,12 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
end; finally
finally if AVerModal then
AEditor := NIL; Release;
HideHourglassCursor; AEditor := NIL;
end; end;
end;
end; end;
procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente; procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente;
@ -675,12 +671,11 @@ var
AEditor : IEditorAlbaranesDevCliente; AEditor : IEditorAlbaranesDevCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -690,15 +685,17 @@ begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaranes := AAlbarans; Albaranes := AAlbarans;
MultiSelect := True; MultiSelect := True;
if AVerModal then
ShowModal if AVerModal then
else ShowModal
ShowEmbedded; else
ShowEmbedded;
finally
if AVerModal then
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAlbaranesClienteController._Vacio: IBizAlbaranCliente; function TAlbaranesClienteController._Vacio: IBizAlbaranCliente;
@ -724,24 +721,22 @@ var
AEditor : IEditorElegirAlbaranesCliente; AEditor : IEditorElegirAlbaranesCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor; CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
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;
finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor;
end;
end; end;
function TAlbaranesClienteController.Eliminar(AAlbaran: IBizAlbaranCliente; AllItems: Boolean = false): Boolean; function TAlbaranesClienteController.Eliminar(AAlbaran: IBizAlbaranCliente; AllItems: Boolean = false): Boolean;

View File

@ -70,24 +70,22 @@ 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);
if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
LoadFromStream(AStream); try
Preview; LoadFromStream(AStream);
Release; Preview;
finally
Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;
@ -97,24 +95,22 @@ 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);
if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
LoadFromStream(AStream); try
Print; LoadFromStream(AStream);
Release; Print;
finally
Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;
@ -172,29 +168,24 @@ 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.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;

View File

@ -27,24 +27,22 @@ var
AEditor : IEditorElegirArticulosAlbaranesCliente; AEditor : IEditorElegirArticulosAlbaranesCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor; CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin 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; finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -656,18 +656,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;
@ -683,10 +683,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba) //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False); SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
Release;
AEditor := NIL;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
@ -695,20 +695,19 @@ var
AEditor : IEditorDireccionEntregaAlbaranProveedor; AEditor : IEditorDireccionEntregaAlbaranProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; //RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
try CreateEditor('EditorDireccionEntregaAlbaranProveedor', IEditorDireccionEntregaAlbaranProveedor, AEditor);
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta if Assigned(AEditor) then
CreateEditor('EditorDireccionEntregaAlbaranProveedor', IEditorDireccionEntregaAlbaranProveedor, AEditor); with (AEditor as IEditorDireccionEntregaAlbaranProveedor) do
if Assigned(AEditor) then begin
with (AEditor as IEditorDireccionEntregaAlbaranProveedor) do try
begin Albaran := AAlbaran;
Albaran := AAlbaran; ShowModal;
ShowModal; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TAlbaranesProveedorController.VerTodosAlbaranes(AAlbarans: IBizAlbaranProveedor; procedure TAlbaranesProveedorController.VerTodosAlbaranes(AAlbarans: IBizAlbaranProveedor;
@ -718,12 +717,11 @@ var
AEditor : IEditorAlbaranesProveedor; AEditor : IEditorAlbaranesProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorAlbaranesProveedor', IEditorAlbaranesProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorAlbaranesProveedor', IEditorAlbaranesProveedor, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -737,11 +735,12 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
finally
if AVerModal then
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor; procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor;
@ -751,12 +750,11 @@ var
AEditor : IEditorAlbaranesDevProveedor; AEditor : IEditorAlbaranesDevProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorAlbaranesDevProveedor', IEditorAlbaranesDevProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorAlbaranesDevProveedor', IEditorAlbaranesDevProveedor, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -770,11 +768,12 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
finally
if AVerModal then
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor; function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor;
@ -800,23 +799,22 @@ var
AEditor : IEditorElegirAlbaranesProveedor; AEditor : IEditorElegirAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor; CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
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;
finally
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
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,22 @@ 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;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;
@ -95,9 +93,12 @@ 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;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

@ -27,12 +27,11 @@ var
AEditor : IEditorElegirArticulosAlbaranesProveedor; AEditor : IEditorElegirArticulosAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor; CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, 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;
@ -40,12 +39,11 @@ begin
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados; Result := ArticulosSeleccionados;
Release; finally
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
end. end.

View File

@ -218,22 +218,20 @@ var
AEditor : IEditorDBItem; AEditor : IEditorDBItem;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; RecuperarObjetos(AAlmacen);
try CreateEditor('EditorAlmacen', IEditorAlmacen, AEditor);
RecuperarObjetos(AAlmacen); if Assigned(AEditor) then
CreateEditor('EditorAlmacen', IEditorAlmacen, AEditor); with (AEditor as IEditorAlmacen) do
if Assigned(AEditor) then begin
with (AEditor as IEditorAlmacen) do try
begin Controller := Self; //OJO ORDEN MUY IMPORTANTE
Controller := Self; //OJO ORDEN MUY IMPORTANTE Almacen := AAlmacen;
Almacen := AAlmacen; ShowModal;
ShowModal; finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor;
end;
end; end;
function TAlmacenesController.VerLista(AAlmacenes: IBizAlmacen): IBizAlmacen; function TAlmacenesController.VerLista(AAlmacenes: IBizAlmacen): IBizAlmacen;
@ -242,21 +240,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);
@ -264,19 +261,19 @@ var
AEditor : IEditorAlmacenes; AEditor : IEditorAlmacenes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorAlmacenes', IEditorAlmacenes, AEditor);
CreateEditor('EditorAlmacenes', IEditorAlmacenes, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Almacenes := AAlmacenes; Almacenes := AAlmacenes;
ShowEmbedded; ShowEmbedded;
end; finally
finally AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
function TAlmacenesController._Vacio: IBizAlmacen; function TAlmacenesController._Vacio: IBizAlmacen;

View File

@ -441,23 +441,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);
@ -483,19 +482,18 @@ var
AEditor : IEditorArticulos; AEditor : IEditorArticulos;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorArticulos', IEditorArticulos, AEditor);
CreateEditor('EditorArticulos', IEditorArticulos, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with (AEditor as IEditorArticulos) do
with (AEditor as IEditorArticulos) do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
ShowEmbedded; ShowEmbedded;
end; finally
finally AEditor := Nil;
AEditor := Nil; end;
HideHourglassCursor; end;
end;
end; end;
function TArticulosController._Vacio: IBizArticulo; function TArticulosController._Vacio: IBizArticulo;
@ -522,24 +520,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,29 @@ 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;
end;
end;
end; end;

View File

@ -126,6 +126,7 @@ begin
if IsPositiveResult(AEditor.ShowModal) then if IsPositiveResult(AEditor.ShowModal) then
Result := AEditor.ContactosSeleccionados; Result := AEditor.ContactosSeleccionados;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
Application.ProcessMessages; Application.ProcessMessages;
end; end;
@ -148,6 +149,7 @@ begin
if IsPositiveResult(AEditor.ShowModal) then if IsPositiveResult(AEditor.ShowModal) then
Result := AEditor.DireccionSeleccionada; Result := AEditor.DireccionSeleccionada;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
Application.ProcessMessages; Application.ProcessMessages;
end; end;
@ -170,6 +172,7 @@ begin
if IsPositiveResult(AEditor.ShowModal) then if IsPositiveResult(AEditor.ShowModal) then
Result := AEditor.PersonaSeleccionada; Result := AEditor.PersonaSeleccionada;
finally finally
Release;
AEditor := NIL; AEditor := NIL;
Application.ProcessMessages; Application.ProcessMessages;
end; end;
@ -385,20 +388,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;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
procedure TClientesController.VerAlbaranesDeCliente(ACliente: IBizCliente); procedure TClientesController.VerAlbaranesDeCliente(ACliente: IBizCliente);
@ -490,21 +493,20 @@ var
AEditor : IEditorClientes; AEditor : IEditorClientes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorClientes', IEditorClientes, AEditor);
CreateEditor('EditorClientes', IEditorClientes, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; finally
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

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

View File

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

@ -266,21 +266,20 @@ var
AEditor : IEditorEmpleado; AEditor : IEditorEmpleado;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorEmpleado', IEditorEmpleado, AEditor);
CreateEditor('EditorEmpleado', IEditorEmpleado, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contacto := AContacto; Contacto := AContacto;
Controller := Self; Controller := Self;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TEmpleadosController.VerTodos(AContactos: IBizContacto); procedure TEmpleadosController.VerTodos(AContactos: IBizContacto);
@ -288,21 +287,20 @@ var
AEditor : IEditorEmpleados; AEditor : IEditorEmpleados;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorEmpleados', IEditorEmpleados, AEditor);
CreateEditor('EditorEmpleados', IEditorEmpleados, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; finally
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -58,28 +58,24 @@ var
AEditor : IEditorEtiquetasContactosPreview; AEditor : IEditorEtiquetasContactosPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(ListaID);
try try
AStream := FDataModule.GetReport(ListaID); CreateEditor('EditorEtiquetasContactosPreview', IEditorEtiquetasContactosPreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorEtiquetasContactosPreview', IEditorEtiquetasContactosPreview, AEditor); begin
if Assigned(AEditor) then try
begin AEditor.Controller := Self;
try AEditor.ListaID := ListaID;
AEditor.Controller := Self; AEditor.LoadFromStream(AStream);
AEditor.ListaID := ListaID; AEditor.Preview;
AEditor.LoadFromStream(AStream); finally
AEditor.Preview; AEditor.Release;
finally
AEditor.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;

View File

@ -58,28 +58,24 @@ var
AEditor : IEditorFichasEmpleadoPreview; AEditor : IEditorFichasEmpleadoPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(ListaID);
try try
AStream := FDataModule.GetReport(ListaID); CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor); begin
if Assigned(AEditor) then try
begin AEditor.Controller := Self;
try AEditor.ListaID := ListaID;
AEditor.Controller := Self; AEditor.LoadFromStream(AStream);
AEditor.ListaID := ListaID; AEditor.Preview;
AEditor.LoadFromStream(AStream); finally
AEditor.Preview; AEditor.Release;
finally
AEditor.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;

View File

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

@ -140,21 +140,20 @@ var
AEditor : IEditorGruposEmpleado; AEditor : IEditorGruposEmpleado;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorGruposEmpleado', IEditorGruposEmpleado, AEditor);
CreateEditor('EditorGruposEmpleado', IEditorGruposEmpleado, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
GruposEmpleado := AGruposEmpleado; GruposEmpleado := AGruposEmpleado;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TGruposEmpleadoController.Eliminar(AGrupoEmpleado: IBizGrupoEmpleado): Boolean; function TGruposEmpleadoController.Eliminar(AGrupoEmpleado: IBizGrupoEmpleado): Boolean;

View File

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

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

View File

@ -121,23 +121,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;
finally
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TProveedoresController.ElegirDireccionEntrega(AProveedor: IBizProveedor; function TProveedoresController.ElegirDireccionEntrega(AProveedor: IBizProveedor;
@ -146,21 +146,21 @@ var
AEditor : IEditorElegirDireccionEntrega; AEditor : IEditorElegirDireccionEntrega;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor);
CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contacto := AProveedor; Contacto := AProveedor;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := DireccionSeleccionada; Result := DireccionSeleccionada;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
function TProveedoresController.Eliminar(AProveedor: IBizContacto; AllItems: Boolean): Boolean; function TProveedoresController.Eliminar(AProveedor: IBizContacto; AllItems: Boolean): Boolean;
@ -312,20 +312,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;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
procedure TProveedoresController.VerAlbaranesDeProveedor( procedure TProveedoresController.VerAlbaranesDeProveedor(
@ -443,21 +443,20 @@ var
AEditor : IEditorProveedores; AEditor : IEditorProveedores;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorProveedores', IEditorProveedores, AEditor);
CreateEditor('EditorProveedores', IEditorProveedores, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Contactos := AContactos; Contactos := AContactos;
Controller := Self; Controller := Self;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
end; finally
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
end. end.

View File

@ -152,21 +152,20 @@ var
AEditor : IEditorFabricantes; AEditor : IEditorFabricantes;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorFabricantes', IEditorFabricantes, AEditor);
CreateEditor('EditorFabricantes', IEditorFabricantes, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Fabricantes := AFabricantes; Fabricantes := AFabricantes;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TFabricantesController.Eliminar(AFabricante: IBizFabricante): Boolean; function TFabricantesController.Eliminar(AFabricante: IBizFabricante): Boolean;

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

@ -606,36 +606,34 @@ 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 CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor);
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
//MODO CONSULTAR if Assigned(AEditor) then
if not EsModificable(AFactura) then with AEditor do
begin begin
SetDataTableReadOnly(AFactura.DataTable, True); try
ReadOnly := True; 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;
AEditor := NIL;
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;
@ -645,12 +643,12 @@ var
AEditor : IEditorFacturasCliente; AEditor : IEditorFacturasCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor);
CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -664,11 +662,12 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
finally
if AVerModal then
Release;
AEditor := Nil;
end; end;
finally end;
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TFacturasClienteController._Vacio: IBizFacturaCliente; function TFacturasClienteController._Vacio: IBizFacturaCliente;
@ -695,24 +694,23 @@ var
AEditor : IEditorElegirFacturasCliente; AEditor : IEditorElegirFacturasCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor);
CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; Controller := Self;
Facturas := AFacturas; Facturas := AFacturas;
MultiSelect := AMultiSelect; MultiSelect := AMultiSelect;
Mensaje := AMensaje; Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then if IsPositiveResult(ShowModal) then
Result := FacturasClienteSeleccionados; Result := FacturasClienteSeleccionados;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TFacturasClienteController.Eliminar(AFactura: IBizFacturaCliente; AllItems: Boolean = false): Boolean; function TFacturasClienteController.Eliminar(AFactura: IBizFacturaCliente; AllItems: Boolean = false): Boolean;

View File

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

View File

@ -28,25 +28,24 @@ var
AEditor : IEditorElegirArticulosFacturasProveedor; AEditor : IEditorElegirArticulosFacturasProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
try CreateEditor('EditorElegirArticulosFacturaProveedor', IEditorElegirArticulosFacturasProveedor, AEditor);
CreateEditor('EditorElegirArticulosFacturaProveedor', IEditorElegirArticulosFacturasProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; Controller := Self;
Articulos := AArticulos; Articulos := AArticulos;
Proveedor := AProveedor; Proveedor := AProveedor;
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

@ -463,34 +463,34 @@ 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 CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor);
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
//MODO CONSULTAR if Assigned(AEditor) then
if not EsModificable(AFactura) then with AEditor do
begin begin
SetDataTableReadOnly(AFactura.DataTable, True); try
ReadOnly := True; Controller := Self; //OJO ORDEN MUY IMPORTANTE
end; Factura := AFactura;
ShowModal; //MODO CONSULTAR
if not EsModificable(AFactura) then
begin
SetDataTableReadOnly(AFactura.DataTable, True);
ReadOnly := True;
end;
//MODO CONSULTAR (Se deja la tabla como estaba) ShowModal;
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False); //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
finally
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TFacturasProveedorController.VerTodos(AFacturas: IBizFacturaProveedor; procedure TFacturasProveedorController.VerTodos(AFacturas: IBizFacturaProveedor;
@ -500,28 +500,29 @@ var
AEditor : IEditorFacturasProveedor; AEditor : IEditorFacturasProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFacturasProveedor', IEditorFacturasProveedor, AEditor);
with AEditor do
begin
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
if not EsCadenaVacia(AHeaderText) then CreateEditor('EditorFacturasProveedor', IEditorFacturasProveedor, AEditor);
AEditor.HeaderText := AHeaderText; with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
Controller := Self; //OJO ORDEN MUY IMPORTANTE if not EsCadenaVacia(AHeaderText) then
Facturas := AFacturas; AEditor.HeaderText := AHeaderText;
MultiSelect := True;
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Facturas := AFacturas;
MultiSelect := True;
if AVerModal then
ShowModal
else
ShowEmbedded;
finally
if AVerModal then if AVerModal then
ShowModal Release;
else AEditor := Nil;
ShowEmbedded;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end; end;
end; end;
@ -550,23 +551,22 @@ function TFacturasProveedorController.ElegirFacturas(AFacturas: IBizFacturaProve
begin begin
Result := NIL; Result := NIL;
{ {
ShowHourglassCursor;
try
CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor); CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
Controller := Self; try
Facturas := AFacturas; Controller := Self;
MultiSelect := AMultiSelect; Facturas := AFacturas;
Mensaje := AMensaje; MultiSelect := AMultiSelect;
if IsPositiveResult(ShowModal) then Mensaje := AMensaje;
Result := FacturasProveedoreSeleccionados; if IsPositiveResult(ShowModal) then
Result := FacturasProveedoreSeleccionados;
finally
Release;
AEditor := NIL;
end;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
} }
end; end;

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; end;
finally end;
FreeAndNil(AStream);
AEditor := Nil;
end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;
@ -95,9 +94,12 @@ 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;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

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

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

@ -281,27 +281,22 @@ var
AEditor : IEditorInformeIVAClientesReport; AEditor : IEditorInformeIVAClientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorInformeIVAClientesReport', IEditorInformeIVAClientesReport, AEditor);
try if Assigned(AEditor) then
try with AEditor do
CreateEditor('EditorInformeIVAClientesReport', IEditorInformeIVAClientesReport, AEditor); begin
if Assigned(AEditor) then try
with AEditor do
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de IVA de facturas de cliente'; AEditor.Title := 'Listado de IVA de facturas de cliente';
AStream := FDataModule.GenerarInformeIVAClientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeIVAClientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeIVAProveedores; procedure TGestorInformesController.VerInformeIVAProveedores;
@ -310,27 +305,23 @@ var
AEditor : IEditorInformeIVAProveedoresReport; AEditor : IEditorInformeIVAProveedoresReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformeIVAProveedoresReport', IEditorInformeIVAProveedoresReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformeIVAProveedoresReport', IEditorInformeIVAProveedoresReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de IVA de facturas de proveedor'; AEditor.Title := 'Listado de IVA de facturas de proveedor';
AStream := FDataModule.GenerarInformeIVAProveedores(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeIVAProveedores(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoFacturasCli; procedure TGestorInformesController.VerInformeListadoFacturasCli;
@ -339,27 +330,23 @@ var
AEditor : IEditorInformeFacturasClienteReport; AEditor : IEditorInformeFacturasClienteReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformeFacturasClienteReport', IEditorInformeFacturasClienteReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformeFacturasClienteReport', IEditorInformeFacturasClienteReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de cliente'; AEditor.Title := 'Listado de facturas de cliente';
AStream := FDataModule.GenerarInformeListadoFacturasCli(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasCli(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoFacturasCliPendientes; procedure TGestorInformesController.VerInformeListadoFacturasCliPendientes;
@ -368,27 +355,23 @@ var
AEditor : IEditorInformeFacturasClientePendientesReport; AEditor : IEditorInformeFacturasClientePendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformeFacturasClientePendientesReport', IEditorInformeFacturasClientePendientesReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformeFacturasClientePendientesReport', IEditorInformeFacturasClientePendientesReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de cliente pendientes'; AEditor.Title := 'Listado de facturas de cliente pendientes';
AStream := FDataModule.GenerarInformeListadoFacturasCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoFacturasProv; procedure TGestorInformesController.VerInformeListadoFacturasProv;
@ -397,27 +380,22 @@ var
AEditor : IEditorInformeFacturasProveedorReport; AEditor : IEditorInformeFacturasProveedorReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorInformeFacturasProveedorReport', IEditorInformeFacturasProveedorReport, AEditor);
try if Assigned(AEditor) then
try with AEditor do
CreateEditor('EditorInformeFacturasProveedorReport', IEditorInformeFacturasProveedorReport, AEditor); begin
if Assigned(AEditor) then try
with AEditor do
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de proveedor'; AEditor.Title := 'Listado de facturas de proveedor';
AStream := FDataModule.GenerarInformeListadoFacturasProv(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasProv(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoFacturasProvPendientes; procedure TGestorInformesController.VerInformeListadoFacturasProvPendientes;
@ -426,27 +404,22 @@ var
AEditor : IEditorInformeFacturasProveedorPendientesReport; AEditor : IEditorInformeFacturasProveedorPendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorInformeFacturasProveedorPendientesReport', IEditorInformeFacturasProveedorPendientesReport, AEditor);
try if Assigned(AEditor) then
try with AEditor do
CreateEditor('EditorInformeFacturasProveedorPendientesReport', IEditorInformeFacturasProveedorPendientesReport, AEditor); begin
if Assigned(AEditor) then try
with AEditor do
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de facturas de proveedor pendientes'; AEditor.Title := 'Listado de facturas de proveedor pendientes';
AStream := FDataModule.GenerarInformeListadoFacturasProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoFacturasProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoPedidos; procedure TGestorInformesController.VerInformeListadoPedidos;
@ -456,26 +429,22 @@ var
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try CreateEditor('EditorInformePedidosReport', IEditorInformePedidosReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformePedidosReport', IEditorInformePedidosReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de pedidos de proveedor'; AEditor.Title := 'Listado de pedidos de proveedor';
AStream := FDataModule.GenerarInformeListadoPedidos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoPedidos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoPresupuestos; procedure TGestorInformesController.VerInformeListadoPresupuestos;
@ -484,27 +453,23 @@ var
AEditor : IEditorInformePresupuestosReport; AEditor : IEditorInformePresupuestosReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformePresupuestosReport', IEditorInformePresupuestosReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformePresupuestosReport', IEditorInformePresupuestosReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AEditor.Title := 'Listado de presupuestos de cliente'; AEditor.Title := 'Listado de presupuestos de cliente';
AStream := FDataModule.GenerarInformeListadoPresupuestos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoPresupuestos(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoRecibosCliente; procedure TGestorInformesController.VerInformeListadoRecibosCliente;
@ -513,26 +478,21 @@ var
AEditor : IEditorInformeRecibosClienteReport; AEditor : IEditorInformeRecibosClienteReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorInformeRecibosClienteReport', IEditorInformeRecibosClienteReport, AEditor);
try if Assigned(AEditor) then
try with AEditor do
CreateEditor('EditorInformeRecibosClienteReport', IEditorInformeRecibosClienteReport, AEditor); begin
if Assigned(AEditor) then try
with AEditor do
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosCliente(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosCliente(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoRecibosCliPendientes; procedure TGestorInformesController.VerInformeListadoRecibosCliPendientes;
@ -541,26 +501,22 @@ var
AEditor : IEditorInformeRecibosCliPendientesReport; AEditor : IEditorInformeRecibosCliPendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformeRecibosCliPendientesReport', IEditorInformeRecibosCliPendientesReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformeRecibosCliPendientesReport', IEditorInformeRecibosCliPendientesReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosCliPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDClientes, DesglosadoCliente, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
@ -570,26 +526,22 @@ var
AEditor : IEditorInformeRecibosProveedorReport; AEditor : IEditorInformeRecibosProveedorReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformeRecibosProveedorReport', IEditorInformeRecibosProveedorReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformeRecibosProveedorReport', IEditorInformeRecibosProveedorReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosProveedor(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosProveedor(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
procedure TGestorInformesController.VerInformeListadoRecibosProvPendientes; procedure TGestorInformesController.VerInformeListadoRecibosProvPendientes;
@ -598,26 +550,22 @@ var
AEditor : IEditorInformeRecibosProvPendientesReport; AEditor : IEditorInformeRecibosProvPendientesReport;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInformeRecibosProvPendientesReport', IEditorInformeRecibosProvPendientesReport, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorInformeRecibosProvPendientesReport', IEditorInformeRecibosProvPendientesReport, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
AEditor.Controller := Self; AEditor.Controller := Self;
AStream := FDataModule.GenerarInformeListadoRecibosProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo); AStream := FDataModule.GenerarInformeListadoRecibosProvPendientes(AppFactuGES.EmpresaActiva.ID, FechaInicio, FechaFin, ListaIDProveedores, DesglosadoProveedor, ImporteMinimo);
LoadFromStream(AStream); LoadFromStream(AStream);
Preview; Preview;
finally
Release; Release;
AEditor := Nil;
FreeAndNil(AStream);
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally
HideHourglassCursor;
end;
end; end;
{ {
@ -634,23 +582,25 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE try
Factura := AFactura; Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
//MODO CONSULTAR //MODO CONSULTAR
if not EsModificable(AFactura) then if not EsModificable(AFactura) then
begin begin
SetDataTableReadOnly(AFactura.DataTable, True); SetDataTableReadOnly(AFactura.DataTable, True);
ReadOnly := True; ReadOnly := True;
end;
ShowModal;
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
finally
Release;
end; end;
ShowModal;
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
Release;
end; end;
finally finally
AEditor := NIL; AEditor := NIL;
@ -664,21 +614,19 @@ var
begin begin
AEditor := NIL; AEditor := NIL;
{ {
ShowHourglassCursor;
try
CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor); CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE try
Facturas := AFacturas; Controller := Self; //OJO ORDEN MUY IMPORTANTE
MultiSelect := True; Facturas := AFacturas;
ShowEmbedded; MultiSelect := True;
ShowEmbedded;
finally
AEditor := Nil;
end;
end; end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end; end;

View File

@ -27,23 +27,21 @@ var
AEditor : IEditorElegirArticulosCatalogo; AEditor : IEditorElegirArticulosCatalogo;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor; CreateEditor('EditorElegirArticulosCatalogo', IEditorElegirArticulosCatalogo, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirArticulosCatalogo', IEditorElegirArticulosCatalogo, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin 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

@ -406,24 +406,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;
@ -532,25 +531,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; const ATipoReservas: String); procedure TInventarioController.VerReservas(AArticulo: IBizInventario; const ATipoReservas: String);
@ -558,24 +556,23 @@ var
AEditor : IEditorDetalleReservas; AEditor : IEditorDetalleReservas;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorDetalleReservas', IEditorDetalleReservas, AEditor);
CreateEditor('EditorDetalleReservas', IEditorDetalleReservas, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
TipoReservas := ATipoReservas; TipoReservas := ATipoReservas;
DetalleReservas := FDataModule.GetDetalleReservas; DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo; Articulo := AArticulo;
MultiSelect := True; MultiSelect := True;
ShowModal; ShowModal;
Release; finally
end; Release;
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
procedure TInventarioController.VerTodos(AInventario: IBizInventario; const pTipoInventario: String); procedure TInventarioController.VerTodos(AInventario: IBizInventario; const pTipoInventario: String);
@ -583,22 +580,21 @@ var
AEditor : IEditorInventario; AEditor : IEditorInventario;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorInventario', IEditorInventario, AEditor);
CreateEditor('EditorInventario', IEditorInventario, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
TipoInventario := pTipoInventario; TipoInventario := pTipoInventario;
Inventario := AInventario; Inventario := AInventario;
MultiSelect := False; MultiSelect := False;
ShowEmbedded; ShowEmbedded;
end; finally
finally AEditor := NIL;
AEditor := NIL; end;
HideHourglassCursor; end;
end;
end; end;
function TInventarioController._Vacio: IBizInventario; function TInventarioController._Vacio: IBizInventario;

View File

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

View File

@ -29,12 +29,11 @@ var
AEditor : IEditorElegirArticulosPedidosProveedor; AEditor : IEditorElegirArticulosPedidosProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor; CreateEditor('EditorElegirArticulosPedidoProveedor', IEditorElegirArticulosPedidosProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorElegirArticulosPedidoProveedor', IEditorElegirArticulosPedidosProveedor, 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;
@ -42,12 +41,11 @@ begin
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

@ -342,22 +342,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;
Result := True; Result := True;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
destructor TPedidosProveedorController.Destroy; destructor TPedidosProveedorController.Destroy;
@ -473,34 +473,34 @@ 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
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Pedido := APedido;
//MODO CONSULTAR if Assigned(AEditor) then
if not EsModificable(APedido) then with AEditor do
begin begin
SetDataTableReadOnly(APedido.DataTable, True); try
ReadOnly := True; Controller := Self; //OJO ORDEN MUY IMPORTANTE
end; Pedido := APedido;
ShowModal; //MODO CONSULTAR
if not EsModificable(APedido) then
begin
SetDataTableReadOnly(APedido.DataTable, True);
ReadOnly := True;
end;
//MODO CONSULTAR (Se deja la tabla como estaba) ShowModal;
if ReadOnly then
SetDataTableReadOnly(APedido.DataTable, False); //MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(APedido.DataTable, False);
finally
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TPedidosProveedorController.VerTodos(APedidos: IBizPedidoProveedor; procedure TPedidosProveedorController.VerTodos(APedidos: IBizPedidoProveedor;
@ -510,30 +510,31 @@ var
AEditor : IEditorPedidosProveedor; AEditor : IEditorPedidosProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPedidosProveedor', IEditorPedidosProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
if not EsCadenaVacia(AHeaderText) then CreateEditor('EditorPedidosProveedor', IEditorPedidosProveedor, AEditor);
AEditor.HeaderText := AHeaderText; if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
Controller := Self; //OJO ORDEN MUY IMPORTANTE if not EsCadenaVacia(AHeaderText) then
Pedidos := APedidos; AEditor.HeaderText := AHeaderText;
MultiSelect := True;
if AVerModal then Controller := Self; //OJO ORDEN MUY IMPORTANTE
ShowModal Pedidos := APedidos;
else MultiSelect := True;
ShowEmbedded; if AVerModal then
end; ShowModal
finally else
AEditor := NIL; ShowEmbedded;
HideHourglassCursor; finally
end; if AVerModal then
Release;
AEditor := NIL;
end;
end;
end; end;
procedure TPedidosProveedorController.VerDireccionEntrega( procedure TPedidosProveedorController.VerDireccionEntrega(
@ -542,20 +543,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;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
function TPedidosProveedorController._Vacio: IBizPedidoProveedor; function TPedidosProveedorController._Vacio: IBizPedidoProveedor;
@ -581,23 +582,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;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
function TPedidosProveedorController.Eliminar(APedido: IBizPedidoProveedor; AllItems: Boolean = false): Boolean; function TPedidosProveedorController.Eliminar(APedido: IBizPedidoProveedor; AllItems: Boolean = false): Boolean;

View File

@ -50,6 +50,7 @@ uses
constructor TPedidosProveedorReportController.Create; constructor TPedidosProveedorReportController.Create;
begin begin
inherited;
FDataModule := TDataModulePedidosProveedor.Create(Nil); FDataModule := TDataModulePedidosProveedor.Create(Nil);
end; end;
@ -124,31 +125,27 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor);
try try
AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor); CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor); begin
if Assigned(AEditor) then try
begin AEditor.Controller := Self;
try AEditor.ListaID := AListaID;
AEditor.Controller := Self; AEditor.VerPrecios := VerPrecios;
AEditor.ListaID := AListaID; AEditor.VerRefProveedor := VerRefProveedor;
AEditor.VerPrecios := VerPrecios; AEditor.Title := 'Pedido a proveedor - ' + AppFactuGES.EmpresaActiva.NOMBRE;
AEditor.VerRefProveedor := VerRefProveedor; AEditor.LoadFromStream(AStream);
AEditor.Title := 'Pedido a proveedor - ' + 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;
@ -159,9 +156,10 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor); AStream := FDataModule.GetReport(AListaID, VerPrecios, VerRefProveedor);
try try
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor); CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then

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

@ -472,14 +472,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;
@ -495,13 +495,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; Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TPresupuestosClienteController.VerDireccionEntrega( procedure TPresupuestosClienteController.VerDireccionEntrega(
@ -511,21 +509,19 @@ procedure TPresupuestosClienteController.VerDireccionEntrega(
begin begin
{ {
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(APresupuesto); <- No descomentar. No hace falta //RecuperarObjetos(APresupuesto); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaPresupuestoCliente', IEditorDireccionEntregaPresupuestoCliente, AEditor); CreateEditor('EditorDireccionEntregaPresupuestoCliente', IEditorDireccionEntregaPresupuestoCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaPresupuestoCliente) do with (AEditor as IEditorDireccionEntregaPresupuestoCliente) do
begin begin
Presupuesto := APresupuesto; try
ShowModal; Presupuesto := APresupuesto;
Release; ShowModal;
finally
Release;
AEditor := NIL;
end;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
} }
end; end;
@ -536,12 +532,11 @@ var
AEditor : IEditorPresupuestosCliente; AEditor : IEditorPresupuestosCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorPresupuestosCliente', IEditorPresupuestosCliente, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorPresupuestosCliente', IEditorPresupuestosCliente, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -555,11 +550,12 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
finally
if AVerModal then
Release;
AEditor := NIL;
end; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente; function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente;
@ -585,24 +581,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

@ -44,6 +44,7 @@ uses
constructor TPresupuestosClienteReportController.Create; constructor TPresupuestosClienteReportController.Create;
begin begin
inherited;
FDataModule := TDataModulePresupuestosCliente.Create(Nil); FDataModule := TDataModulePresupuestosCliente.Create(Nil);
end; end;
@ -138,29 +139,25 @@ 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.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;

View File

@ -184,8 +184,8 @@ begin
try try
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
AEditor.Release;
finally finally
AEditor.Release;
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
@ -552,22 +552,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;
@ -577,12 +576,12 @@ var
AEditor : IEditorRecibosCliente; AEditor : IEditorRecibosCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorRecibosCliente', IEditorRecibosCliente, AEditor);
CreateEditor('EditorRecibosCliente', IEditorRecibosCliente, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
if not EsCadenaVacia(AWindowCaption) then if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption; AEditor.WindowCaption := AWindowCaption;
@ -597,11 +596,12 @@ begin
ShowModal ShowModal
else else
ShowEmbedded; ShowEmbedded;
finally
if AVerModal then
Release;
AEditor := NIL;
end; end;
finally end;
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;
@ -609,21 +609,23 @@ var
AEditor : IEditorElegirRecibosCliente; AEditor : IEditorElegirRecibosCliente;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirRecibosCliente', IEditorElegirRecibosCliente, AEditor); CreateEditor('EditorElegirRecibosCliente', IEditorElegirRecibosCliente, AEditor);
try if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
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;
@ -786,17 +788,21 @@ var
AEditor : IEditorFechaPago; AEditor : IEditorFechaPago;
FechaPago: String; FechaPago: String;
begin begin
try if not Assigned(ARecibosCliente) then
//Pedimos la fecha del pago raise Exception.Create ('Recibos de cliente no asignado (ModificarPago)');
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
if Assigned(AEditor) then
FechaPago:= ''; //Pedimos la fecha del pago
if (AEditor.ShowModal = mrOk) then CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
FechaPago := DateToStr(AEditor.FechaPago); if Assigned(AEditor) then
AEditor.Release; try
finally FechaPago := '';
AEditor := NIL; if (AEditor.ShowModal = mrOk) then
end; FechaPago := DateToStr(AEditor.FechaPago);
finally
AEditor.Release;
AEditor := NIL;
end;
if Length(FechaPago) > 0 then if Length(FechaPago) > 0 then
PagosController.Modificar(ARecibosCliente.Pagos, FechaPago); PagosController.Modificar(ARecibosCliente.Pagos, FechaPago);

View File

@ -59,28 +59,24 @@ var
AEditor : IEditorRecibosClientePreview; AEditor : IEditorRecibosClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
AStream := FDataModule.GetReport(ListaID);
try try
AStream := FDataModule.GetReport(ListaID); CreateEditor('EditorRecibosClientePreview', IEditorRecibosClientePreview, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorRecibosClientePreview', IEditorRecibosClientePreview, AEditor); begin
if Assigned(AEditor) then try
begin AEditor.Controller := Self;
try AEditor.ListaID := ListaID;
AEditor.Controller := Self; AEditor.LoadFromStream(AStream);
AEditor.ListaID := ListaID; AEditor.Preview;
AEditor.LoadFromStream(AStream); finally
AEditor.Preview; AEditor.Release;
finally
AEditor.Release;
end;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;

View File

@ -169,14 +169,15 @@ begin
//Pedimos la fecha del pago //Pedimos la fecha del pago
if (Length(FechaPago) = 0) then if (Length(FechaPago) = 0) then
begin begin
try CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then try
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
finally finally
AEditor := NIL; Release;
end; AEditor := NIL;
end;
end; end;
// Se cancela la operación // Se cancela la operación
@ -528,21 +529,21 @@ var
AEditor : IEditorReciboProveedor; AEditor : IEditorReciboProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try RecuperarCliente(ARecibosProveedor);
RecuperarCliente(ARecibosProveedor); CreateEditor('EditorReciboProveedor', IEditorReciboProveedor, AEditor);
CreateEditor('EditorReciboProveedor', IEditorReciboProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with AEditor do
with AEditor do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
Recibo := ARecibosProveedor; Recibo := ARecibosProveedor;
ShowModal; ShowModal;
end; finally
finally Release;
AEditor := NIL; AEditor := NIL;
HideHourglassCursor; end;
end; end;
end; end;
procedure TRecibosProveedorController.VerTodos(ARecibosProveedor: IBizRecibosProveedor; procedure TRecibosProveedorController.VerTodos(ARecibosProveedor: IBizRecibosProveedor;
@ -552,29 +553,30 @@ var
AEditor : IEditorRecibosProveedor; AEditor : IEditorRecibosProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRecibosProveedor', IEditorRecibosProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
if not EsCadenaVacia(AHeaderText) then CreateEditor('EditorRecibosProveedor', IEditorRecibosProveedor, AEditor);
AEditor.HeaderText := AHeaderText; if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
Controller := Self; if not EsCadenaVacia(AHeaderText) then
RecibosProveedor := ARecibosProveedor; AEditor.HeaderText := AHeaderText;
Controller := Self;
RecibosProveedor := ARecibosProveedor;
if AVerModal then
ShowModal
else
ShowEmbedded;
finally
if AVerModal then if AVerModal then
ShowModal Release;
else AEditor := NIL;
ShowEmbedded; end;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
function TRecibosProveedorController.ElegirRecibos(ARecibos: IBizRecibosProveedor; AMensaje: String; function TRecibosProveedorController.ElegirRecibos(ARecibos: IBizRecibosProveedor; AMensaje: String;
@ -583,21 +585,22 @@ 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
end; Result := RecibosProveedorSeleccionados;
finally finally
AEditor := NIL; Release;
end; end;
end;
end; end;
function TRecibosProveedorController.ElegirRecibosCompensados(ARecibo: IBizRecibosProveedor): Boolean; function TRecibosProveedorController.ElegirRecibosCompensados(ARecibo: IBizRecibosProveedor): Boolean;
@ -758,19 +761,20 @@ var
AEditor : IEditorFechaPagoProveedor; AEditor : IEditorFechaPagoProveedor;
FechaPago: String; FechaPago: String;
begin begin
try //Pedimos la fecha del pago
//Pedimos la fecha del pago CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then try
FechaPago:= ''; FechaPago:= '';
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
finally finally
AEditor := NIL; AEditor.Release;
end; AEditor := NIL;
end;
if Length(FechaPago) > 0 then if Length(FechaPago) > 0 then
PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago); PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago);
end; end;
function TRecibosProveedorController.Nuevo: IBizRecibosProveedor; function TRecibosProveedorController.Nuevo: IBizRecibosProveedor;

View File

@ -58,24 +58,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); 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;
@ -93,9 +92,12 @@ 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;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

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

View File

@ -218,14 +218,13 @@ var
AEditor : IEditorRemesaCliente; AEditor : IEditorRemesaCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; RecuperarObjetos(ARemesaCliente);
try
RecuperarObjetos(ARemesaCliente);
CreateEditor('EditorRemesaCliente', IEditorRemesaCliente, AEditor); CreateEditor('EditorRemesaCliente', IEditorRemesaCliente, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorRemesaCliente) do with (AEditor as IEditorRemesaCliente) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaCliente := ARemesaCliente; RemesaCliente := ARemesaCliente;
@ -241,13 +240,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);
@ -255,21 +252,20 @@ var
AEditor : IEditorRemesasCliente; AEditor : IEditorRemesasCliente;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor;
try CreateEditor('EditorRemesasCliente', IEditorRemesasCliente, AEditor);
CreateEditor('EditorRemesasCliente', IEditorRemesasCliente, AEditor); if Assigned(AEditor) then
if Assigned(AEditor) then with (AEditor as IEditorRemesasCliente) do
with (AEditor as IEditorRemesasCliente) do begin
begin try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesasCliente := ARemesasCliente; RemesasCliente := ARemesasCliente;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
finally
AEditor := NIL;
end; end;
finally end;
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TRemesasClienteController._Vacio: IBizRemesaCliente; function TRemesasClienteController._Vacio: IBizRemesaCliente;

View File

@ -58,24 +58,22 @@ 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;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;
@ -87,15 +85,18 @@ 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;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

@ -218,14 +218,13 @@ var
AEditor : IEditorRemesaProveedor; AEditor : IEditorRemesaProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; RecuperarObjetos(ARemesaProveedor);
try
RecuperarObjetos(ARemesaProveedor);
CreateEditor('EditorRemesaProveedor', IEditorRemesaProveedor, AEditor); CreateEditor('EditorRemesaProveedor', IEditorRemesaProveedor, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
with (AEditor as IEditorRemesaProveedor) do with (AEditor as IEditorRemesaProveedor) do
begin begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaProveedor := ARemesaProveedor; RemesaProveedor := ARemesaProveedor;
@ -241,13 +240,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(ARemesaProveedor.DataTable, False); SetDataTableReadOnly(ARemesaProveedor.DataTable, False);
finally
AEditor.Release; AEditor.Release;
AEditor := NIL;
end;
end; end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TRemesasProveedorController.VerTodos(ARemesasProveedor: IBizRemesaProveedor); procedure TRemesasProveedorController.VerTodos(ARemesasProveedor: IBizRemesaProveedor);
@ -255,21 +252,19 @@ var
AEditor : IEditorRemesasProveedor; AEditor : IEditorRemesasProveedor;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorRemesasProveedor', IEditorRemesasProveedor, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorRemesasProveedor', IEditorRemesasProveedor, AEditor); with (AEditor as IEditorRemesasProveedor) do
if Assigned(AEditor) then begin
with (AEditor as IEditorRemesasProveedor) do try
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesasProveedor := ARemesasProveedor; RemesasProveedor := ARemesasProveedor;
MultiSelect := True; MultiSelect := True;
ShowEmbedded; ShowEmbedded;
finally
AEditor := Nil;
end; end;
finally end;
AEditor := Nil;
HideHourglassCursor;
end;
end; end;
function TRemesasProveedorController._Vacio: IBizRemesaProveedor; function TRemesasProveedorController._Vacio: IBizRemesaProveedor;

View File

@ -58,24 +58,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;
end; end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; FreeAndNil(AStream);
AEditor := Nil;
end; end;
end; end;
@ -88,15 +87,18 @@ 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;
end;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

@ -212,20 +212,17 @@ 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; end;
finally end;
AEditor := NIL;
HideHourglassCursor;
end;
end; end;
procedure TTiposIVAController.VerTodos(ATiposIVA: IBizTipoIVA); procedure TTiposIVAController.VerTodos(ATiposIVA: IBizTipoIVA);
@ -233,20 +230,18 @@ var
AEditor : IEditorTiposIVA; AEditor : IEditorTiposIVA;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; CreateEditor('EditorTiposIVA', IEditorTiposIVA, AEditor);
try if Assigned(AEditor) then
CreateEditor('EditorTiposIVA', IEditorTiposIVA, AEditor); with AEditor do
if Assigned(AEditor) then begin
with AEditor do try
begin TiposIVA := ATiposIVA;
TiposIVA := ATiposIVA; ShowModal;
ShowModal; finally
Release; Release;
end; AEditor := NIL;
finally end;
AEditor := NIL; end;
HideHourglassCursor;
end;
end; end;
function TTiposIVAController.Eliminar(ATipoIVA: IBizTipoIVA): Boolean; function TTiposIVAController.Eliminar(ATipoIVA: IBizTipoIVA): Boolean;

View File

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