Segundo y ultimo repaso de creación de editores de informes y objetos

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@144 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2007-11-18 20:08:55 +00:00
parent f632f134a3
commit d9295361df
37 changed files with 529 additions and 442 deletions

View File

@ -224,15 +224,25 @@ end;
procedure TEmpresasController.VerTodos(AEmpresas: IBizEmpresa); procedure TEmpresasController.VerTodos(AEmpresas: IBizEmpresa);
{var {var
AEditor : IEditorClientes;} AEditor : IEditorEmpresas;}
begin begin
{ CreateEditor('EditorEmpresas', IEditorClientes, AEditor); {
with AEditor do AEditor := NIL;
begin ShowHourglassCursor;
Contactos := AContactos; try
Controller := Self; CreateEditor('EditorEmpresas', IEditorClientes, AEditor);
ShowEmbedded; if Assigned(AEditor) then
end;} with AEditor do
begin
Contactos := AContactos;
Controller := Self;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
}
end; end;
end. end.

View File

@ -200,21 +200,17 @@ begin
ShowHourglassCursor; ShowHourglassCursor;
try try
CreateEditor('EditorLogin', IEditorLogin, AEditor); CreateEditor('EditorLogin', IEditorLogin, AEditor);
with AEditor do if Assigned(AEditor) then
Controller := Self; with AEditor do
begin
Controller := Self;
Result := (AEditor.ShowModal = mrOk);
Release;
end;
finally finally
AEditor := NIL;
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
begin
try
Result := (AEditor.ShowModal = mrOk);
AEditor.Release;
finally
AEditor := NIL;
end;
end;
end; end;
end. end.

View File

@ -58,14 +58,6 @@
<Excluded_Packages Name="C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPSCoreD10.bpl">ExpressPrinting System by Developer Express Inc.</Excluded_Packages> <Excluded_Packages Name="C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPSCoreD10.bpl">ExpressPrinting System by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\PluginSDK_D10R.bpl">PluginSDK for Delphi 10 (Runtime)</Excluded_Packages> <Excluded_Packages Name="C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\PluginSDK_D10R.bpl">PluginSDK for Delphi 10 (Runtime)</Excluded_Packages>
<Excluded_Packages Name="$(BDS)\bin\dcloffice2k100.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages> <Excluded_Packages Name="$(BDS)\bin\dcloffice2k100.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>

View File

