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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -547,40 +547,37 @@ var
AEditor : IEditorDBItem;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
CreateEditor('EditorAlbaranCliente', IEditorAlbaranCliente, AEditor)
else
CreateEditor('EditorAlbaranDevCliente', IEditorAlbaranDevCliente, AEditor);
RecuperarObjetos(AAlbaran);
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
CreateEditor('EditorAlbaranCliente', IEditorAlbaranCliente, AEditor)
else
CreateEditor('EditorAlbaranDevCliente', IEditorAlbaranDevCliente, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
//MODO CONSULTAR
if not EsModificable(AAlbaran) then
begin
SetDataTableReadOnly(AAlbaran.DataTable, True);
ReadOnly := True;
SetDataTableReadOnly(AAlbaran.DataTable, True);
ReadOnly := True;
end;
ShowModal;
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False);
AEditor.Release;
SetDataTableReadOnly(AAlbaran.DataTable, False);
finally
AEditor.Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
procedure TAlbaranesClienteController.VerDireccionEntrega(
@ -589,21 +586,18 @@ var
AEditor : IEditorDireccionEntregaAlbaranCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaAlbaranCliente', IEditorDireccionEntregaAlbaranCliente, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaAlbaranCliente) do
begin
Albaran := AAlbaran;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
//RecuperarObjetos(AAlbaran); <- No descomentar. No hace falta
CreateEditor('EditorDireccionEntregaAlbaranCliente', IEditorDireccionEntregaAlbaranCliente, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorDireccionEntregaAlbaranCliente) do
try
Albaran := AAlbaran;
ShowModal;
finally
Release;
AEditor := NIL;
end;
end;
procedure TAlbaranesClienteController.VerTodosAlbaranes(AAlbarans: IBizAlbaranCliente);
@ -611,21 +605,16 @@ var
AEditor : IEditorAlbaranesCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaranes := AAlbarans;
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaranes := AAlbarans;
MultiSelect := True;
ShowEmbedded;
end;
end;
procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente);
@ -633,21 +622,16 @@ var
AEditor : IEditorAlbaranesDevCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaranes := AAlbarans;
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaranes := AAlbarans;
MultiSelect := True;
ShowEmbedded;
end;
end;
function TAlbaranesClienteController._Vacio: IBizAlbaranCliente;
@ -673,24 +657,23 @@ var
AEditor : IEditorElegirAlbaranesCliente;
begin
Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self;
Albaranes := AAlbaran;
MultiSelect := AMultiSelect;
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := AlbaranesClienteSeleccionados;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self;
Albaranes := AAlbaran;
MultiSelect := AMultiSelect;
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := AlbaranesClienteSeleccionados;
finally
Release;
AEditor := NIL;
end;
end;
end;
function TAlbaranesClienteController.Eliminar(AAlbaran: IBizAlbaranCliente; AllItems: Boolean = false): Boolean;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -326,24 +326,23 @@ var
AEditor : IEditorElegirArticulosAlmacen;
begin
Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorElegirArticulosAlmacen', IEditorElegirArticulosAlmacen, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self;
Inventario := AArticulos;
MultiSelect := AMultiSelect;
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
CreateEditor('EditorElegirArticulosAlmacen', IEditorElegirArticulosAlmacen, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self;
Inventario := AArticulos;
MultiSelect := AMultiSelect;
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
finally
Release;
AEditor := NIL;
end;
end;
end;
function TInventarioController.Eliminar(AInventario: IBizInventario; Todos: Boolean; ApplyUpdates: Boolean): Boolean;
@ -452,25 +451,24 @@ var
begin
Result := False;
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEntradaSalidaArticulos', IEditorEntradaSalidaArticulos, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Articulos := AArticulos;
Inventario := AInventario;
if Assigned(APedido) then
PedidoProveedor := APedido;
ShowModal;
Result := ResultadoModalOK;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
CreateEditor('EditorEntradaSalidaArticulos', IEditorEntradaSalidaArticulos, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Articulos := AArticulos;
Inventario := AInventario;
if Assigned(APedido) then
PedidoProveedor := APedido;
ShowModal;
Result := ResultadoModalOK;
finally
Release;
AEditor := NIL;
end;
end;
end;
procedure TInventarioController.VerReservas(AArticulo: IBizInventario);
@ -478,23 +476,22 @@ var
AEditor : IEditorDetalleReservas;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorDetalleReservas', IEditorDetalleReservas, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
// Controller := Self; //OJO ORDEN MUY IMPORTANTE
DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo;
// MultiSelect := False;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
CreateEditor('EditorDetalleReservas', IEditorDetalleReservas, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
// Controller := Self; //OJO ORDEN MUY IMPORTANTE
DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo;
// MultiSelect := False;
ShowModal;
finally
Release;
AEditor := NIL;
end;
end;
end;
procedure TInventarioController.VerTodos(AInventario: IBizInventario);
@ -502,21 +499,16 @@ var
AEditor : IEditorInventario;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorInventario', IEditorInventario, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Inventario := AInventario;
MultiSelect := False;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
CreateEditor('EditorInventario', IEditorInventario, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Inventario := AInventario;
MultiSelect := False;
ShowEmbedded;
end;
end;
function TInventarioController._Vacio: IBizInventario;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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