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

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

View File

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

View File

@ -271,20 +271,18 @@ 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;
@ -300,9 +298,13 @@ begin
if Assigned(AEditor) then
with AEditor do
begin
try
Contactos := AContactos;
Controller := Self;
ShowEmbedded;
ShowModal;
finally
Release;
end;
end;
finally
AEditor := NIL;

View File

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

View File

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

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

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

View File

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

@ -656,8 +656,7 @@ var
AEditor : IEditorDBItem;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarObjetos(AAlbaran);
if (AAlbaran.TIPO = CTE_TIPO_ALBARAN) then
@ -668,6 +667,7 @@ begin
if Assigned(AEditor) then
with (AEditor as IEditorAlbaranProveedor) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Albaran := AAlbaran;
@ -683,10 +683,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AAlbaran.DataTable, False);
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -695,19 +695,18 @@ 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;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -718,12 +717,11 @@ var
AEditor : IEditorAlbaranesProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesProveedor', IEditorAlbaranesProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
@ -737,10 +735,11 @@ begin
ShowModal
else
ShowEmbedded;
end;
finally
if AVerModal then
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -751,12 +750,11 @@ var
AEditor : IEditorAlbaranesDevProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlbaranesDevProveedor', IEditorAlbaranesDevProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
@ -770,10 +768,11 @@ begin
ShowModal
else
ShowEmbedded;
end;
finally
if AVerModal then
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -800,22 +799,21 @@ 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;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

@ -27,12 +27,11 @@ 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 +39,10 @@ begin
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -218,21 +218,19 @@ 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;
@ -242,20 +240,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;
@ -264,18 +261,18 @@ var
AEditor : IEditorAlmacenes;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorAlmacenes', IEditorAlmacenes, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Almacenes := AAlmacenes;
ShowEmbedded;
end;
finally
HideHourglassCursor;
AEditor := NIL;
end;
end;
end;

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

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

View File

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

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

View File

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

View File

@ -152,20 +152,19 @@ var
AEditor : IEditorFabricantes;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFabricantes', IEditorFabricantes, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Fabricantes := AFabricantes;
ShowModal;
Release;
end;
finally
Release;
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