@ -666,21 +666,23 @@ var
AEditor : IEditorElegirAlbaranesCliente; AEditor : IEditorElegirAlbaranesCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor);
try try
with AEditor do CreateEditor('EditorElegirAlbaranesCliente', IEditorElegirAlbaranesCliente, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Albaranes := AAlbaran; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Albaranes := AAlbaran;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := AlbaranesClienteSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := AlbaranesClienteSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -72,9 +72,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Preview; Preview;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
@ -99,9 +99,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Print; Print;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
@ -126,9 +126,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Preview; Preview;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
@ -153,9 +153,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Print; Print;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

@ -3,7 +3,7 @@ unit uArticulosAlbaranClienteController;
interface interface
uses uses
uDADataTable, uArticulosController, uBizArticulos; uDADataTable, cxControls, uArticulosController, uBizArticulos;
type type
IArticulosAlbaranClienteController = interface(IArticulosController) IArticulosAlbaranClienteController = interface(IArticulosController)
@ -27,20 +27,23 @@ var
AEditor : IEditorElegirArticulosAlbaranesCliente; AEditor : IEditorElegirArticulosAlbaranesCliente;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Articulos := AArticulos;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -731,21 +731,23 @@ var
AEditor : IEditorElegirAlbaranesProveedor; AEditor : IEditorElegirAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor);
try try
with AEditor do CreateEditor('EditorElegirAlbaranesProveedor', IEditorElegirAlbaranesProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Albaranes := AAlbaran; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Albaranes := AAlbaran;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := AlbaranesProveedorSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := AlbaranesProveedorSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -59,22 +59,25 @@ var
AEditor : IEditorAlbaranesProveedorPreview; AEditor : IEditorAlbaranesProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
try try
CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TAlbaranesProveedorReportController.Print(const AID : String); procedure TAlbaranesProveedorReportController.Print(const AID : String);
@ -83,22 +86,25 @@ var
AEditor : IEditorAlbaranesProveedorPreview; AEditor : IEditorAlbaranesProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
try try
CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor); CreateEditor('EditorAlbaranesProveedorPreview', IEditorAlbaranesProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

@ -20,28 +20,31 @@ implementation
{ TArticulosAlbaranProveedorController } { TArticulosAlbaranProveedorController }
uses Controls, uIEditorElegirArticulosAlbaranesProveedor, uIEditorElegirArticulos; uses Controls, cxControls, uIEditorElegirArticulosAlbaranesProveedor, uIEditorElegirArticulos;
function TArticulosAlbaranProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; function TArticulosAlbaranProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
var var
AEditor : IEditorElegirArticulosAlbaranesProveedor; AEditor : IEditorElegirArticulosAlbaranesProveedor;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosAlbaranesProveedor', IEditorElegirArticulosAlbaranesProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
Proveedor := AProveedor; Controller := Self;
MultiSelect := AMultiSelect; Articulos := AArticulos;
Mensaje := AMensaje; Proveedor := AProveedor;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -226,7 +226,7 @@ var
begin begin
AEditor := NIL; AEditor := NIL;
Result := NIL; Result := NIL;
ShowHourglassCursor;
try try
CreateEditor('EditorListaAlmacenes', IEditorListaAlmacenes, AEditor); CreateEditor('EditorListaAlmacenes', IEditorListaAlmacenes, AEditor);
if Assigned(AEditor) then if Assigned(AEditor) then
@ -239,6 +239,7 @@ begin
end; end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -436,6 +436,7 @@ begin
ShowEmbedded; ShowEmbedded;
end; end;
finally finally
AEditor := Nil;
HideHourglassCursor; HideHourglassCursor;
end; end;
end; end;
@ -463,20 +464,23 @@ var
AEditor : IEditorElegirArticulos; AEditor : IEditorElegirArticulos;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulos', IEditorElegirArticulos, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulos', IEditorElegirArticulos, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Articulos := AArticulos;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

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

View File

@ -59,23 +59,26 @@ var
AEditor : IEditorComisionesPreview; AEditor : IEditorComisionesPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AComisionID, DesglosadoProv,'', '', Null); AStream := FDataModule.GetReport(AComisionID, DesglosadoProv,'', '', Null);
try try
CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor); CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor);
AEditor.DataModule := FDataModule; if Assigned(AEditor) then
AEditor.LoadFromStream(AStream); with AEditor do
begin
DataModule := FDataModule;
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TComisionesReportController.Print(const AComisionID : Variant; const DesglosadoProv: Boolean); procedure TComisionesReportController.Print(const AComisionID : Variant; const DesglosadoProv: Boolean);
@ -84,23 +87,25 @@ var
AEditor : IEditorComisionesPreview; AEditor : IEditorComisionesPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AComisionID, DesglosadoProv, '', '', Null); AStream := FDataModule.GetReport(AComisionID, DesglosadoProv, '', '', Null);
try try
CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor); CreateEditor('EditorComisionesPreview', IEditorComisionesPreview, AEditor);
AEditor.DataModule := FDataModule; if Assigned(AEditor) then
AEditor.LoadFromStream(AStream); with AEditor do
begin
DataModule := FDataModule;
LoadFromStream(AStream);
Print;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

@ -65,9 +65,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Preview; Preview;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
@ -92,9 +92,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Print; Print;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

@ -57,22 +57,25 @@ var
AEditor : IEditorFichasEmpleadoPreview; AEditor : IEditorFichasEmpleadoPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AFichaID); AStream := FDataModule.GetReport(AFichaID);
try try
CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor); CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TFichasEmpleadoReportController.Print(const AFichaID : String); procedure TFichasEmpleadoReportController.Print(const AFichaID : String);
@ -84,19 +87,23 @@ begin
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AFichaID); AStream := FDataModule.GetReport(AFichaID);
try try
CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor); CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

