diff --git a/Source/GUIBase/GUIBase.res b/Source/GUIBase/GUIBase.res index 8b251f31..1641339f 100644 Binary files a/Source/GUIBase/GUIBase.res and b/Source/GUIBase/GUIBase.res differ diff --git a/Source/Informes/InfContratoCliente.fr3 b/Source/Informes/InfContratoCliente.fr3 index 95663798..dd2c51ca 100644 --- a/Source/Informes/InfContratoCliente.fr3 +++ b/Source/Informes/InfContratoCliente.fr3 @@ -1,5 +1,5 @@ - + @@ -68,7 +68,7 @@ - + @@ -78,4 +78,17 @@ + + + + + + + + + + + + + diff --git a/Source/Modulos/Articulos/Data/Articulos_data.RES b/Source/Modulos/Articulos/Data/Articulos_data.RES index 8b251f31..1641339f 100644 Binary files a/Source/Modulos/Articulos/Data/Articulos_data.RES and b/Source/Modulos/Articulos/Data/Articulos_data.RES differ diff --git a/Source/Modulos/Articulos/Data/Articulos_data.dproj b/Source/Modulos/Articulos/Data/Articulos_data.dproj index 6f5c6a79..362ae2fb 100644 --- a/Source/Modulos/Articulos/Data/Articulos_data.dproj +++ b/Source/Modulos/Articulos/Data/Articulos_data.dproj @@ -54,7 +54,7 @@ MainSource - +
DataModuleArticulos
diff --git a/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas b/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas index 1c10c47e..43066eb7 100644 --- a/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas +++ b/Source/Modulos/Articulos/Data/uDataModuleArticulos.pas @@ -44,8 +44,12 @@ uses { TdmArticulos } function TDataModuleArticulos.AnadirImagen(const ID: Integer; const AFileName: String): Boolean; +var + AImagen: Binary; begin - Result := (RORemoteService as IsrvArticulos).AnadirImagen(ID, AFileName); + AImagen := Binary.Create; + AImagen.LoadFromFile(AFileName); + Result := (RORemoteService as IsrvArticulos).AnadirImagen(ID, AImagen); end; procedure TDataModuleArticulos.AsignarClaseNegocio(AArticulo: TDADataTable); diff --git a/Source/Modulos/Articulos/Servidor/srvArticulos_Impl.pas b/Source/Modulos/Articulos/Servidor/srvArticulos_Impl.pas index a56f5a08..4a176b91 100644 --- a/Source/Modulos/Articulos/Servidor/srvArticulos_Impl.pas +++ b/Source/Modulos/Articulos/Servidor/srvArticulos_Impl.pas @@ -32,14 +32,14 @@ type procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; var aConnectionName: string); function EliminarImagen(const ID_ARTICULO: Integer): Boolean; - function AnadirImagen(const ID_ARTICULO: Integer; const AFileName: AnsiString): Boolean; + function AnadirImagen(const ID_ARTICULO: Integer; const Imagen: Binary): Boolean; end; implementation {$R *.dfm} uses - {Generated:} FactuGES_Invk, uDataModuleServer, uROClasses, + {Generated:} FactuGES_Invk, uDataModuleServer, uROClasses, uSistemaFunc, uDatabaseUtils, schArticulosClient_Intf, uRestriccionesUsuarioUtils; procedure Create_srvArticulos(out anInstance : IUnknown); @@ -48,11 +48,12 @@ begin end; { srvArticulos } -function TsrvArticulos.AnadirImagen(const ID_ARTICULO: Integer; const AFileName: AnsiString): Boolean; +function TsrvArticulos.AnadirImagen(const ID_ARTICULO: Integer; const Imagen: Binary): Boolean; var AConn : IDAConnection; dsData: IDADataset; dsCommand: IDASQLCommand; + aAux : String; begin Result := False; @@ -76,9 +77,11 @@ begin begin try try + aAux := DarFicheroJPGTemporal; + Imagen.SaveToFile(aAux); dsCommand := schArticulos.NewCommand(AConn, 'ModificarImagen'); dsCommand.ParamByName('ID').AsInteger := ID_ARTICULO; - dsCommand.ParamByName('IMAGEN').LoadFromFile(AFileName); + dsCommand.ParamByName('IMAGEN').LoadFromFile(aAux); dsCommand.Execute; AConn.CommitTransaction; Result := True; @@ -87,6 +90,7 @@ begin AConn.RollbackTransaction; end; finally + DeleteFile(aAux); dsCommand := NIL; end; end; diff --git a/Source/Servicios/FactuGES.RODL b/Source/Servicios/FactuGES.RODL index f7cfce6c..4f58ee60 100644 --- a/Source/Servicios/FactuGES.RODL +++ b/Source/Servicios/FactuGES.RODL @@ -212,7 +212,7 @@ - + diff --git a/Source/Servicios/FactuGES_Intf.pas b/Source/Servicios/FactuGES_Intf.pas index 97904f97..ac7789e1 100644 --- a/Source/Servicios/FactuGES_Intf.pas +++ b/Source/Servicios/FactuGES_Intf.pas @@ -418,7 +418,7 @@ type IsrvArticulos = interface(IDataAbstractService) ['{CFBE5841-DF0F-48AD-853E-A35FDA989E6E}'] function EliminarImagen(const ID_ARTICULO: Integer): Boolean; - function AnadirImagen(const ID_ARTICULO: Integer; const AFileName: AnsiString): Boolean; + function AnadirImagen(const ID_ARTICULO: Integer; const Imagen: Binary): Boolean; end; { CosrvArticulos } @@ -432,7 +432,7 @@ type function __GetInterfaceName:string; override; function EliminarImagen(const ID_ARTICULO: Integer): Boolean; - function AnadirImagen(const ID_ARTICULO: Integer; const AFileName: AnsiString): Boolean; + function AnadirImagen(const ID_ARTICULO: Integer; const Imagen: Binary): Boolean; end; { IsrvRecibosCliente } @@ -1639,12 +1639,12 @@ begin end end; -function TsrvArticulos_Proxy.AnadirImagen(const ID_ARTICULO: Integer; const AFileName: AnsiString): Boolean; +function TsrvArticulos_Proxy.AnadirImagen(const ID_ARTICULO: Integer; const Imagen: Binary): Boolean; begin try __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'AnadirImagen'); __Message.Write('ID_ARTICULO', TypeInfo(Integer), ID_ARTICULO, []); - __Message.Write('AFileName', TypeInfo(AnsiString), AFileName, []); + __Message.Write('Imagen', TypeInfo(Binary), Imagen, []); __Message.Finalize; __TransportChannel.Dispatch(__Message); diff --git a/Source/Servicios/FactuGES_Invk.pas b/Source/Servicios/FactuGES_Invk.pas index 56154c40..dcba1490 100644 --- a/Source/Servicios/FactuGES_Invk.pas +++ b/Source/Servicios/FactuGES_Invk.pas @@ -717,17 +717,19 @@ begin end; procedure TsrvArticulos_Invoker.Invoke_AnadirImagen(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); -{ function AnadirImagen(const ID_ARTICULO: Integer; const AFileName: AnsiString): Boolean; } +{ function AnadirImagen(const ID_ARTICULO: Integer; const Imagen: Binary): Boolean; } var ID_ARTICULO: Integer; - AFileName: AnsiString; + Imagen: Binary; lResult: Boolean; + __lObjectDisposer: TROObjectDisposer; begin + Imagen := nil; try __Message.Read('ID_ARTICULO', TypeInfo(Integer), ID_ARTICULO, []); - __Message.Read('AFileName', TypeInfo(AnsiString), AFileName, []); + __Message.Read('Imagen', TypeInfo(Binary), Imagen, []); - lResult := (__Instance as IsrvArticulos).AnadirImagen(ID_ARTICULO, AFileName); + lResult := (__Instance as IsrvArticulos).AnadirImagen(ID_ARTICULO, Imagen); __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvArticulos', 'AnadirImagenResponse'); __Message.Write('Result', TypeInfo(Boolean), lResult, []); @@ -735,6 +737,12 @@ begin __Message.UnsetAttributes(__Transport); finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(Imagen); + finally + __lObjectDisposer.Free(); + end; end; end; diff --git a/Source/Servicios/RODLFile.res b/Source/Servicios/RODLFile.res index bda058c6..c54c5103 100644 Binary files a/Source/Servicios/RODLFile.res and b/Source/Servicios/RODLFile.res differ