@ -606,14 +606,14 @@ var
AEditor : IEditorFacturaCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarCliente(AFactura);
CreateEditor('EditorFacturaCliente', IEditorFacturaCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
@ -629,12 +629,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -645,12 +643,12 @@ var
AEditor : IEditorFacturasCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFacturasCliente', IEditorFacturasCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
@ -664,10 +662,11 @@ begin
ShowModal
else
ShowEmbedded;
end;
finally
if AVerModal then
Release;
AEditor := Nil;
HideHourglassCursor;
end;
end;
end;
@ -695,23 +694,22 @@ 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

@ -115,27 +115,26 @@ var
AEditor : IEditorFacturasClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptFacturas(AListaID);
try
CreateEditor('EditorFacturasClientePreview', IEditorFacturasClientePreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
AEditor.Controller := Self;
ListaID := AListaID;
LoadFromStream(AStream);
Preview;
finally
Release;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end;
end;
procedure TFacturasClienteReportController.Print(const AListaID : TIntegerList);
@ -152,11 +151,14 @@ begin
if Assigned(AEditor) then
with AEditor do
begin
try
AEditor.Controller := Self;
LoadFromStream(AStream);
Print;
finally
Release;
end;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;

View File

@ -28,12 +28,12 @@ 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 +41,10 @@ begin
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -463,14 +463,14 @@ var
AEditor : IEditorFacturaProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
RecuperarProveedor(AFactura);
CreateEditor('EditorFacturaProveedor', IEditorFacturaProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
Factura := AFactura;
@ -486,10 +486,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(AFactura.DataTable, False);
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -500,11 +500,11 @@ var
AEditor : IEditorFacturasProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorFacturasProveedor', IEditorFacturasProveedor, AEditor);
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
@ -518,10 +518,11 @@ begin
ShowModal
else
ShowEmbedded;
end;
finally
if AVerModal then
Release;
AEditor := Nil;
HideHourglassCursor;
end;
end;
end;
@ -550,22 +551,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;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
}
end;

View File

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

View File

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

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

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

View File

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

@ -406,23 +406,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;
@ -532,12 +531,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;
@ -545,11 +544,10 @@ begin
PedidoProveedor := APedido;
ShowModal;
Result := ResultadoModalOK;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -558,23 +556,22 @@ 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
TipoReservas := ATipoReservas;
DetalleReservas := FDataModule.GetDetalleReservas;
Articulo := AArticulo;
MultiSelect := True;
ShowModal;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -583,21 +580,20 @@ var
AEditor : IEditorInventario;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorInventario', IEditorInventario, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
TipoInventario := pTipoInventario;
Inventario := AInventario;
MultiSelect := False;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

@ -29,12 +29,11 @@ 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;
@ -42,11 +41,10 @@ begin
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := ArticulosSeleccionados;
Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

@ -342,21 +342,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;
Result := True;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -473,14 +473,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;
@ -496,10 +496,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(APedido.DataTable, False);
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -510,12 +510,12 @@ var
AEditor : IEditorPedidosProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPedidosProveedor', IEditorPedidosProveedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
@ -529,10 +529,11 @@ begin
ShowModal
else
ShowEmbedded;
end;
finally
if AVerModal then
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -542,19 +543,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;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -581,22 +582,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;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;

View File

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

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

@ -472,14 +472,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;
@ -495,12 +495,10 @@ begin
//MODO CONSULTAR (Se deja la tabla como estaba)
if ReadOnly then
SetDataTableReadOnly(APresupuesto.DataTable, False);
AEditor.Release;
end;
finally
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -511,20 +509,18 @@ procedure TPresupuestosClienteController.VerDireccionEntrega(
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;
@ -536,12 +532,11 @@ var
AEditor : IEditorPresupuestosCliente;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorPresupuestosCliente', IEditorPresupuestosCliente, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
if not EsCadenaVacia(AWindowCaption) then
AEditor.WindowCaption := AWindowCaption;
@ -555,10 +550,11 @@ begin
ShowModal
else
ShowEmbedded;
end;
finally
if AVerModal then
Release;
AEditor := NIL;
HideHourglassCursor;
end;
end;
end;
@ -585,23 +581,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

@ -44,6 +44,7 @@ uses
constructor TPresupuestosClienteReportController.Create;
begin
inherited;
FDataModule := TDataModulePresupuestosCliente.Create(Nil);
end;
@ -138,8 +139,7 @@ var
AEditor : IEditorPresupuestosClientePreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetRptPresupuestos(AListaID);
try
CreateEditor('EditorPresupuestosClientePreview', IEditorPresupuestosClientePreview, AEditor);
@ -159,9 +159,6 @@ begin
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end;
end;
procedure TPresupuestosClienteReportController.Print(const AListaID : TIntegerList);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -218,14 +218,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
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesaProveedor := ARemesaProveedor;
@ -241,12 +240,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;
@ -255,20 +252,18 @@ var
AEditor : IEditorRemesasProveedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorRemesasProveedor', IEditorRemesasProveedor, AEditor);
if Assigned(AEditor) then
with (AEditor as IEditorRemesasProveedor) do
begin
try
Controller := Self; //OJO ORDEN MUY IMPORTANTE
RemesasProveedor := ARemesasProveedor;
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := Nil;
HideHourglassCursor;
end;
end;
end;

View File

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

View File

@ -212,19 +212,16 @@ var
AEditor : IEditorTipoIVA;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorTipoIVA', IEditorTipoIVA, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
try
TipoIVA := ATipoIVA;
ShowModal;
finally
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
@ -233,19 +230,17 @@ 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;

View File

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