@ -89,44 +89,47 @@ var
AEditor : IEditorElegirProveedores; AEditor : IEditorElegirProveedores;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor);
try try
with AEditor do CreateEditor('EditorElegirProveedores', IEditorElegirProveedores, AEditor);
begin if Assigned(AEditor) then
Contactos := AContactos; with AEditor do
Controller := Self; begin
MultiSelect := AMultiSelect; Contactos := AContactos;
Mensaje := AMensaje; Controller := Self;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ContactosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ContactosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;
function TProveedoresController.ElegirDireccionEntrega( function TProveedoresController.ElegirDireccionEntrega(ADirecciones: IBizDireccionesContacto;
ADirecciones: IBizDireccionesContacto;
AMensaje: String): IBizDireccionesContacto; AMensaje: String): IBizDireccionesContacto;
var var
AEditor : IEditorElegirDireccionEntrega; AEditor : IEditorElegirDireccionEntrega;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor);
try try
with AEditor do CreateEditor('EditorElegirDireccionEntrega', IEditorElegirDireccionEntrega, AEditor);
begin if Assigned(AEditor) then
Direccion := ADirecciones; with AEditor do
Mensaje := AMensaje; begin
if IsPositiveResult(ShowModal) then Direccion := ADirecciones;
Result := DireccionSeleccionada; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := DireccionSeleccionada;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -19,7 +19,7 @@ implementation
{ TArticulosFacturaClienteController } { TArticulosFacturaClienteController }
uses Controls, uIEditorElegirArticulosFacturasCliente, uIEditorElegirArticulos; uses Controls, cxControls, uIEditorElegirArticulosFacturasCliente, uIEditorElegirArticulos;
function TArticulosFacturaClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; function TArticulosFacturaClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
AMultiSelect: Boolean): IBizArticulo; AMultiSelect: Boolean): IBizArticulo;
@ -27,20 +27,23 @@ var
AEditor : IEditorElegirArticulosFacturasCliente; AEditor : IEditorElegirArticulosFacturasCliente;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Articulos := AArticulos;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -691,20 +691,23 @@ var
AEditor : IEditorElegirFacturasCliente; AEditor : IEditorElegirFacturasCliente;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirFacturasCliente', IEditorElegirFacturasCliente, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Facturas := AFacturas; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Facturas := AFacturas;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := FacturasClienteSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := FacturasClienteSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -68,9 +68,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Preview; Preview;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);
@ -95,9 +95,9 @@ begin
if Assigned(AEditor) then if Assigned(AEditor) then
with AEditor do with AEditor do
begin begin
AEditor.LoadFromStream(AStream); LoadFromStream(AStream);
AEditor.Print; Print;
AEditor.Release; Release;
end; end;
finally finally
FreeAndNil(AStream); FreeAndNil(AStream);

View File

@ -48,14 +48,14 @@
<DelphiCompile Include="FacturasProveedor_controller.dpk"> <DelphiCompile Include="FacturasProveedor_controller.dpk">
<MainSource>MainSource</MainSource> <MainSource>MainSource</MainSource>
</DelphiCompile> </DelphiCompile>
<DCCReference Include="..\..\Lib\AlbaranesProveedor_controller.dcp" /> <DCCReference Include="..\AlbaranesProveedor_controller.dcp" />
<DCCReference Include="..\..\Lib\AlbaranesProveedor_model.dcp" /> <DCCReference Include="..\AlbaranesProveedor_model.dcp" />
<DCCReference Include="..\..\Lib\Articulos_controller.dcp" /> <DCCReference Include="..\Articulos_controller.dcp" />
<DCCReference Include="..\..\Lib\Contactos_controller.dcp" /> <DCCReference Include="..\Contactos_controller.dcp" />
<DCCReference Include="..\..\Lib\FacturasProveedor_data.dcp" /> <DCCReference Include="..\FacturasProveedor_data.dcp" />
<DCCReference Include="..\..\Lib\FacturasProveedor_model.dcp" /> <DCCReference Include="..\FacturasProveedor_model.dcp" />
<DCCReference Include="..\..\Lib\FormasPago_controller.dcp" /> <DCCReference Include="..\FormasPago_controller.dcp" />
<DCCReference Include="..\..\Lib\RecibosProveedor_controller.dcp" /> <DCCReference Include="..\RecibosProveedor_controller.dcp" />
<DCCReference Include="uArticulosFacturaProveedorController.pas" /> <DCCReference Include="uArticulosFacturaProveedorController.pas" />
<DCCReference Include="uDetallesFacturaProveedorController.pas" /> <DCCReference Include="uDetallesFacturaProveedorController.pas" />
<DCCReference Include="uFacturasProveedorController.pas" /> <DCCReference Include="uFacturasProveedorController.pas" />
@ -66,7 +66,6 @@
<DCCReference Include="View\uIEditorFacturasProveedorPreview.pas" /> <DCCReference Include="View\uIEditorFacturasProveedorPreview.pas" />
</ItemGroup> </ItemGroup>
</Project> </Project>
<!-- EurekaLog First Line <!-- EurekaLog First Line
[Exception Log] [Exception Log]
EurekaLog Version=6006 EurekaLog Version=6006

