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

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

View File

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

View File

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

View File

@ -262,20 +262,19 @@ var
AEditor : IEditorEmpresa;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpresa', IEditorEmpresa, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Empresa := AEmpresa;
Controller := Self;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -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,20 +79,19 @@ var
AEditor : IEditorTiendaEmpresa;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorTiendaEmpresa', IEditorTiendaEmpresa, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Tienda := ATienda;
Controller := Self;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -781,20 +781,19 @@ 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
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
PerfilUsuario := APerfil;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -804,11 +803,10 @@ 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
@ -817,11 +815,6 @@ begin
PerfilesUsuario := APerfilesUsuario;
ShowEmbedded;
end;
finally
AEditor := NIL;
APerfilesUsuario := NIL;
HideHourglassCursor;
end;
end;
end;
@ -841,20 +834,19 @@ 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
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Usuario := AUser;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -867,8 +859,6 @@ begin
if Assigned(FUsuarios) then
begin
FUsuarios.Active := True;
ShowHourglassCursor;
try
CreateEditor('EditorUsuarios', IEditorUsuarios, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorUsuarios) do
@ -877,11 +867,6 @@ begin
Usuarios := FUsuarios;
ShowEmbedded;
end;
finally
AEditor := NIL;
FUsuarios := NIL;
HideHourglassCursor;
end;
end;
end;
@ -896,19 +881,18 @@ var
begin
Result := False;
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorLogin', IEditorLogin, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self;
Result := (AEditor.ShowModal = mrOk);
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -547,8 +547,7 @@ var
AEditor : IEditorDBItem;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
@ -559,6 +558,7 @@ begin
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranCliente) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
@ -574,12 +574,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;
@ -589,20 +586,17 @@ 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
try
Albaran := AAlbaran;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
@ -611,8 +605,7 @@ var
AEditor : IEditorAlbaranesCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesCliente', IEditorAlbaranesCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -622,10 +615,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
procedure TAlbaranesClienteController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranCliente);
@ -633,8 +622,7 @@ var
AEditor : IEditorAlbaranesDevCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesDevCliente', IEditorAlbaranesDevCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -644,10 +632,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
function TAlbaranesClienteController._Vacio: IBizAlbaranCliente;
@ -673,23 +657,22 @@ var
AEditor : IEditorElegirAlbaranesCliente;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -68,24 +68,23 @@ var
AEditor : IEditorAlbaranesClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetEtiquetas(AID, withRefCliente);
try
CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
LoadFromStream(AStream);
Preview;
finally
Release;
AEditor := NIL;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
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
try
LoadFromStream(AStream);
Print;
finally
Release;
AEditor := Nil;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
@ -145,8 +148,7 @@ var
AEditor : IEditorAlbaranesClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptAlbaranes(AListaID);
try
CreateEditor('EditorAlbaranesClientePreview', IEditorAlbaranesClientePreview, AEditor);
@ -160,14 +162,11 @@ begin
AEditor.Preview;
finally
AEditor.Release;
AEditor := Nil;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
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,23 +27,22 @@ var
AEditor : IEditorElegirArticulosAlbaranesCliente;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -616,8 +616,7 @@ var
AEditor : IEditorDBItem;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
@ -628,6 +627,7 @@ begin
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,20 +654,19 @@ 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
try
Albaran := AAlbaran;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -679,8 +675,7 @@ var
AEditor : IEditorAlbaranesProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesProveedor', IEditorAlbaranesProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -690,10 +685,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
procedure TAlbaranesProveedorController.VerTodosAlbaranesDev(AAlbarans: IBizAlbaranProveedor);
@ -701,8 +692,7 @@ var
AEditor : IEditorAlbaranesDevProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesDevProveedor', IEditorAlbaranesDevProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -712,10 +702,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
function TAlbaranesProveedorController._Vacio: IBizAlbaranProveedor;
@ -741,23 +727,22 @@ var
AEditor : IEditorElegirAlbaranesProveedor;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

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

View File

@ -208,21 +208,20 @@ var
AEditor : IEditorDBItem;
begin
AEditor := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -232,20 +231,19 @@ var
begin
AEditor := NIL;
Result := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorListaAlmacenes', IEditorListaAlmacenes, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Almacenes := AAlmacenes;
if IsPositiveResult(ShowModal) then
Result := AlmacenSeleccionado;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -254,8 +252,7 @@ var
AEditor : IEditorAlmacenes;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlmacenes', IEditorAlmacenes, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -264,9 +261,6 @@ begin
Almacenes := AAlmacenes;
ShowEmbedded;
end;
finally
HideHourglassCursor;
end;
end;
function TAlmacenesController._Vacio: IBizAlmacen;

View File

@ -395,22 +395,21 @@ var
AEditor : IEditorArticulo;
begin
AEditor := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -435,8 +434,7 @@ var
AEditor : IEditorArticulos;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AArticulos);
CreateEditor('EditorArticulos', IEditorArticulos, AEditor);
@ -447,10 +445,6 @@ begin
Articulos := AArticulos;
ShowEmbedded;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end;
function TArticulosController._Vacio: IBizArticulo;
@ -476,23 +470,22 @@ var
AEditor : IEditorElegirArticulos;
begin
Result := NIL;
ShowHourglassCursor;
try
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
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

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

View File

@ -60,24 +60,23 @@ var
AEditor : IEditorComisionesPreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AComisionID);
try
CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
LoadFromStream(AStream);
Preview;
finally
Release;
AEditor := NIL;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
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
try
LoadFromStream(AStream);
Print;
finally
Release;
AEditor := NIL;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;

