From b7ef06ed1b390772583c0843e8ad1ea8061b39b1 Mon Sep 17 00:00:00 2001 From: roberto Date: Wed, 27 Aug 2008 14:17:04 +0000 Subject: [PATCH] Primera subida de gestion de documentos en presupuestos de cliente (a falta de repaso y mejora) git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@539 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- Build/Build.fbp5 | 659 ++++++++++++++++++ Source/Base/Base.dproj | 102 +-- Source/Base/Utiles/uSistemaFunc.pas | 73 +- Source/GUIBase/GUIBase.dpk | 3 +- Source/GUIBase/GUIBase.dproj | 96 +-- Source/GUIBase/uViewDocumentos.dfm | 72 ++ Source/GUIBase/uViewDocumentos.pas | 219 ++++++ .../AlbaranesProveedor_Group.groupproj | 16 +- .../GestorDocumentos_Controller.res | Bin 0 -> 384 bytes .../GestorDocumentos_controller.dpk | Bin 0 -> 632 bytes .../GestorDocumentos_controller.dproj | 540 ++++++++++++++ .../GestorDocumentos_controller.drc | 16 + .../Controller/GestorDocumentos_controller.rc | 22 + .../uGestorDocumentosController.pas | 103 +++ .../Data/GestorDocumentos_data.dpk | Bin 0 -> 618 bytes .../Data/GestorDocumentos_data.dproj | 540 ++++++++++++++ .../Data/GestorDocumentos_data.drc | 17 + .../Data/GestorDocumentos_data.rc | 22 + .../Data/GestorDocumentos_data.res | Bin 0 -> 384 bytes .../Data/uDataModuleGestorDocumentos.dfm | 16 + .../Data/uDataModuleGestorDocumentos.pas | 104 +++ .../Servidor/srvGestorDocumentos_Impl.dfm | 6 + .../Servidor/srvGestorDocumentos_Impl.pas | 178 +++++ .../PresupuestosCliente_controller.dpk | Bin 1511 -> 1543 bytes .../PresupuestosCliente_controller.dproj | 15 +- .../uPresupuestosClienteController.pas | 96 ++- .../Data/uDataModulePresupuestosCliente.dfm | 7 + .../Data/uDataModulePresupuestosCliente.pas | 65 +- .../Data/uIDataModulePresupuestosCliente.pas | 2 +- .../PresupuestosCliente_Group.groupproj | 62 +- .../Views/PresupuestosCliente_view.dpk | Bin 2135 -> 2909 bytes .../Views/PresupuestosCliente_view.dproj | 37 + .../Views/uEditorPresupuestoCliente.dfm | 146 ++-- .../Views/uEditorPresupuestoCliente.pas | 10 +- .../uViewDocumentosPresupuestoCliente.dfm | 2 + .../uViewDocumentosPresupuestoCliente.pas | 103 +++ Source/Servicios/FactuGES.RODL | 63 ++ Source/Servicios/FactuGES_Intf.pas | 118 ++++ Source/Servicios/FactuGES_Invk.pas | 132 ++++ Source/Servicios/RODLFILE.res | Bin 26590 -> 28754 bytes Source/Servidor/FactuGES_Server.dpr | 3 +- Source/Servidor/FactuGES_Server.dproj | 576 +++++++-------- 42 files changed, 3754 insertions(+), 487 deletions(-) create mode 100644 Source/GUIBase/uViewDocumentos.dfm create mode 100644 Source/GUIBase/uViewDocumentos.pas create mode 100644 Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_Controller.res create mode 100644 Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.dpk create mode 100644 Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.dproj create mode 100644 Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc create mode 100644 Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.rc create mode 100644 Source/Modulos/Gestion de documentos/Controller/uGestorDocumentosController.pas create mode 100644 Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dpk create mode 100644 Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dproj create mode 100644 Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc create mode 100644 Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.rc create mode 100644 Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.res create mode 100644 Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.dfm create mode 100644 Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.pas create mode 100644 Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.dfm create mode 100644 Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.pas create mode 100644 Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.dfm create mode 100644 Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.pas diff --git a/Build/Build.fbp5 b/Build/Build.fbp5 index 5573f26d..d1df4ed2 100644 --- a/Build/Build.fbp5 +++ b/Build/Build.fbp5 @@ -5839,6 +5839,665 @@ Comments= + + + + 0 + + + + True + True + False + True + False + + 0 + False + 0 + 1000 + False + + + + 0 + + True + False + False + True + True + 0 + 1252 + 12 + Release + False + + + False + True + + False + + False + False + False + True + True + False + False + False + False + False + False + False + False + 3082 + + 1 + + 0 + 0 + False + 0 + + + True + 0 + + + rcBorland + 1000 + + False + False + False + False + [usPackages,usCompiler,usLinker,usVersionInfo] + False + False + + + + False + False + False + False + False + True + False + False + %package_path% + + + + False + %modules_dcp_path% + False + + False + + False + True + False + False + True + 4194304 + False + False + False + True + %library_path% + 0 + False + 0 + 1048576 + 16384 + + True + True + %output_path% + False + + False + fa8 + False + False + + True + True + False + False + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + False + True + + + + + + 0 + + True + False + False + True + True + 0 + 1252 + 12 + Release + False + + + True + True + + False + + False + False + False + True + True + False + False + False + False + False + False + False + False + 3082 + + 1 + + 0 + 0 + False + 0 + + + True + 0 + + + rcBorland + 1000 + + False + False + False + False + [usPackages,usCompiler,usLinker,usVersionInfo] + False + False + + + + False + False + False + False + False + True + False + False + %package_path% + + + + False + %modules_dcp_path% + False + + False + + False + True + False + False + True + 4194304 + False + False + False + True + %library_path% + 0 + False + 3 + 1048576 + 16384 + + True + True + %output_path% + False + + False + fa8 + False + False + + True + True + False + False + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + False + True + + + + + + 0 + + True + False + False + True + True + 0 + 1252 + 12 + Release + False + + + True + True + + False + + False + False + False + True + True + False + False + False + False + False + False + False + False + 3082 + + 1 + + 0 + 0 + False + 0 + + + True + 0 + + + rcBorland + 1000 + + False + False + False + False + [usPackages,usCompiler,usLinker,usVersionInfo] + False + False + + + + False + False + False + False + False + True + False + False + %package_path% + + + + False + %modules_dcp_path% + False + + False + + False + True + False + False + True + 4194304 + False + False + False + True + %library_path% + 0 + False + 0 + 1048576 + 16384 + + True + True + %output_path% + False + + False + fa8 + False + False + + True + True + False + False + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + False + True + + + + + + 0 + + True + False + False + True + True + 0 + 1252 + 12 + Release + False + + + False + True + + False + + False + False + False + True + True + False + False + False + False + False + False + False + False + 3082 + + 1 + + 0 + 0 + False + 0 + + + True + 0 + + + rcBorland + 1000 + + False + False + False + False + [usPackages,usCompiler,usLinker,usVersionInfo] + False + False + + + + False + False + False + False + False + True + False + False + %package_path% + + + + False + %modules_dcp_path% + False + + False + + False + True + False + False + True + 4194304 + False + False + False + True + %library_path% + 0 + False + 0 + 1048576 + 16384 + + True + True + %output_path% + False + + False + fa8 + False + False + + True + True + False + False + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + False + True + + + + + + 0 + + True + False + False + True + True + 0 + 1252 + 12 + Release + False + + + False + True + + False + + False + False + False + True + True + False + False + False + False + False + False + False + False + 3082 + + 1 + + 0 + 0 + False + 0 + + + True + 0 + + + rcBorland + 1000 + + False + False + False + False + [usPackages,usCompiler,usLinker,usVersionInfo] + False + False + + + + False + False + False + False + False + True + False + False + %package_path% + + + + False + %modules_dcp_path% + False + + False + + False + True + False + False + True + 4194304 + False + False + False + True + %library_path% + 0 + False + 0 + 1048576 + 16384 + + True + True + %output_path% + False + + False + fa8 + False + False + + True + True + False + False + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + False + True + + + diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj index 33ccbea1..ab75d05c 100644 --- a/Source/Base/Base.dproj +++ b/Source/Base/Base.dproj @@ -53,58 +53,58 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fConfigurarConexion
TForm diff --git a/Source/Base/Utiles/uSistemaFunc.pas b/Source/Base/Utiles/uSistemaFunc.pas index 8d5b03ed..a1394444 100644 --- a/Source/Base/Utiles/uSistemaFunc.pas +++ b/Source/Base/Utiles/uSistemaFunc.pas @@ -20,15 +20,17 @@ --------------------------------------------------------------------------- =============================================================================== } - unit uSistemaFunc; interface +uses SysUtils, Classes; + { Funciones del sistema } function Ejecutar (const LineaComando: String; Oculto, Esperar: Boolean) : Boolean; procedure EscribirEnFichero (NombreFichero, Texto : string); function DarRutaTemporal : String; +function DarDirectorioTemporal : String; function DarFicheroTemporal : String; function DarFicheroJPGTemporal : String; function DarFicheroBMPTemporal : String; @@ -46,12 +48,14 @@ function PreguntarRuta(const ATitulo: String; const AComentario: String; var ARu function PreguntarFicheroWordExportar (var Fichero : String) : Boolean; function PreguntarFicheroExcelExportar (var Fichero : String) : Boolean; function EscapeIllegalChars(AFileName: string): string; +function FindFile(const filespec: TFileName; attributes: integer = faReadOnly Or faHidden Or faSysFile Or faArchive): TStringList; + implementation uses - SysUtils, Windows, Dialogs, JclFileUtils, - Messages, Classes, Graphics, Controls, Forms, + Windows, Dialogs, JclFileUtils, + Messages, Graphics, Controls, Forms, StdCtrls, SHFolder, cxShellBrowserDialog, cxLookAndFeels, uStringsUtils; @@ -368,4 +372,67 @@ begin Result := AFileName; end; +function FindFile(const filespec: TFileName; attributes: integer): TStringList; +var + spec: string; + list: TStringList; + +procedure RFindFile(const folder: TFileName); +var + SearchRec: TSearchRec; +begin + // Locate all matching files in the current + // folder and add their names to the list + if FindFirst(folder + spec, attributes, SearchRec) = 0 then begin + try + repeat + if (SearchRec.Attr and faDirectory = 0) or + (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then + list.Add(folder + SearchRec.Name); + until FindNext(SearchRec) <> 0; + except + SysUtils.FindClose(SearchRec); + raise; + end; + SysUtils.FindClose(SearchRec); + end; + // Now search the subfolders + if FindFirst(folder + '*', attributes + Or faDirectory, SearchRec) = 0 then + begin + try + repeat + if ((SearchRec.Attr and faDirectory) <> 0) and + (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then + RFindFile(folder + SearchRec.Name + '\'); + until FindNext(SearchRec) <> 0; + except + SysUtils.FindClose(SearchRec); + raise; + end; + SysUtils.FindClose(SearchRec); + end; +end; // procedure RFindFile inside of FindFile + +begin // function FindFile + list := TStringList.Create; + try + spec := ExtractFileName(filespec); + RFindFile(ExtractFilePath(filespec)); + Result := list; + except + list.Free; + raise; + end; +end; + +function DarDirectorioTemporal : String; +var + Cadena: String; +begin + Cadena := ExtractFileName(DarFicheroTemporal); + Cadena := StringReplace(Cadena, ExtractFileExt(Cadena), '', []); + Result := DarRutaTemporal + Cadena + '\'; +end; + end. diff --git a/Source/GUIBase/GUIBase.dpk b/Source/GUIBase/GUIBase.dpk index 5375471e..88eec741 100644 --- a/Source/GUIBase/GUIBase.dpk +++ b/Source/GUIBase/GUIBase.dpk @@ -97,6 +97,7 @@ contains uViewFiltroBase in 'uViewFiltroBase.pas' {frViewFiltroBase: TFrame}, uViewGrid in 'uViewGrid.pas' {frViewGrid: TFrame}, uViewRichEditor in 'uViewRichEditor.pas' {frViewRichEditor: TCustomView}, - uDialogElegirEMail in 'uDialogElegirEMail.pas' {fDialogElegirEMail}; + uDialogElegirEMail in 'uDialogElegirEMail.pas' {fDialogElegirEMail}, + uViewDocumentos in 'uViewDocumentos.pas' {frViewDocumentos: TCustomView}; end. diff --git a/Source/GUIBase/GUIBase.dproj b/Source/GUIBase/GUIBase.dproj index e64ca1e9..9ddbcd4b 100644 --- a/Source/GUIBase/GUIBase.dproj +++ b/Source/GUIBase/GUIBase.dproj @@ -58,48 +58,52 @@ MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
fDialogBase
@@ -153,6 +157,10 @@
frViewDetallesGenerico
TFrame
+ +
frViewDocumentos
+ TCustomView +
frViewFiltroBase
TFrame @@ -193,10 +201,6 @@
frViewTotales
TFrame
- - - - diff --git a/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc b/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc new file mode 100644 index 00000000..79342b73 --- /dev/null +++ b/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.drc @@ -0,0 +1,16 @@ +/* VER185 + Generated by the CodeGear Delphi Pascal Compiler + because -GD or --drc was supplied to the compiler. + + This file contains compiler-generated resources that + were bound to the executable. + If this file is empty, then no compiler-generated + resources were bound to the produced executable. +*/ + +STRINGTABLE +BEGIN +END + +/* C:\Codigo Tecsitel\Source\Modulos\Gestion de documentos\Controller\GestorDocumentos_Controller.res */ +/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf146.tmp */ diff --git a/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.rc b/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestion de documentos/Controller/GestorDocumentos_controller.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestion de documentos/Controller/uGestorDocumentosController.pas b/Source/Modulos/Gestion de documentos/Controller/uGestorDocumentosController.pas new file mode 100644 index 00000000..7d9f6de7 --- /dev/null +++ b/Source/Modulos/Gestion de documentos/Controller/uGestorDocumentosController.pas @@ -0,0 +1,103 @@ +unit uGestorDocumentosController; + +interface + +uses + Classes, uROTypes, uControllerBase, uDataModuleGestorDocumentos; + +type + IGestorDocumentosController = interface(IControllerBase) + ['{75EC4D1B-A7A2-4C81-B2DA-8688240D6EC2}'] + function DarListaDocumentos(const ID: Integer): TStringList; + function DescargarFichero(const ID:Integer; const NombreFichero: String; const DestinoFichero: String): Boolean; + function SubirFichero(const ID:Integer; const NombreFichero: String; const Fichero: Binary): Boolean; + procedure SincronizarDocumentos(const ID: Integer; FListaDocumentos: TStringList; Directorio: String); + end; + + TGestorDocumentosController = class(TControllerBase, IGestorDocumentosController) + protected + FDataModule : IDataModuleGestorDocumentos; + + //Estos son los tres métodos a sobre escribir si se desea heredar toda la logica de + //este controller + procedure AsignarDataModule; virtual; + + public + constructor Create; override; + destructor Destroy; override; + + function DarListaDocumentos(const ID: Integer): TStringList; + function DescargarFichero(const ID:Integer; const NombreFichero: String; const DestinoFichero: String): Boolean; + function SubirFichero(const ID:Integer; const NombreFichero: String; const Fichero: Binary): Boolean; + procedure SincronizarDocumentos(const ID: Integer; FListaDocumentos: TStringList; Directorio: String); + end; + +implementation +{ TGestorDocumentosController } + +uses SysUtils, Dialogs; + +procedure TGestorDocumentosController.AsignarDataModule; +begin + FDataModule := TDataModuleGestorDocumentos.Create(Nil); +end; + +constructor TGestorDocumentosController.Create; +begin + inherited; + AsignarDataModule; +end; + +function TGestorDocumentosController.DarListaDocumentos( + const ID: Integer): TStringList; +begin + Result := FDataModule.DarListaDocumentos(ID); +end; + +function TGestorDocumentosController.DescargarFichero(const ID: Integer; + const NombreFichero, DestinoFichero: String): Boolean; +begin + Result := FDataModule.DescargarFichero(ID, NombreFichero, DestinoFichero); +end; + +destructor TGestorDocumentosController.Destroy; +begin + FDataModule := Nil; + inherited; +end; + +procedure TGestorDocumentosController.SincronizarDocumentos(const ID: Integer; + FListaDocumentos: TStringList; Directorio: String); +var + ListaDocumentosServidor: TStringList; + ANombreFichero: String; + AFichero: Binary; + i, j: Integer; +begin + //Eliminamos todos los documentos del servidor que ya no existan en el cliente. + ListaDocumentosServidor := DarListaDocumentos(ID); + for i:= 0 to ListaDocumentosServidor.Count - 1 do + if not FListaDocumentos.Find(ListaDocumentosServidor.Strings[i], j) then + if not FDataModule.EliminarFichero(ID, ListaDocumentosServidor.Strings[i]) then + showmessage('Error al borrar fichero' + ListaDocumentosServidor.Strings[i]); + + //Subimos todos los ficheros que halla al servidor (de momento no se miran fechas) + for i := 0 to FListaDocumentos.Count - 1 do + begin + ANombreFichero := Directorio + FListaDocumentos.Strings[i]; + if FileExists(ANombreFichero) then + begin + AFichero := Binary.Create; + AFichero.LoadFromFile(ANombreFichero); + SubirFichero(ID, ExtractFileName(ANombreFichero), AFichero); + end; + end; +end; + +function TGestorDocumentosController.SubirFichero(const ID: Integer; + const NombreFichero: String; const Fichero: Binary): Boolean; +begin + Result := FDataModule.SubirFichero(ID, NombreFichero, Fichero); +end; + +end. diff --git a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dpk b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dpk new file mode 100644 index 0000000000000000000000000000000000000000..2e924952b6b1c8fcccf5a893e0f460c504e24ccf GIT binary patch literal 618 zcmaKqJ!``-5QaM&{2w#~0v$pN9SWV!*4aHGOGZ-MBug=gD50&L#`YBQ-|INB8&X;g z;&^oT-j}xd>OFsREOu30?s&OsK3!3l)$2O1^C#c)z5PhD+sV#VhocRGV#yv)wlSzJ zDQTFJ9SM{Yn1Ns_iaNkCn8hR`)qCLFqU6ZULRy&jl#*0wi=2anfvNBr!|9+cR0zT> zl0b + + + {38eef566-1895-4bdd-8007-f92f5e32cce6} + GestorDocumentos_data.dpk + Debug + AnyCPU + DCC32 + ..\..\..\..\Output\Debug\Cliente\GestorDocumentos_data.bpl + + + 7.0 + False + False + 0 + 3 + .\ + .\ + .\ + ..\..\..\..\Output\Debug\Cliente + ..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + RELEASE + + + 7.0 + 3 + .\ + .\ + .\ + ..\..\..\..\Output\Debug\Cliente + ..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + ..\..\..\Lib;..\..\Lib + + + Delphi.Personality + Package + +FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0GestorDocumentos_data.dpk + + + + + MainSource + + + +
DataModuleGestorDocumentos
+
+
+
+ diff --git a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc new file mode 100644 index 00000000..b4be29cd --- /dev/null +++ b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.drc @@ -0,0 +1,17 @@ +/* VER185 + Generated by the CodeGear Delphi Pascal Compiler + because -GD or --drc was supplied to the compiler. + + This file contains compiler-generated resources that + were bound to the executable. + If this file is empty, then no compiler-generated + resources were bound to the produced executable. +*/ + +STRINGTABLE +BEGIN +END + +/* C:\Codigo Tecsitel\Source\Modulos\Gestion de documentos\Data\uDataModuleGestorDocumentos.dfm */ +/* C:\Codigo Tecsitel\Source\Modulos\Gestion de documentos\Data\GestorDocumentos_data.res */ +/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf144.tmp */ diff --git a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.rc b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.rc new file mode 100644 index 00000000..153736af --- /dev/null +++ b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION 1,0,0,0 +PRODUCTVERSION 1,0,0,0 +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x00L +FILEOS 0x40004L +FILETYPE 0x1L +FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0A04E4" + BEGIN + VALUE "FileVersion", "1.0.0.0\0" + VALUE "ProductVersion", "1.0.0.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0C0A, 1252 + END +END diff --git a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.res b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.res new file mode 100644 index 0000000000000000000000000000000000000000..8b251f312bcccec5485024f6fe8d80e1cdf25746 GIT binary patch literal 384 zcmZ9HOA3Ne6ox;+L5PEv(4cV`IIrjdPAV##hV&wc1g%+%X(R2Xc{`~7t6e0Ioa?#% zkMj%AQhz>WYy7LeWAUaqx~Kv?-;(-Hs4-^ATIZOBrid9+-6Ne7&88mi>kUR4lo#jxZ;#*s4zxg9yNlk=H9sqkCD2^cEXKpiTBNfgkKpXJBWWaLt(Qkv@0 w5yv*t82((Wlr2{_+FDoDHKW2QCXvc+s**ul{{$ + Height = 113 + Width = 254 +end diff --git a/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.pas b/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.pas new file mode 100644 index 00000000..11e94808 --- /dev/null +++ b/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.pas @@ -0,0 +1,178 @@ +unit srvGestorDocumentos_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} FactuGES_Intf; + +type + { TsrvGestorDocumentos } + TsrvGestorDocumentos = class(TDataAbstractService, IsrvGestorDocumentos) + private + function DarRutaDocumentos: string; + + protected + { IsrvGestorDocumentos methods } + function DarListaFicheros(const Almacen: TRdxAlmacenes; const ID: Integer): StringArray; + function DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary; + function SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean; + function EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Boolean; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FactuGES_Invk, srvConfiguracion_Impl, uSistemaFunc, Dialogs; + +procedure Create_srvGestorDocumentos(out anInstance : IUnknown); +begin + anInstance := TsrvGestorDocumentos.Create(nil); +end; + +{ + +Sample call + +You can try this function placing a ListBox and a button on a form and adding this code to the OnClick event of the button: + +procedure TForm1.Button1Click(Sender: TObject); +var + list: TStringList; +begin + list := FindFile('C:\Delphi\*.pas'); + ListBox1.Items.Assign(list); + list.Free; +end; +} + +{ srvGestorDocumentos } +function TsrvGestorDocumentos.DarListaFicheros(const Almacen: TRdxAlmacenes; const ID: Integer): StringArray; +var + Ruta: String; + ListaFicheros: TStringList; + i: Integer; + +begin + Ruta := DarRutaDocumentos; + try + case Almacen of + TRdxAlmacenes_Presupuestos: + begin + Ruta := Ruta + '\presupuestos\' + IntToStr(ID) + '\*.*'; + ListaFicheros := FindFile(Ruta); + Result := StringArray.Create(); + for i := 0 to ListaFicheros.Count - 1 do + Result.Add(ExtractFileName(ListaFicheros.Strings[i])); + end; + end; + + finally + if Assigned(ListaFicheros) then + FreeAndNil(ListaFicheros); + end; +end; + +function TsrvGestorDocumentos.DarRutaDocumentos: string; +var + AConfiguracionService : IsrvConfiguracion; + Intf : IInterface; + AClientID : TGUID; + Ruta: String; + +begin + CreateGUID(AClientID); + try + GetClassFactory('srvConfiguracion').CreateInstance(AClientID, Intf); + AConfiguracionService := Intf as IsrvConfiguracion; + Result := AConfiguracionService.darValor('RUTA'); + finally + AConfiguracionService := Nil; + end; +end; + +function TsrvGestorDocumentos.DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary; +var + Ruta: String; + +begin + Result := Binary.Create; + + try + Ruta := DarRutaDocumentos; + case Almacen of + TRdxAlmacenes_Presupuestos: + begin + Ruta := Ruta + '\presupuestos\' + IntToStr(ID) + '\' + NombreFichero; + Result.LoadFromFile(Ruta); + end; + end; + finally + // + end; +end; + +function TsrvGestorDocumentos.EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; +const NombreFichero: String): Boolean; +var + Ruta: String; + +begin + Result := False; + + try + Ruta := DarRutaDocumentos; + case Almacen of + TRdxAlmacenes_Presupuestos: + begin + Ruta := Ruta + '\presupuestos\' + IntToStr(ID) + '\' + NombreFichero; + Result := DeleteFile(Ruta); + end; + end; + finally + // + end; +end; + +function TsrvGestorDocumentos.SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; + const Fichero: Binary): Boolean; +var + Ruta: String; + +begin + Result := False; + try + Ruta := DarRutaDocumentos; + case Almacen of + TRdxAlmacenes_Presupuestos: + begin + Ruta := Ruta + '\presupuestos\' + IntToStr(ID) + '\' + NombreFichero; + Fichero.SaveToFile(Ruta); + Result := True; + end; + end; + finally + // + end; +end; + +initialization + TROClassFactory.Create('srvGestorDocumentos', Create_srvGestorDocumentos, TsrvGestorDocumentos_Invoker); + +finalization + +end. diff --git a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk index d7b4e52d68ec2c92e82a7051ce5b85b5b8329148..8d51711b566cf35d6b8910550f5f92cfba4a1807 100644 GIT binary patch delta 45 zcmaFP-OjTilSx5`mrFsxJ+-(bzsMy&ximL5uOz=XJ~=Delphi.Personality Package -FalseTrueFalseTrueFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0PresupuestosCliente_controller.dpk +FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0PresupuestosCliente_controller.dpk MainSource - - - - - + + + + + + @@ -68,7 +69,7 @@