View File

@ -20,7 +20,7 @@ implementation
{ TArticulosFacturaProveedorController } { TArticulosFacturaProveedorController }
uses Controls, uIEditorElegirArticulosFacturasProveedor, uIEditorElegirArticulos; uses Controls, cxControls, uIEditorElegirArticulosFacturasProveedor, uIEditorElegirArticulos;
function TArticulosFacturaProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; function TArticulosFacturaProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
@ -28,21 +28,24 @@ var
AEditor : IEditorElegirArticulosFacturasProveedor; AEditor : IEditorElegirArticulosFacturasProveedor;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosFacturaProveedor', IEditorElegirArticulosFacturasProveedor, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosFacturaProveedor', IEditorElegirArticulosFacturasProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
Proveedor := AProveedor; Controller := Self;
MultiSelect := AMultiSelect; Articulos := AArticulos;
Mensaje := AMensaje; Proveedor := AProveedor;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -681,20 +681,24 @@ function TFacturasProveedorController.ElegirFacturas(AFacturas: IBizFacturaProve
AEditor : IEditorElegirFacturasProveedor;} AEditor : IEditorElegirFacturasProveedor;}
begin begin
Result := NIL; Result := NIL;
{ CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor); {
ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirFacturasProveedor', IEditorElegirFacturasProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Facturas := AFacturas; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Facturas := AFacturas;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := FacturasProveedoreSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := FacturasProveedoreSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
} }
end; end;

View File