View File

@ -275,20 +275,19 @@ var
AEditor : IEditorApunte;
begin
AEditor := NIL;
ShowHourglassCursor;
try
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
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -298,8 +297,7 @@ var
AEditor : IEditorApuntes;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorApuntes', IEditorApuntes, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -308,10 +306,6 @@ begin
Apuntes := AApuntes;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -27,23 +27,22 @@ var
AEditor : IEditorElegirArticulosFacturasCliente;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -120,22 +120,21 @@ var
begin
Result := False;
AEditor := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;}
@ -144,8 +143,7 @@ var
AEditor : IEditorHistoricoMovimientos;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorHistoricoMovimientos', IEditorHistoricoMovimientos, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -155,10 +153,6 @@ begin
MultiSelect := False;
ShowEmbedded;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end;
function THistoricoMovimientosController._Vacio: IBizHistoricoMovimientos;

View File

@ -27,22 +27,21 @@ var
AEditor : IEditorElegirArticulosCatalogo;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

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

View File

@ -240,22 +240,21 @@ var
begin
Result := False;
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(APedido);
CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
PedidoProveedor := APedido;
ShowModal;
Release;
Result := True;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -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
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Pedido := APedido;
@ -391,12 +390,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(APedido.DataTable, False);
AEditor.Release;
end;
finally
AEditor.Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -405,8 +402,7 @@ var
AEditor : IEditorPedidosProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPedidosProveedor', IEditorPedidosProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -416,10 +412,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
procedure TPedidosProveedorController.VerDireccionEntrega(
@ -428,20 +420,19 @@ 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
try
Pedido := APedido;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -468,23 +459,22 @@ var
AEditor : IEditorElegirPedidosProveedor;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

@ -27,23 +27,22 @@ var
AEditor : IEditorElegirArticulosPresupuestosCliente;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
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
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Presupuesto := APresupuesto;
@ -378,12 +378,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(APresupuesto.DataTable, False);
AEditor.Release;
end;
finally
AEditor.Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -394,20 +392,18 @@ 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
try
Presupuesto := APresupuesto;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
}
end;
@ -417,8 +413,7 @@ var
AEditor : IEditorPresupuestosCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPresupuestosCliente', IEditorPresupuestosCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -428,10 +423,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
function TPresupuestosClienteController._Vacio: IBizPresupuestoCliente;
@ -457,23 +448,22 @@ var
AEditor : IEditorElegirPresupuestosCliente;
begin
Result := NIL;
ShowHourglassCursor;
try
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;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -86,8 +86,6 @@ var
AEditor : IEditorPresupuestosClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptPresupuestos(AListaID);
try
CreateEditor('EditorPresupuestosClientePreview', IEditorPresupuestosClientePreview, AEditor);
@ -101,14 +99,11 @@ begin
AEditor.Preview;
finally
AEditor.Release;
AEditor := Nil;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
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,21 +553,20 @@ var
AEditor : IEditorReciboCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(ARecibosCliente);
CreateEditor('EditorReciboCliente', IEditorReciboCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Recibo := ARecibosCliente;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -576,8 +575,7 @@ var
AEditor : IEditorRecibosCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRecibosCliente', IEditorRecibosCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
@ -587,10 +585,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
function TRecibosClienteController.ElegirRecibos(ARecibos: IBizRecibosCliente; AMensaje: String; AMultiSelect: Boolean): IBizRecibosCliente;
@ -598,22 +592,24 @@ var
AEditor : IEditorElegirRecibosCliente;
begin
Result := NIL;
CreateEditor('EditorElegirRecibosCliente', IEditorElegirRecibosCliente, AEditor);
try
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self;
RecibosCliente := ARecibos;
MultiSelect := AMultiSelect;
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := RecibosClienteSeleccionados;
Release;
end;
finally
Release;
AEditor := NIL;
end;
end;
end;
function TRecibosClienteController.ElegirRecibosCompensados(ARecibo: IBizRecibosCliente): Boolean;
var

View File

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

View File

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

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRecibosProveedorPreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID);
try
CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
LoadFromStream(AStream);
Preview;
finally
Release;
AEditor := Nil;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end;
end;
@ -94,13 +93,16 @@ begin
if Assigned(AEditor) then
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
try
Referencias := AReferencias;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
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
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaCliente := ARemesaCliente;
@ -245,12 +245,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(ARemesaCliente.DataTable, False);
AEditor.Release;
end;
finally
AEditor.Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -259,8 +257,7 @@ var
AEditor : IEditorRemesasCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRemesasCliente', IEditorRemesasCliente, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorRemesasCliente) do
@ -270,10 +267,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end;
function TRemesasClienteController._Vacio: IBizRemesaCliente;

View File

@ -59,24 +59,23 @@ var
AEditor : IEditorRemesasClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID);
try
CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
LoadFromStream(AStream);
Preview;
finally
Release;
AEditor := NIL;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end;
end;
@ -86,6 +85,7 @@ var
AEditor : IEditorRemesasClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(ID);
@ -94,13 +94,16 @@ begin
if Assigned(AEditor) then
with AEditor do
begin
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);
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);
AEditor.Release;
end;
finally
AEditor.Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -259,8 +256,7 @@ var
AEditor : IEditorRemesasProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRemesasProveedor', IEditorRemesasProveedor, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorRemesasProveedor) do
@ -270,10 +266,6 @@ begin
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end;
function TRemesasProveedorController._Vacio: IBizRemesaProveedor;

View File

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

View File

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

View File

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

View File

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