@ -58,22 +58,25 @@ var
AEditor : IEditorFacturasProveedorPreview; AEditor : IEditorFacturasProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AFacturaID); AStream := FDataModule.GetReport(AFacturaID);
try try
CreateEditor('EditorFacturasProveedorPreview', IEditorFacturasProveedorPreview, AEditor); CreateEditor('EditorFacturasProveedorPreview', IEditorFacturasProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TFacturasProveedorReportController.Print(const AFacturaID : String); procedure TFacturasProveedorReportController.Print(const AFacturaID : String);
@ -88,16 +91,20 @@ begin
AStream := FDataModule.GetReport(AFacturaID); AStream := FDataModule.GetReport(AFacturaID);
try try
CreateEditor('EditorFacturasProveedorPreview', IEditorFacturasProveedorPreview, AEditor); CreateEditor('EditorFacturasProveedorPreview', IEditorFacturasProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

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

View File

@ -325,20 +325,23 @@ var
AEditor : IEditorElegirArticulosAlmacen; AEditor : IEditorElegirArticulosAlmacen;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosAlmacen', IEditorElegirArticulosAlmacen, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosAlmacen', IEditorElegirArticulosAlmacen, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Inventario := AArticulos; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Inventario := AArticulos;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -20,7 +20,7 @@ implementation
{ TArticulosPedidoProveedorController } { TArticulosPedidoProveedorController }
uses Controls, uIEditorElegirArticulosPedidosProveedor, uIEditorElegirArticulos; uses Controls, cxControls, uIEditorElegirArticulosPedidosProveedor, uIEditorElegirArticulos;
function TArticulosPedidoProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; function TArticulosPedidoProveedorController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo; AMultiSelect: Boolean; const AProveedor: IBizProveedor): IBizArticulo;
@ -28,21 +28,24 @@ var
AEditor : IEditorElegirArticulosPedidosProveedor; AEditor : IEditorElegirArticulosPedidosProveedor;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosPedidoProveedor', IEditorElegirArticulosPedidosProveedor, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosPedidoProveedor', IEditorElegirArticulosPedidosProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
Proveedor := AProveedor; Controller := Self;
MultiSelect := AMultiSelect; Articulos := AArticulos;
Mensaje := AMensaje; Proveedor := AProveedor;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -243,26 +243,21 @@ begin
try try
RecuperarProveedor(APedido); RecuperarProveedor(APedido);
CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor); CreateEditor('EditorSituacionPedidoProveedor', IEditorSituacionPedidoProveedor, AEditor);
with AEditor do if Assigned(AEditor) then
begin with AEditor do
Controller := Self; //OJO ORDEN MUY IMPORTANTE begin
PedidoProveedor := APedido; Controller := Self; //OJO ORDEN MUY IMPORTANTE
end; PedidoProveedor := APedido;
ShowModal;
Release;
Result := True;
end;
finally finally
AEditor := NIL;
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
try
AEditor.ShowModal;
AEditor.Release;
Result := True;
finally
AEditor := NIL;
end;
end; end;
destructor TPedidosProveedorController.Destroy; destructor TPedidosProveedorController.Destroy;
begin begin
FDataModule := Nil; FDataModule := Nil;
@ -471,21 +466,23 @@ var
AEditor : IEditorElegirPedidosProveedor; AEditor : IEditorElegirPedidosProveedor;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
CreateEditor('EditorElegirPedidosProveedor', IEditorElegirPedidosProveedor, AEditor);
try try
with AEditor do CreateEditor('EditorElegirPedidosProveedor', IEditorElegirPedidosProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Pedidos := APedido; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Pedidos := APedido;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := PedidosProveedorSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := PedidosProveedorSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -59,22 +59,25 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
try try
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor); CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TPedidosProveedorReportController.Print(const AID : String); procedure TPedidosProveedorReportController.Print(const AID : String);
@ -83,22 +86,25 @@ var
AEditor : IEditorPedidosProveedorPreview; AEditor : IEditorPedidosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(AID); AStream := FDataModule.GetReport(AID);
try try
CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor); CreateEditor('EditorPedidosProveedorPreview', IEditorPedidosProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

@ -19,7 +19,7 @@ implementation
{ TArticulosPresupuestoClienteController } { TArticulosPresupuestoClienteController }
uses Controls, uIEditorElegirArticulosPresupuestosCliente, uIEditorElegirArticulos; uses Controls, cxControls, uIEditorElegirArticulosPresupuestosCliente, uIEditorElegirArticulos;
function TArticulosPresupuestoClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String; function TArticulosPresupuestoClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
AMultiSelect: Boolean): IBizArticulo; AMultiSelect: Boolean): IBizArticulo;
@ -27,20 +27,23 @@ var
AEditor : IEditorElegirArticulosPresupuestosCliente; AEditor : IEditorElegirArticulosPresupuestosCliente;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirArticulosPresupuestosCliente', IEditorElegirArticulosPresupuestosCliente, AEditor); ShowHourglassCursor;
try try
with AEditor do CreateEditor('EditorElegirArticulosPresupuestosCliente', IEditorElegirArticulosPresupuestosCliente, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Articulos := AArticulos; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Articulos := AArticulos;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := ArticulosSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := ArticulosSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -432,21 +432,23 @@ var
AEditor : IEditorElegirPresupuestosCliente; AEditor : IEditorElegirPresupuestosCliente;
begin begin
Result := NIL; Result := NIL;
ShowHourglassCursor;
CreateEditor('EditorElegirPresupuestosCliente', IEditorElegirPresupuestosCliente, AEditor);
try try
with AEditor do CreateEditor('EditorElegirPresupuestosCliente', IEditorElegirPresupuestosCliente, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
Presupuestos := APresupuesto; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; Presupuestos := APresupuesto;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := PresupuestosClienteSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := PresupuestosClienteSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
HideHourglassCursor;
end; end;
end; end;

View File

@ -754,17 +754,17 @@ var
AEditor : IEditorFechaPago; AEditor : IEditorFechaPago;
FechaPago: String; FechaPago: String;
begin begin
//Pedimos la fecha del pago try
CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor); //Pedimos la fecha del pago
if Assigned(AEditor) then CreateEditor('EditorFechaPago', IEditorFechaPago, AEditor);
try if Assigned(AEditor) then
FechaPago:= ''; FechaPago:= '';
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
AEditor.Release; AEditor.Release;
finally finally
AEditor := NIL; AEditor := NIL;
end; end;
if Length(FechaPago) > 0 then if Length(FechaPago) > 0 then
PagosController.Modificar(ARecibosCliente.Pagos, FechaPago); PagosController.Modificar(ARecibosCliente.Pagos, FechaPago);

View File

@ -162,15 +162,15 @@ begin
//Pedimos la fecha del pago //Pedimos la fecha del pago
if (Length(FechaPago) = 0) then if (Length(FechaPago) = 0) then
begin begin
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor); try
if Assigned(AEditor) then CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
try if Assigned(AEditor) then
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
AEditor.Release; AEditor.Release;
finally finally
AEditor := NIL; AEditor := NIL;
end; end;
end; end;
// Se cancela la operación // Se cancela la operación
@ -546,18 +546,19 @@ var
AEditor : IEditorElegirRecibosProveedor; AEditor : IEditorElegirRecibosProveedor;
begin begin
Result := NIL; Result := NIL;
CreateEditor('EditorElegirRecibosProveedor', IEditorElegirRecibosProveedor, AEditor);
try try
with AEditor do CreateEditor('EditorElegirRecibosProveedor', IEditorElegirRecibosProveedor, AEditor);
begin if Assigned(AEditor) then
Controller := Self; with AEditor do
RecibosProveedor := ARecibos; begin
MultiSelect := AMultiSelect; Controller := Self;
Mensaje := AMensaje; RecibosProveedor := ARecibos;
if IsPositiveResult(ShowModal) then MultiSelect := AMultiSelect;
Result := RecibosProveedorSeleccionados; Mensaje := AMensaje;
Release; if IsPositiveResult(ShowModal) then
end; Result := RecibosProveedorSeleccionados;
Release;
end;
finally finally
AEditor := NIL; AEditor := NIL;
end; end;
@ -724,17 +725,17 @@ var
AEditor : IEditorFechaPagoProveedor; AEditor : IEditorFechaPagoProveedor;
FechaPago: String; FechaPago: String;
begin begin
//Pedimos la fecha del pago try
CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor); //Pedimos la fecha del pago
if Assigned(AEditor) then CreateEditor('EditorFechaPagoProveedor', IEditorFechaPagoProveedor, AEditor);
try if Assigned(AEditor) then
FechaPago:= ''; FechaPago:= '';
if (AEditor.ShowModal = mrOk) then if (AEditor.ShowModal = mrOk) then
FechaPago := DateToStr(AEditor.FechaPago); FechaPago := DateToStr(AEditor.FechaPago);
AEditor.Release; AEditor.Release;
finally finally
AEditor := NIL; AEditor := NIL;
end; end;
if Length(FechaPago) > 0 then if Length(FechaPago) > 0 then
PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago); PagosController.Modificar(ARecibosProveedor.Pagos, FechaPago);

View File

@ -58,22 +58,25 @@ var
AEditor : IEditorRecibosProveedorPreview; AEditor : IEditorRecibosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor); CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TRecibosProveedorReportController.Print(const ID : integer); procedure TRecibosProveedorReportController.Print(const ID : integer);
@ -82,22 +85,25 @@ var
AEditor : IEditorRecibosProveedorPreview; AEditor : IEditorRecibosProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor); CreateEditor('EditorRecibosProveedorPreview', IEditorRecibosProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

@ -58,22 +58,25 @@ var
AEditor : IEditorRemesasClientePreview; AEditor : IEditorRemesasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor); CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TRemesasClienteReportController.Print(const ID : String); procedure TRemesasClienteReportController.Print(const ID : String);
@ -82,22 +85,25 @@ var
AEditor : IEditorRemesasClientePreview; AEditor : IEditorRemesasClientePreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor); CreateEditor('EditorRemesasClientePreview', IEditorRemesasClientePreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

View File

@ -58,22 +58,25 @@ var
AEditor : IEditorRemesasProveedorPreview; AEditor : IEditorRemesasProveedorPreview;
begin begin
AEditor := NIL; AEditor := NIL;
ShowHourglassCursor; ShowHourglassCursor;
try try
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor); CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
AEditor := Nil;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Preview;
end; end;
procedure TRemesasProveedorReportController.Print(const ID : String); procedure TRemesasProveedorReportController.Print(const ID : String);
@ -88,16 +91,20 @@ begin
AStream := FDataModule.GetReport(ID); AStream := FDataModule.GetReport(ID);
try try
CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor); CreateEditor('EditorRemesasProveedorPreview', IEditorRemesasProveedorPreview, AEditor);
AEditor.LoadFromStream(AStream); if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally finally
AStream.Free; FreeAndNil(AStream);
Release;
end; end;
finally finally
HideHourglassCursor; HideHourglassCursor;
end; end;
if Assigned(AEditor) then
AEditor.Print
end; end;
end. end.

Binary file not shown.

View File

@ -14,7 +14,7 @@ BEGIN
BEGIN BEGIN
VALUE "FileVersion", "3.0.0.0\0" VALUE "FileVersion", "3.0.0.0\0"
VALUE "ProductVersion", "3.0.0.0\0" VALUE "ProductVersion", "3.0.0.0\0"
VALUE "CompileDate", "domingo, 18 de noviembre de 2007 19:38\0" VALUE "CompileDate", "domingo, 18 de noviembre de 2007 21:05\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"