diff --git a/Build/Build.fbp5 b/Build/Build.fbp5
index 25cac9af..7cfca2bf 100644
--- a/Build/Build.fbp5
+++ b/Build/Build.fbp5
@@ -6539,6 +6539,665 @@ Comments=
+
diff --git a/Database/ACANA.FDB b/Database/ACANA.FDB
index b0490d4c..d684889b 100644
Binary files a/Database/ACANA.FDB and b/Database/ACANA.FDB differ
diff --git a/Source/Base/Configuracion/uDataModuleConfiguracion.dfm b/Source/Base/Configuracion/uDataModuleConfiguracion.dfm
index 1f45ec7f..2f98e4e8 100644
--- a/Source/Base/Configuracion/uDataModuleConfiguracion.dfm
+++ b/Source/Base/Configuracion/uDataModuleConfiguracion.dfm
@@ -1,27 +1,10 @@
object dmConfiguracion: TdmConfiguracion
OldCreateOrder = False
Height = 160
- Width = 220
- object ROChannel: TROWinInetHTTPChannel
- UserAgent = 'RemObjects SDK'
- TargetURL = 'http://localhost:8099/bin'
- Login.Username = '123456'
- Login.Password = 'sa'
- KeepConnection = True
- ServerLocators = <>
- DispatchOptions = []
- Left = 42
- Top = 16
- end
- object ROMessage: TROBinMessage
- Left = 42
- Top = 88
- end
+ Width = 100
object RORemoteService: TRORemoteService
- Message = ROMessage
- Channel = ROChannel
ServiceName = 'srvConfiguracion'
- Left = 136
+ Left = 24
Top = 16
end
end
diff --git a/Source/Base/Configuracion/uDataModuleConfiguracion.pas b/Source/Base/Configuracion/uDataModuleConfiguracion.pas
index dda614ef..1ba6b9fd 100644
--- a/Source/Base/Configuracion/uDataModuleConfiguracion.pas
+++ b/Source/Base/Configuracion/uDataModuleConfiguracion.pas
@@ -4,7 +4,7 @@ interface
uses
SysUtils, Classes, uRORemoteService, uDADataTable,
- uDABINAdapter, uROClient, uROBinMessage, uROWinInetHttpChannel, IniFiles,
+ uDABINAdapter, uROClient, IniFiles,
uDADataStreamer;
const
@@ -12,13 +12,11 @@ const
type
TdmConfiguracion = class(TDataModule)
- ROChannel: TROWinInetHTTPChannel;
- ROMessage: TROBinMessage;
RORemoteService: TRORemoteService;
private
FIniFile : TIniFile;
public
- function DarValor(const CODIGO: String): Variant;
+ function DarValor(const CODIGO: String; const ValorPorDefecto: String = ''): Variant;
procedure LeerConfiguracion;
procedure SalvarConfiguracion;
constructor Create(AOwner: TComponent); override;
@@ -47,17 +45,19 @@ var
begin
inherited;
AIniFile := GetSpecialFolderPath(CSIDL_COMMON_APPDATA); //[All Users]\Application Data
- AIniFile := AIniFile + PathDelim + 'Rodax Software' + PathDelim + GetAppName + PathDelim;
+ AIniFile := AIniFile + PathDelim + GetAppName + PathDelim;
if not DirectoryExists(AIniFile) then
- ForceDirectories(AIniFile);
-
+ CreateDir(AIniFile);
+
FIniFile := TIniFile.Create(AIniFile + CONFIG_INI_FILE);
end;
-function TdmConfiguracion.DarValor(const CODIGO: String): Variant;
+function TdmConfiguracion.DarValor(const CODIGO: String; const ValorPorDefecto: String = ''): Variant;
begin
- Result := (RORemoteService as IsrvConfiguracion).DarValor(CODIGO);
+ RORemoteService.Channel := dmConexion.ROChannel;
+ RORemoteService.Message := dmConexion.ROMessage;
+ Result := (RORemoteService as IsrvConfiguracion).DarValor(CODIGO, ValorPorDefecto);
end;
destructor TdmConfiguracion.Destroy;
diff --git a/Source/Base/Utiles/uSistemaFunc.pas b/Source/Base/Utiles/uSistemaFunc.pas
index 5d792e77..cb24ff97 100644
--- a/Source/Base/Utiles/uSistemaFunc.pas
+++ b/Source/Base/Utiles/uSistemaFunc.pas
@@ -20,33 +20,45 @@
---------------------------------------------------------------------------
===============================================================================
}
-
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;
function DarFicheroTIFFTemporal : String;
-function DarFicheroExportar (var Fichero : String) : Boolean;
-function PreguntarFicheroExcelExportar (var Fichero : String) : Boolean;
+function DarFicheroHTMLTemporal : String;
+function DarFicheroExcelTemporal : String;
+function DarFicheroPDFTemporal : String; overload;
+function DarFicheroPDFTemporal(const AFileName : String) : String; overload;
function DarVersionFichero (Executable : String) : String;
function DarFechaFichero (Executable : String) : String;
procedure CopiarFichero(const Origen, Destino: string);
-procedure DoDelTree( TheDir : String);
procedure Deltree(DirToKill : String; KillChoosenDir : Boolean);
-function GetSpecialFolderPath(folder : integer) : string;
+function GetSpecialFolderPath(folder : integer) : string;
+function PreguntarRuta(const ATitulo: String; const AComentario: String; var ARuta: String): Boolean;
+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,
- StdCtrls, SHFolder;
+ Windows, Dialogs, JclFileUtils,
+ Messages, Graphics, Controls, Forms,
+ StdCtrls, SHFolder, cxShellBrowserDialog,
+ cxLookAndFeels, uStringsUtils;
+
function GetSpecialFolderPath(folder : integer) : string;
const
@@ -60,6 +72,18 @@ begin
Result := '';
end;
+procedure EscribirEnFichero (NombreFichero, Texto : string);
+var
+ FicheroAux : TextFile;
+begin
+ SysUtils.DeleteFile(NombreFichero);
+ AssignFile(FicheroAux, NombreFichero);
+ Rewrite(FicheroAux);
+ WriteLn(FicheroAux, Texto);
+ CloseFile(FicheroAux);
+end;
+
+
function Ejecutar (const LineaComando: String; Oculto, Esperar: Boolean): Boolean;
var
StartupInfo : TStartupInfo;
@@ -124,6 +148,30 @@ begin
Result := Copy(Cadena, 0, (Length(Cadena)-3)) + 'tif';
end;
+function DarFicheroPDFTemporal : String;
+var
+ Cadena : String;
+begin
+ Cadena := DarFicheroTemporal;
+ Result := Copy(Cadena, 0, (Length(Cadena)-3)) + 'pdf';
+end;
+
+function DarFicheroPDFTemporal(const AFileName : String) : String;
+var
+ Cadena : String;
+ RutaTmp : string;
+begin
+ if not EsCadenaVacia(AFileName) then
+ begin
+ RutaTmp := DarRutaTemporal;
+ Cadena := ExtractFileName(AFileName);
+ Cadena := StringReplace(Cadena, ExtractFileExt(Cadena), '', []);
+ Result := RutaTmp + Cadena + '.pdf';
+ end
+ else
+ Result := DarFicheroPDFTemporal;
+end;
+
function DarFicheroBMPTemporal : String;
var
Cadena : String;
@@ -132,6 +180,22 @@ begin
Result := Copy(Cadena, 0, (Length(Cadena)-3)) + 'bmp';
end;
+function DarFicheroExcelTemporal : String;
+var
+ Cadena : String;
+begin
+ Cadena := DarFicheroTemporal;
+ Result := Copy(Cadena, 0, (Length(Cadena)-3)) + 'xls';
+end;
+
+function DarFicheroHTMLTemporal : String;
+var
+ Cadena : String;
+begin
+ Cadena := DarFicheroTemporal;
+ Result := Copy(Cadena, 0, (Length(Cadena)-3)) + 'html';
+end;
+
function DarFicheroJPGTemporal : String;
var
Cadena : String;
@@ -140,7 +204,7 @@ begin
Result := Copy(Cadena, 0, (Length(Cadena)-3)) + 'jpg';
end;
-function DarFicheroExportar (var Fichero : String) : Boolean;
+function PreguntarFicheroWordExportar (var Fichero : String) : Boolean;
var
DialogoSalvar : TSaveDialog;
begin
@@ -161,6 +225,28 @@ begin
end;
end;
+function PreguntarFicheroExcelExportar (var Fichero : String) : Boolean;
+var
+ DialogoSalvar : TSaveDialog;
+begin
+ DialogoSalvar := TSaveDialog.Create(NIL);
+ try
+ with DialogoSalvar do
+ begin
+ DefaultExt := 'xls';
+ Filter := 'Documento de Excel (*.xls)|*.xls';
+ FilterIndex := 0;
+ Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist, ofEnableSizing];
+ end;
+ Result := DialogoSalvar.Execute;
+ if Result then
+ Fichero := DialogoSalvar.FileName;
+ finally
+ DialogoSalvar.Free;
+ end;
+end;
+
+
function DarVersionFichero (Executable : String) : String;
var
Obj : TJclFileVersionInfo;
@@ -173,27 +259,6 @@ begin
end;
end;
-function PreguntarFicheroExcelExportar (var Fichero : String) : Boolean;
-var
- DialogoSalvar : TSaveDialog;
-begin
- DialogoSalvar := TSaveDialog.Create(NIL);
- try
- with DialogoSalvar do
- begin
- DefaultExt := 'xls';
- Filter := 'Documento de Excel (*.xls)|*.xls';
- FilterIndex := 0;
- Options := [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist, ofEnableSizing];
- end;
- Result := DialogoSalvar.Execute;
- if Result then
- Fichero := DialogoSalvar.FileName;
- finally
- DialogoSalvar.Free;
- end;
-end;
-
function DarFechaFichero (Executable : String) : String;
var
FileTime, LocalFileTime : TFileTime;
@@ -271,5 +336,104 @@ begin
end;
+function PreguntarRuta(const ATitulo: String; const AComentario: String; var ARuta: String): Boolean;
+var
+ cxShellBrowserDialog1: TcxShellBrowserDialog;
+begin
+ cxShellBrowserDialog1 := TcxShellBrowserDialog.Create(NIL);
+ try
+ with cxShellBrowserDialog1 do
+ begin
+ Name := 'cxShellBrowserDialog1';
+ FolderLabelCaption := AComentario;
+ LookAndFeel.NativeStyle := True;
+ LookAndFeel.Kind := lfStandard;
+ Title := ATitulo;
+
+ Result := cxShellBrowserDialog1.Execute;
+ ARuta := cxShellBrowserDialog1.Path;
+ end;
+ finally
+ FreeANDNIL(cxShellBrowserDialog1);
+ end;
+end;
+
+
+function EscapeIllegalChars(AFileName: string): string;
+var
+ x: integer;
+const
+ IllegalCharSet: set of char =
+ ['|','<','>','\','^','+','=','?','/','[',']','"',';',',','*'];
+begin
+ for x := 1 to Length(AFileName) do
+ if AFileName[x] in IllegalCharSet then
+ AFileName[x] := '_';
+ 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.
-
\ No newline at end of file
diff --git a/Source/Base/Utiles/uStringsUtils.pas b/Source/Base/Utiles/uStringsUtils.pas
index 5ef88025..68ad7557 100644
--- a/Source/Base/Utiles/uStringsUtils.pas
+++ b/Source/Base/Utiles/uStringsUtils.pas
@@ -7,6 +7,7 @@ uses
const
DISPLAY_EUROS2 = '#,0.00 €';
+ DISPLAY_PORCENTAJE = '#,0.00%';
procedure StringToStrings(Source:string; Delimiter:char; Target:TStrings);
function StringsToString(Source:TStrings; Delimiter:char):string;
diff --git a/Source/GUIBase/GUIBase.dpk b/Source/GUIBase/GUIBase.dpk
index 8e11d17b..d1bd8b57 100644
Binary files a/Source/GUIBase/GUIBase.dpk and b/Source/GUIBase/GUIBase.dpk differ
diff --git a/Source/GUIBase/GUIBase.dproj b/Source/GUIBase/GUIBase.dproj
index 23343198..75f5b358 100644
--- a/Source/GUIBase/GUIBase.dproj
+++ b/Source/GUIBase/GUIBase.dproj
@@ -1,4 +1,5 @@
-
+
+
{0ca27a95-0b81-4724-84bf-8f8ed4e421ae}
GUIBase.dpk
@@ -57,23 +58,32 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -124,6 +134,10 @@
TFrame
+
+
+ TFrame
+
TFrame
@@ -160,6 +174,11 @@
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..f6a1d26a
--- /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 Acana\Source\Modulos\Gestion de documentos\Controller\GestorDocumentos_Controller.res */
+/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf36A.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..5b46d02f
--- /dev/null
+++ b/Source/Modulos/Gestion de documentos/Controller/uGestorDocumentosController.pas
@@ -0,0 +1,110 @@
+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);
+ function EliminarDirectorio(const ID: Integer): Boolean;
+ 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);
+ function EliminarDirectorio(const ID: Integer): Boolean;
+ 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;
+
+function TGestorDocumentosController.EliminarDirectorio(const ID: Integer): Boolean;
+begin
+ Result := FDataModule.EliminarID(ID);
+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 00000000..2e924952
Binary files /dev/null and b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dpk differ
diff --git a/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dproj b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dproj
new file mode 100644
index 00000000..db4c7b38
--- /dev/null
+++ b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.dproj
@@ -0,0 +1,540 @@
+
+
+
+ {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
+
+
+
+
+
+
+
+
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..0febc65f
--- /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 Acana\Source\Modulos\Gestion de documentos\Data\uDataModuleGestorDocumentos.dfm */
+/* C:\Codigo Acana\Source\Modulos\Gestion de documentos\Data\GestorDocumentos_data.res */
+/* C:\DOCUME~1\Usuario\CONFIG~1\Temp\dtf368.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 00000000..8b251f31
Binary files /dev/null and b/Source/Modulos/Gestion de documentos/Data/GestorDocumentos_data.res differ
diff --git a/Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.dfm b/Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.dfm
new file mode 100644
index 00000000..63d42a2e
--- /dev/null
+++ b/Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.dfm
@@ -0,0 +1,16 @@
+inherited DataModuleGestorDocumentos: TDataModuleGestorDocumentos
+ OnCreate = DAClientDataModuleCreate
+ Height = 182
+ Width = 218
+ object Bin2DataStreamer: TDABin2DataStreamer
+ Left = 56
+ Top = 84
+ end
+ object RORemoteService: TRORemoteService
+ Message = dmConexion.ROMessage
+ Channel = dmConexion.ROChannel
+ ServiceName = 'srvGestorDocumentos'
+ Left = 56
+ Top = 24
+ end
+end
diff --git a/Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.pas b/Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.pas
new file mode 100644
index 00000000..0a58a60a
--- /dev/null
+++ b/Source/Modulos/Gestion de documentos/Data/uDataModuleGestorDocumentos.pas
@@ -0,0 +1,115 @@
+unit uDataModuleGestorDocumentos;
+
+interface
+
+uses
+ DB, uDataModuleBase, uROClient, uRORemoteService, Classes, uDADataStreamer,
+ uDABin2DataStreamer, uROTypes, uDADataTable;
+
+type
+ IDataModuleGestorDocumentos = interface
+ ['{03537996-181D-428C-9B1D-56B499F0048E}']
+ 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;
+ function EliminarFichero(const ID : Integer; const NombreFichero: String): Boolean;
+ function EliminarID(const ID : Integer): Boolean;
+ end;
+
+ TDataModuleGestorDocumentos = class(TDataModuleBase, IDataModuleGestorDocumentos)
+ Bin2DataStreamer: TDABin2DataStreamer;
+ RORemoteService: TRORemoteService;
+ procedure DAClientDataModuleCreate(Sender: TObject);
+
+ protected
+ procedure AsignarClaseNegocio(APresupuesto: TDADataTable); virtual;
+
+ public
+ 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;
+ function EliminarFichero(const ID : Integer; const NombreFichero: String): Boolean;
+ function EliminarID(const ID : Integer): Boolean;
+ end;
+
+implementation
+{$R *.DFM}
+
+uses
+ SysUtils, FactuGES_Intf, uDataModuleConexion, DataAbstract4_Intf;
+
+{ TdmGestorDocumentos }
+
+procedure TDataModuleGestorDocumentos.AsignarClaseNegocio(APresupuesto: TDADataTable);
+begin
+//
+end;
+
+procedure TDataModuleGestorDocumentos.DAClientDataModuleCreate(Sender: TObject);
+begin
+ RORemoteService.Channel := dmConexion.Channel;
+ RORemoteService.Message := dmConexion.Message;
+end;
+
+function TDataModuleGestorDocumentos.DarListaDocumentos(const ID: Integer): TStringList;
+var
+ AResultado : StringArray;
+ i: Integer;
+begin
+ try
+ AResultado := (RORemoteService as IsrvGestorDocumentos).DarListaFicheros(TRdxAlmacenes_Presupuestos, ID);
+ Result := TStringList.Create;
+ for i:= 0 to AResultado.Count - 1 do
+ Result.Add(AResultado.Items[i]);
+ finally
+ FreeANDNIL(AResultado)
+ end;
+end;
+
+function TDataModuleGestorDocumentos.DescargarFichero(const ID: Integer; const NombreFichero: String;
+const DestinoFichero: String): Boolean;
+var
+ AFichero: Binary;
+
+begin
+ Result := False;
+ try
+ AFichero := (RORemoteService as IsrvGestorDocumentos).DescargarFichero(TRdxAlmacenes_Presupuestos, ID, NombreFichero);
+ AFichero.SaveToFile((DestinoFichero + NombreFichero));
+ Result := True;
+ finally
+ FreeAndNil(AFichero);
+ end;
+end;
+
+function TDataModuleGestorDocumentos.EliminarFichero(const ID: Integer; const NombreFichero: String): Boolean;
+begin
+ Result := False;
+ try
+ Result := (RORemoteService as IsrvGestorDocumentos).EliminarFichero(TRdxAlmacenes_Presupuestos, ID, NombreFichero);
+ finally
+ //
+ end;
+end;
+
+function TDataModuleGestorDocumentos.EliminarID(const ID: Integer): Boolean;
+begin
+ Result := False;
+ try
+ Result := (RORemoteService as IsrvGestorDocumentos).EliminarID(TRdxAlmacenes_Presupuestos, ID);
+ finally
+ //
+ end;
+end;
+
+function TDataModuleGestorDocumentos.SubirFichero(const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
+begin
+ Result := False;
+ try
+ Result := (RORemoteService as IsrvGestorDocumentos).SubirFichero(TRdxAlmacenes_Presupuestos, ID, NombreFichero, Fichero);
+ finally
+ //
+ end;
+end;
+
+end.
diff --git a/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.dfm b/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.dfm
new file mode 100644
index 00000000..b491e840
--- /dev/null
+++ b/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.dfm
@@ -0,0 +1,6 @@
+object srvGestorDocumentos: TsrvGestorDocumentos
+ OldCreateOrder = True
+ ExportedDataTables = <>
+ 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..d37745d4
--- /dev/null
+++ b/Source/Modulos/Gestion de documentos/Servidor/srvGestorDocumentos_Impl.pas
@@ -0,0 +1,222 @@
+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;
+ function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
+ end;
+
+implementation
+
+{$R *.dfm}
+uses
+ {Generated:} FactuGES_Invk, srvConfiguracion_Impl, uSistemaFunc, Dialogs, Forms;
+
+const
+ CTE_VALOR = 'RUTA_DOCUMENTOS';
+ CTE_DOCUMENTOS = 'DOCUMENTOS';
+ CTE_ALMACEN_PRESUPUESTOS = '\Presupuestos\';
+
+
+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 + CTE_ALMACEN_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(CTE_VALOR, (ExtractFilePath(Application.ExeName) + CTE_DOCUMENTOS));
+ 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 + CTE_ALMACEN_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 + CTE_ALMACEN_PRESUPUESTOS + IntToStr(ID) + '\' + NombreFichero;
+ if FileExists(Ruta) then
+ Result := DeleteFile(Ruta)
+ else
+ Result := True; //Ya ha sido borrado
+ end;
+ end;
+ finally
+ //
+ end;
+end;
+
+function TsrvGestorDocumentos.EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
+var
+ Ruta: String;
+
+begin
+ Result := False;
+
+ try
+ Ruta := DarRutaDocumentos;
+ case Almacen of
+ TRdxAlmacenes_Presupuestos:
+ begin
+ Ruta := Ruta + CTE_ALMACEN_PRESUPUESTOS + IntToStr(ID);
+ if DirectoryExists(Ruta) then
+ Deltree(Ruta, True);
+ Result := True;
+ 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;
+ if not DirectoryExists(Ruta) then
+ CreateDir(Ruta);
+
+ case Almacen of
+ TRdxAlmacenes_Presupuestos:
+ begin
+ Ruta := Ruta + CTE_ALMACEN_PRESUPUESTOS;
+ if not DirectoryExists(Ruta) then
+ CreateDir(Ruta);
+
+ Ruta := Ruta + IntToStr(ID);
+ if not DirectoryExists(Ruta) then
+ CreateDir(Ruta);
+
+ Ruta := Ruta + '\' + 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 d7b4e52d..8d51711b 100644
Binary files a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk and b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dpk differ
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj
index 26885cfb..4ed493a5 100644
--- a/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj
+++ b/Source/Modulos/Presupuestos de cliente/Controller/PresupuestosCliente_controller.dproj
@@ -42,18 +42,19 @@
Delphi.Personality
Package
-FalseTrueFalseTrueFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0PresupuestosCliente_controller.dpk
+FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0PresupuestosCliente_controller.dpk
MainSource
-
-
-
-
-
+
+
+
+
+
+
@@ -548,4 +549,4 @@ mtException_AntiFreeze0="The application seems to be frozen."
Count mtInvalidEmailMsg=1
mtInvalidEmailMsg0="Invalid email."
TextsCollection=English
-EurekaLog Last Line -->
\ No newline at end of file
+EurekaLog Last Line -->
diff --git a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas
index bbc3e2b2..182aaac8 100644
--- a/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas
+++ b/Source/Modulos/Presupuestos de cliente/Controller/uPresupuestosClienteController.pas
@@ -6,7 +6,8 @@ interface
uses
SysUtils, uDADataTable, uEditorDBItem,
uControllerBase, uIDataModulePresupuestosCliente, uClientesController,
- uDetallesPresupuestoClienteController, uBizPresupuestosCliente, uBizDireccionesContacto,
+ uDetallesPresupuestoClienteController, uGestorDocumentosController,
+ uBizPresupuestosCliente, uBizDireccionesContacto,
uBizDetallesPresupuestoCliente;
type
@@ -20,6 +21,11 @@ type
procedure SetDetallesController(const Value: IDetallesPresupuestoClienteController);
property DetallesController: IDetallesPresupuestoClienteController read GetDetallesController write SetDetallesController;
+ //GESTION_DOCUMENTOS
+ function GetGestorDocumentosController: IGestorDocumentosController;
+ procedure SetGestorDocumentosController(const Value: IGestorDocumentosController);
+ property GestorDocumentosController: IGestorDocumentosController read GetGestorDocumentosController write SetGestorDocumentosController;
+
procedure RecuperarCliente(APresupuesto : IBizPresupuestoCliente);
function Buscar(const ID: Integer): IBizPresupuestoCliente;
function BuscarTodos: IBizPresupuestoCliente;
@@ -58,12 +64,17 @@ type
FDataModule : IDataModulePresupuestosCliente;
FClienteController : IClientesController;
FDetallesController : IDetallesPresupuestoClienteController;
+ FGestorDocumentosController : IGestorDocumentosController;
function GetClienteController: IClientesController;
procedure SetClienteController(const Value: IClientesController);
function GetDetallesController: IDetallesPresupuestoClienteController;
procedure SetDetallesController(const Value: IDetallesPresupuestoClienteController);
+ //GESTION_DOCUMENTOS
+ function GetGestorDocumentosController: IGestorDocumentosController;
+ procedure SetGestorDocumentosController(const Value: IGestorDocumentosController);
+
//Estos son los tres métodos a sobre escribir si se desea heredar toda la logica de
//este controller
procedure AsignarDataModule; virtual;
@@ -77,6 +88,7 @@ type
public
property ClienteController: IClientesController read GetClienteController write SetClienteController;
property DetallesController: IDetallesPresupuestoClienteController read GetDetallesController write SetDetallesController;
+ property GestorDocumentosController: IGestorDocumentosController read GetGestorDocumentosController write SetGestorDocumentosController;
constructor Create; override;
destructor Destroy; override;
@@ -222,6 +234,10 @@ begin
FClienteController := TClientesController.Create;
FDetallesController := TDetallesPresupuestoClienteController.Create;
+
+ //GESTION_DOCUMENTOS
+ FGestorDocumentosController := TGestorDocumentosController.Create;
+
FDetallesController.addObservador(Self);
end;
@@ -252,6 +268,9 @@ begin
FDataModule := Nil;
FClienteController := Nil;
FDetallesController := Nil;
+
+ //GESTION_DOCUMENTOS
+ FGestorDocumentosController := Nil;
inherited;
end;
@@ -477,6 +496,9 @@ begin
//Siempre eliminaremos el seleccionado
if EsEliminable(APresupuesto) then
begin
+ //GESTION_DOCUMENTOS
+ FGestorDocumentosController.EliminarDirectorio(APresupuesto.ID);
+
APresupuesto.Delete;
bEliminado := True;
end;
@@ -491,6 +513,9 @@ begin
begin
if EsEliminable(APresupuesto) then
begin
+ //GESTION_DOCUMENTOS
+ FGestorDocumentosController.EliminarDirectorio(APresupuesto.ID);
+
APresupuesto.Delete;
bEliminado := True
end
@@ -641,6 +666,11 @@ begin
FDetallesController := Value;
end;
+procedure TPresupuestosClienteController.SetGestorDocumentosController(const Value: IGestorDocumentosController);
+begin
+ FGestorDocumentosController := Value;
+end;
+
{procedure TPresupuestosClienteController.SetID_Tienda(APresupuesto: IBizPresupuestoCliente; const ID_Tienda: Integer; Tienda: Variant);
var
EnEdicion: Boolean;
@@ -846,4 +876,9 @@ begin
Result := FDetallesController;
end;
+function TPresupuestosClienteController.GetGestorDocumentosController: IGestorDocumentosController;
+begin
+ Result := FGestorDocumentosController;
+end;
+
end.
diff --git a/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj b/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
index 7940ae19..3aafe21f 100644
--- a/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
+++ b/Source/Modulos/Presupuestos de cliente/PresupuestosCliente_Group.groupproj
@@ -14,6 +14,8 @@
+
+
@@ -107,6 +109,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -162,13 +182,13 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk
index 818243b1..72f72c02 100644
Binary files a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk and b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dpk differ
diff --git a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj
index d4e0b56d..f9159cb3 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj
+++ b/Source/Modulos/Presupuestos de cliente/Views/PresupuestosCliente_view.dproj
@@ -1,4 +1,5 @@
-
+
+
{9e558626-cf49-4cff-a178-e12c186758ac}
PresupuestosCliente_view.dpk
@@ -41,9 +42,7 @@
Delphi.Personality
Package
-FalseTrueFalseTrueFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0
-
-
+FalseTrueFalseFalseFalseFalseTrueFalse1000FalseFalseFalseFalseFalse308212521.0.0.01.0.0.0
Intraweb 8.0 Design Package for Borland Development Studio 2006
PresupuestosCliente_view.dpk
@@ -52,12 +51,23 @@
MainSource
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TfEditorElegirArticulosPedidoCliente
@@ -83,6 +93,10 @@
TFrame
+
+
+ TFrame
+
TFrame
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm
index 9151bac5..4d109859 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm
+++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.dfm
@@ -227,6 +227,7 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
inherited cxGrid: TcxGrid
Width = 660
Height = 359
+ ExplicitTop = 72
ExplicitWidth = 660
ExplicitHeight = 359
end
@@ -243,10 +244,6 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
object pagInicidencias: TTabSheet
Caption = 'Incidencias'
ImageIndex = 2
- ExplicitLeft = 0
- ExplicitTop = 0
- ExplicitWidth = 0
- ExplicitHeight = 0
inline frViewIncidenciasCli: TfrViewIncidencias
Left = 0
Top = 0
@@ -320,6 +317,37 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Width = 660
end
end
+ object pagDocumentos: TTabSheet
+ Caption = 'Documentos'
+ ImageIndex = 5
+ inline frViewDocumentosPresupuestoCliente1: TfrViewDocumentosPresupuestoCliente
+ Left = 0
+ Top = 0
+ Width = 660
+ Height = 431
+ Align = alClient
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 0
+ ReadOnly = False
+ ExplicitWidth = 660
+ ExplicitHeight = 431
+ inherited TBXDock: TTBXDock
+ Width = 660
+ ExplicitWidth = 660
+ end
+ inherited ListView1: TListView
+ Width = 660
+ Height = 408
+ ExplicitWidth = 660
+ ExplicitHeight = 408
+ end
+ end
+ end
end
inherited StatusBar: TJvStatusBar
Top = 612
@@ -386,8 +414,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 164
ExplicitTop = 112
- ExplicitWidth = 93
- Width = 93
+ ExplicitWidth = 153
+ Width = 153
end
inherited ImporteIVA: TcxDBCurrencyEdit
Left = 521
@@ -395,8 +423,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 521
ExplicitTop = 38
- ExplicitWidth = 137
- Width = 137
+ ExplicitWidth = 142
+ Width = 142
end
inherited ImporteTotal: TcxDBCurrencyEdit
Left = 451
@@ -404,8 +432,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 451
ExplicitTop = 112
- ExplicitWidth = 137
- Width = 137
+ ExplicitWidth = 212
+ Width = 212
end
inherited edtDescuento: TcxDBSpinEdit
Left = 93
@@ -427,8 +455,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 450
ExplicitTop = 11
- ExplicitWidth = 92
- Width = 92
+ ExplicitWidth = 213
+ Width = 213
end
inherited edtRE: TcxDBSpinEdit
Left = 450
@@ -447,8 +475,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 521
ExplicitTop = 65
- ExplicitWidth = 56
- Width = 56
+ ExplicitWidth = 142
+ Width = 142
end
inherited eImporteNeto: TcxDBCurrencyEdit
Left = 93
@@ -456,8 +484,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 93
ExplicitTop = 11
- ExplicitWidth = 147
- Width = 147
+ ExplicitWidth = 224
+ Width = 224
end
inherited ePorte: TcxDBCurrencyEdit
Left = 93
@@ -466,8 +494,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
Style.IsFontAssigned = True
ExplicitLeft = 93
ExplicitTop = 139
- ExplicitWidth = 147
- Width = 147
+ ExplicitWidth = 224
+ Width = 224
end
inherited eIVA: TcxDBLookupComboBox
Left = 93
@@ -476,8 +504,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
DataBinding.DataSource = nil
ExplicitLeft = 93
ExplicitTop = 38
- ExplicitWidth = 81
- Width = 81
+ ExplicitWidth = 86
+ Width = 86
end
inherited bTiposIVA: TButton
Left = 185
@@ -491,8 +519,8 @@ inherited fEditorPresupuestoCliente: TfEditorPresupuestoCliente
DataBinding.DataField = ''
ExplicitLeft = 93
ExplicitTop = 65
- ExplicitWidth = 219
- Width = 219
+ ExplicitWidth = 224
+ Width = 224
end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
inherited dxLayoutControl1Group1: TdxLayoutGroup
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas
index 32b0e0b4..fa1a30bd 100644
--- a/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas
+++ b/Source/Modulos/Presupuestos de cliente/Views/uEditorPresupuestoCliente.pas
@@ -16,7 +16,10 @@ uses
dxLayoutLookAndFeels, JvExComCtrls, JvStatusBar, uViewTotales,
uIEditorPresupuestoCliente, uBizPresupuestosCliente, uViewPresupuestoCliente,
uViewDetallesDTO, uViewDetallesArticulos, uViewDetallesPresupuestoCliente,
- uDAInterfaces, cxRichEdit, cxDBRichEdit;
+ uDAInterfaces, cxRichEdit, cxDBRichEdit, dxSkinsCore, dxSkinBlack, dxSkinBlue,
+ dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
+ dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinSilver,
+ dxSkinsDefaultPainters, uViewDocumentos, uViewDocumentosPresupuestoCliente;
type
TfEditorPresupuestoCliente = class(TfEditorDBItem, IEditorPresupuestoCliente)
@@ -31,6 +34,8 @@ type
pagMemoria: TTabSheet;
cxDBMemo1: TcxDBMemo;
edtPortada: TcxDBRichEdit;
+ pagDocumentos: TTabSheet;
+ frViewDocumentosPresupuestoCliente1: TfrViewDocumentosPresupuestoCliente;
procedure FormShow(Sender: TObject);
procedure CustomEditorClose(Sender: TObject; var Action: TCloseAction);
@@ -114,6 +119,9 @@ procedure TfEditorPresupuestoCliente.CustomEditorClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
+ //GESTION_DOCUMENTOS
+ //Este método eliminará el directorio temporal si se ha creado
+ frViewDocumentosPresupuestoCliente1.actEliminarTodo.Execute;
FViewPresupuesto := NIL;
FPresupuesto := NIL;
end;
@@ -186,6 +194,11 @@ begin
frViewDetallesPresupuestoCliente1.BeginUpdate;
try
bEsNuevo := FPresupuesto.EsNuevo;
+
+ //GESTION_DOCUMENTOS
+ if FController.Guardar(FPresupuesto) then
+ frViewDocumentosPresupuestoCliente1.actActualizarServidor.Execute;
+
FController.Guardar(FPresupuesto);
finally
frViewDetallesPresupuestoCliente1.EndUpdate;
@@ -288,6 +301,9 @@ begin
ViewPresupuesto.Controller := Controller;
ViewPresupuesto.ViewClientePresupuesto.Controller := Controller.ClienteController;
frViewDetallesPresupuestoCliente1.Controller := Controller.DetallesController;
+
+ //GESTION_DOCUMENTOS
+ frViewDocumentosPresupuestoCliente1.Controller := Controller;
end;
end;
@@ -307,6 +323,9 @@ begin
ViewPresupuesto.ViewClientePresupuesto.OnClienteChanged := OnClienteChanged;
frViewDetallesPresupuestoCliente1.Detalles := FPresupuesto.Detalles;
frViewDetallesPresupuestoCliente1.Presupuesto := FPresupuesto; //Para poder sacar los descuento del articulos segun el cliente seleccionado
+
+ //GESTION_DOCUMENTOS
+ frViewDocumentosPresupuestoCliente1.Presupuesto := FPresupuesto;
end;
end;
end;
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.dfm b/Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.dfm
new file mode 100644
index 00000000..2da44d07
--- /dev/null
+++ b/Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.dfm
@@ -0,0 +1,2 @@
+inherited frViewDocumentosPresupuestoCliente: TfrViewDocumentosPresupuestoCliente
+end
diff --git a/Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.pas b/Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.pas
new file mode 100644
index 00000000..381f6e1a
--- /dev/null
+++ b/Source/Modulos/Presupuestos de cliente/Views/uViewDocumentosPresupuestoCliente.pas
@@ -0,0 +1,100 @@
+unit uViewDocumentosPresupuestoCliente;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, uViewDocumentos, ActnList,
+ TB2Item, TBX, TB2Dock, TB2Toolbar, cxControls, cxContainer,
+ uBizPresupuestosCliente, uPresupuestosClienteController, ImgList,
+ PngImageList, ComCtrls, Menus;
+
+type
+ IViewDocumentosPresupuestoCliente = interface
+ ['{564599A5-ECEB-4A1F-8791-22B37282A11C}']
+ function GetController : IPresupuestosClienteController;
+ procedure SetController (const Value : IPresupuestosClienteController);
+ property Controller : IPresupuestosClienteController read GetController write SetController;
+
+ function GetPresupuesto: IBizPresupuestoCliente;
+ procedure SetPresupuesto(const Value: IBizPresupuestoCliente);
+ property Presupuesto: IBizPresupuestoCliente read GetPresupuesto write SetPresupuesto;
+ end;
+
+ TfrViewDocumentosPresupuestoCliente = class(TfrViewDocumentos, IViewDocumentosPresupuestoCliente)
+ private
+ FController : IPresupuestosClienteController;
+ FPresupuesto: IBizPresupuestoCliente;
+ function GetController : IPresupuestosClienteController;
+ procedure SetController (const Value : IPresupuestosClienteController);
+ function GetPresupuesto: IBizPresupuestoCliente;
+ procedure SetPresupuesto(const Value: IBizPresupuestoCliente);
+
+ protected
+ procedure Sincronizar; override;
+ function RecuperarFicheroServidor(const NombreFichero: String; const DirectorioDestino: String): Boolean; override;
+
+ public
+ property Controller : IPresupuestosClienteController read GetController write SetController;
+ property Presupuesto: IBizPresupuestoCliente read GetPresupuesto write SetPresupuesto;
+
+ end;
+
+var
+ frViewDocumentosPresupuestoCliente: TfrViewDocumentosPresupuestoCliente;
+
+implementation
+{$R *.dfm}
+
+{ TfrViewDocumentosPresupuesto }
+
+function TfrViewDocumentosPresupuestoCliente.GetController: IPresupuestosClienteController;
+begin
+ Result := FController;
+end;
+
+function TfrViewDocumentosPresupuestoCliente.GetPresupuesto: IBizPresupuestoCliente;
+begin
+ Result := FPresupuesto;
+end;
+
+function TfrViewDocumentosPresupuestoCliente.RecuperarFicheroServidor(const NombreFichero: String; const DirectorioDestino: String): Boolean;
+begin
+ inherited;
+ Result := Controller.GestorDocumentosController.DescargarFichero(Presupuesto.ID, NombreFichero, DirectorioDestino);
+end;
+
+procedure TfrViewDocumentosPresupuestoCliente.SetController(const Value: IPresupuestosClienteController);
+begin
+ FController := Value;
+end;
+
+procedure TfrViewDocumentosPresupuestoCliente.SetPresupuesto(const Value: IBizPresupuestoCliente);
+begin
+ FPresupuesto := Value;
+ //Inicializamos la lista de documentos local con los ficheros del servidor
+ if Assigned(FPresupuesto) and Assigned(FController) then
+ ListaFicheros := Controller.GestorDocumentosController.DarListaDocumentos(Presupuesto.ID);
+
+ RefrescarVisualizador;
+end;
+
+procedure TfrViewDocumentosPresupuestoCliente.Sincronizar;
+begin
+ inherited;
+
+//De momento el action actSincronizar con el servidor estará oculto y se activa, hay que tener en cuenta lo comentado
+{
+ if Presupuesto.EsNuevo then
+ begin
+ if (ShowConfirmMessage('Se han producido cambios', 'Se han producido cambios y no se puede sincronizar hasta que no se guarden.' + #10#13 +
+ '¿Desea guardarlos ahora?') = IDYES) then
+ actGuardar.Execute
+ else
+ ShowInfoMessage('Recuerde guardar los cambios si quiere previsualizar o imprimir.');
+ end;
+}
+ Controller.GestorDocumentosController.SincronizarDocumentos(Presupuesto.ID, ListaFicheros, Directorio);
+end;
+
+end.
diff --git a/Source/Servicios/FactuGES.RODL b/Source/Servicios/FactuGES.RODL
index 3b2a450e..2f17b084 100644
--- a/Source/Servicios/FactuGES.RODL
+++ b/Source/Servicios/FactuGES.RODL
@@ -118,6 +118,8 @@
+
+
@@ -507,6 +509,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -527,6 +596,12 @@
+
+
+
+
+
+
diff --git a/Source/Servicios/FactuGES_Intf.pas b/Source/Servicios/FactuGES_Intf.pas
index 25f3c52e..83ecea30 100644
--- a/Source/Servicios/FactuGES_Intf.pas
+++ b/Source/Servicios/FactuGES_Intf.pas
@@ -51,6 +51,7 @@ const
IsrvUnidadesMedida_IID : TGUID = '{C1B36FAB-7514-40D2-A20C-04A86C9E71AB}';
IsrvComisiones_IID : TGUID = '{B600E9A1-28EC-484E-A74D-B5BB96FDF20A}';
IsrvProvinciasPoblaciones_IID : TGUID = '{C9925D63-0F5F-4546-8657-54F59FE51359}';
+ IsrvGestorDocumentos_IID : TGUID = '{A057EA3B-F714-4899-B6DA-1E4C8696ADC7}';
{ Event ID's }
@@ -84,6 +85,7 @@ type
IsrvUnidadesMedida = interface;
IsrvComisiones = interface;
IsrvProvinciasPoblaciones = interface;
+ IsrvGestorDocumentos = interface;
TRdxEmpresasArray = class;
@@ -92,6 +94,7 @@ type
{ Enumerateds }
+ TRdxAlmacenes = (TRdxAlmacenes_Presupuestos);
{ TRdxLoginInfo }
TRdxLoginInfo = class(TROComplexType)
@@ -263,7 +266,7 @@ type
{ IsrvConfiguracion }
IsrvConfiguracion = interface(IDataAbstractService)
['{0882B8A4-C8AA-424E-8FC1-C6226B670522}']
- function darValor(const CODIGO: String): String;
+ function darValor(const CODIGO: String; const ValorPorDefecto: String): String;
end;
{ CosrvConfiguracion }
@@ -276,7 +279,7 @@ type
protected
function __GetInterfaceName:string; override;
- function darValor(const CODIGO: String): String;
+ function darValor(const CODIGO: String; const ValorPorDefecto: String): String;
end;
{ IsrvFamilias }
@@ -700,6 +703,33 @@ type
function DarListaPoblaciones(const ID_Provincia: Integer): Binary;
end;
+ { IsrvGestorDocumentos }
+ IsrvGestorDocumentos = interface(IDataAbstractService)
+ ['{A057EA3B-F714-4899-B6DA-1E4C8696ADC7}']
+ 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;
+ function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
+ end;
+
+ { CosrvGestorDocumentos }
+ CosrvGestorDocumentos = class
+ class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvGestorDocumentos;
+ end;
+
+ { TsrvGestorDocumentos_Proxy }
+ TsrvGestorDocumentos_Proxy = class(TDataAbstractService_Proxy, IsrvGestorDocumentos)
+ protected
+ function __GetInterfaceName:string; override;
+
+ 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;
+ function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
+ end;
+
implementation
uses
@@ -1170,11 +1200,12 @@ begin
result := 'srvConfiguracion';
end;
-function TsrvConfiguracion_Proxy.darValor(const CODIGO: String): String;
+function TsrvConfiguracion_Proxy.darValor(const CODIGO: String; const ValorPorDefecto: String): String;
begin
try
__Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'darValor');
__Message.Write('CODIGO', TypeInfo(String), CODIGO, []);
+ __Message.Write('ValorPorDefecto', TypeInfo(String), ValorPorDefecto, []);
__Message.Finalize;
__TransportChannel.Dispatch(__Message);
@@ -1858,6 +1889,111 @@ begin
end
end;
+{ CosrvGestorDocumentos }
+
+class function CosrvGestorDocumentos.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IsrvGestorDocumentos;
+begin
+ result := TsrvGestorDocumentos_Proxy.Create(aMessage, aTransportChannel);
+end;
+
+{ TsrvGestorDocumentos_Proxy }
+
+function TsrvGestorDocumentos_Proxy.__GetInterfaceName:string;
+begin
+ result := 'srvGestorDocumentos';
+end;
+
+function TsrvGestorDocumentos_Proxy.DarListaFicheros(const Almacen: TRdxAlmacenes; const ID: Integer): StringArray;
+begin
+ try
+ result := nil;
+ __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DarListaFicheros');
+ __Message.Write('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Write('ID', TypeInfo(Integer), ID, []);
+ __Message.Finalize;
+
+ __TransportChannel.Dispatch(__Message);
+
+ __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []);
+ finally
+ __Message.UnsetAttributes(__TransportChannel);
+ __Message.FreeStream;
+ end
+end;
+
+function TsrvGestorDocumentos_Proxy.DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary;
+begin
+ try
+ result := nil;
+ __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'DescargarFichero');
+ __Message.Write('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Write('ID', TypeInfo(Integer), ID, []);
+ __Message.Write('NombreFichero', TypeInfo(String), NombreFichero, []);
+ __Message.Finalize;
+
+ __TransportChannel.Dispatch(__Message);
+
+ __Message.Read('Result', TypeInfo(Binary), result, []);
+ finally
+ __Message.UnsetAttributes(__TransportChannel);
+ __Message.FreeStream;
+ end
+end;
+
+function TsrvGestorDocumentos_Proxy.SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean;
+begin
+ try
+ __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'SubirFichero');
+ __Message.Write('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Write('ID', TypeInfo(Integer), ID, []);
+ __Message.Write('NombreFichero', TypeInfo(String), NombreFichero, []);
+ __Message.Write('Fichero', TypeInfo(Binary), Fichero, []);
+ __Message.Finalize;
+
+ __TransportChannel.Dispatch(__Message);
+
+ __Message.Read('Result', TypeInfo(Boolean), result, []);
+ finally
+ __Message.UnsetAttributes(__TransportChannel);
+ __Message.FreeStream;
+ end
+end;
+
+function TsrvGestorDocumentos_Proxy.EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Boolean;
+begin
+ try
+ __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'EliminarFichero');
+ __Message.Write('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Write('ID', TypeInfo(Integer), ID, []);
+ __Message.Write('NombreFichero', TypeInfo(String), NombreFichero, []);
+ __Message.Finalize;
+
+ __TransportChannel.Dispatch(__Message);
+
+ __Message.Read('Result', TypeInfo(Boolean), result, []);
+ finally
+ __Message.UnsetAttributes(__TransportChannel);
+ __Message.FreeStream;
+ end
+end;
+
+function TsrvGestorDocumentos_Proxy.EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean;
+begin
+ try
+ __Message.InitializeRequestMessage(__TransportChannel, 'FactuGES', __InterfaceName, 'EliminarID');
+ __Message.Write('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Write('ID', TypeInfo(Integer), ID, []);
+ __Message.Finalize;
+
+ __TransportChannel.Dispatch(__Message);
+
+ __Message.Read('Result', TypeInfo(Boolean), result, []);
+ finally
+ __Message.UnsetAttributes(__TransportChannel);
+ __Message.FreeStream;
+ end
+end;
+
initialization
RegisterROClass(TRdxLoginInfo);
RegisterROClass(TRdxEmpresasArray);
@@ -1889,6 +2025,7 @@ initialization
RegisterProxyClass(IsrvUnidadesMedida_IID, TsrvUnidadesMedida_Proxy);
RegisterProxyClass(IsrvComisiones_IID, TsrvComisiones_Proxy);
RegisterProxyClass(IsrvProvinciasPoblaciones_IID, TsrvProvinciasPoblaciones_Proxy);
+ RegisterProxyClass(IsrvGestorDocumentos_IID, TsrvGestorDocumentos_Proxy);
finalization
@@ -1922,5 +2059,6 @@ finalization
UnregisterProxyClass(IsrvUnidadesMedida_IID);
UnregisterProxyClass(IsrvComisiones_IID);
UnregisterProxyClass(IsrvProvinciasPoblaciones_IID);
+ UnregisterProxyClass(IsrvGestorDocumentos_IID);
end.
diff --git a/Source/Servicios/FactuGES_Invk.pas b/Source/Servicios/FactuGES_Invk.pas
index c4891ba1..ec6a85ad 100644
--- a/Source/Servicios/FactuGES_Invk.pas
+++ b/Source/Servicios/FactuGES_Invk.pas
@@ -218,6 +218,17 @@ type
procedure Invoke_DarListaPoblaciones(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
end;
+ TsrvGestorDocumentos_Invoker = class(TDataAbstractService_Invoker)
+ private
+ protected
+ published
+ procedure Invoke_DarListaFicheros(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+ procedure Invoke_DescargarFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+ procedure Invoke_SubirFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+ procedure Invoke_EliminarFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+ procedure Invoke_EliminarID(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+ end;
+
implementation
uses
@@ -390,15 +401,17 @@ end;
{ TsrvConfiguracion_Invoker }
procedure TsrvConfiguracion_Invoker.Invoke_darValor(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
-{ function darValor(const CODIGO: String): String; }
+{ function darValor(const CODIGO: String; const ValorPorDefecto: String): String; }
var
CODIGO: String;
+ ValorPorDefecto: String;
lResult: String;
begin
try
__Message.Read('CODIGO', TypeInfo(String), CODIGO, []);
+ __Message.Read('ValorPorDefecto', TypeInfo(String), ValorPorDefecto, []);
- lResult := (__Instance as IsrvConfiguracion).darValor(CODIGO);
+ lResult := (__Instance as IsrvConfiguracion).darValor(CODIGO, ValorPorDefecto);
__Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvConfiguracion', 'darValorResponse');
__Message.Write('Result', TypeInfo(String), lResult, []);
@@ -1013,5 +1026,149 @@ begin
end;
end;
+{ TsrvGestorDocumentos_Invoker }
+
+procedure TsrvGestorDocumentos_Invoker.Invoke_DarListaFicheros(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+{ function DarListaFicheros(const Almacen: TRdxAlmacenes; const ID: Integer): StringArray; }
+var
+ Almacen: FactuGES_Intf.TRdxAlmacenes;
+ ID: Integer;
+ lResult: DataAbstract4_Intf.StringArray;
+ __lObjectDisposer: TROObjectDisposer;
+begin
+ lResult := nil;
+ try
+ __Message.Read('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Read('ID', TypeInfo(Integer), ID, []);
+
+ lResult := (__Instance as IsrvGestorDocumentos).DarListaFicheros(Almacen, ID);
+
+ __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorDocumentos', 'DarListaFicherosResponse');
+ __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []);
+ __Message.Finalize;
+ __Message.UnsetAttributes(__Transport);
+
+ finally
+ __lObjectDisposer := TROObjectDisposer.Create(__Instance);
+ try
+ __lObjectDisposer.Add(lResult);
+ finally
+ __lObjectDisposer.Free();
+ end;
+ end;
+end;
+
+procedure TsrvGestorDocumentos_Invoker.Invoke_DescargarFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+{ function DescargarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Binary; }
+var
+ Almacen: FactuGES_Intf.TRdxAlmacenes;
+ ID: Integer;
+ NombreFichero: String;
+ lResult: Binary;
+ __lObjectDisposer: TROObjectDisposer;
+begin
+ lResult := nil;
+ try
+ __Message.Read('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Read('ID', TypeInfo(Integer), ID, []);
+ __Message.Read('NombreFichero', TypeInfo(String), NombreFichero, []);
+
+ lResult := (__Instance as IsrvGestorDocumentos).DescargarFichero(Almacen, ID, NombreFichero);
+
+ __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorDocumentos', 'DescargarFicheroResponse');
+ __Message.Write('Result', TypeInfo(Binary), lResult, []);
+ __Message.Finalize;
+ __Message.UnsetAttributes(__Transport);
+
+ finally
+ __lObjectDisposer := TROObjectDisposer.Create(__Instance);
+ try
+ __lObjectDisposer.Add(lResult);
+ finally
+ __lObjectDisposer.Free();
+ end;
+ end;
+end;
+
+procedure TsrvGestorDocumentos_Invoker.Invoke_SubirFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+{ function SubirFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String; const Fichero: Binary): Boolean; }
+var
+ Almacen: FactuGES_Intf.TRdxAlmacenes;
+ ID: Integer;
+ NombreFichero: String;
+ Fichero: Binary;
+ lResult: Boolean;
+ __lObjectDisposer: TROObjectDisposer;
+begin
+ Fichero := nil;
+ try
+ __Message.Read('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Read('ID', TypeInfo(Integer), ID, []);
+ __Message.Read('NombreFichero', TypeInfo(String), NombreFichero, []);
+ __Message.Read('Fichero', TypeInfo(Binary), Fichero, []);
+
+ lResult := (__Instance as IsrvGestorDocumentos).SubirFichero(Almacen, ID, NombreFichero, Fichero);
+
+ __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorDocumentos', 'SubirFicheroResponse');
+ __Message.Write('Result', TypeInfo(Boolean), lResult, []);
+ __Message.Finalize;
+ __Message.UnsetAttributes(__Transport);
+
+ finally
+ __lObjectDisposer := TROObjectDisposer.Create(__Instance);
+ try
+ __lObjectDisposer.Add(Fichero);
+ finally
+ __lObjectDisposer.Free();
+ end;
+ end;
+end;
+
+procedure TsrvGestorDocumentos_Invoker.Invoke_EliminarFichero(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+{ function EliminarFichero(const Almacen: TRdxAlmacenes; const ID: Integer; const NombreFichero: String): Boolean; }
+var
+ Almacen: FactuGES_Intf.TRdxAlmacenes;
+ ID: Integer;
+ NombreFichero: String;
+ lResult: Boolean;
+begin
+ try
+ __Message.Read('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Read('ID', TypeInfo(Integer), ID, []);
+ __Message.Read('NombreFichero', TypeInfo(String), NombreFichero, []);
+
+ lResult := (__Instance as IsrvGestorDocumentos).EliminarFichero(Almacen, ID, NombreFichero);
+
+ __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorDocumentos', 'EliminarFicheroResponse');
+ __Message.Write('Result', TypeInfo(Boolean), lResult, []);
+ __Message.Finalize;
+ __Message.UnsetAttributes(__Transport);
+
+ finally
+ end;
+end;
+
+procedure TsrvGestorDocumentos_Invoker.Invoke_EliminarID(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions);
+{ function EliminarID(const Almacen: TRdxAlmacenes; const ID: Integer): Boolean; }
+var
+ Almacen: FactuGES_Intf.TRdxAlmacenes;
+ ID: Integer;
+ lResult: Boolean;
+begin
+ try
+ __Message.Read('Almacen', TypeInfo(FactuGES_Intf.TRdxAlmacenes), Almacen, []);
+ __Message.Read('ID', TypeInfo(Integer), ID, []);
+
+ lResult := (__Instance as IsrvGestorDocumentos).EliminarID(Almacen, ID);
+
+ __Message.InitializeResponseMessage(__Transport, 'FactuGES', 'srvGestorDocumentos', 'EliminarIDResponse');
+ __Message.Write('Result', TypeInfo(Boolean), lResult, []);
+ __Message.Finalize;
+ __Message.UnsetAttributes(__Transport);
+
+ finally
+ end;
+end;
+
initialization
end.
diff --git a/Source/Servicios/RODLFILE.res b/Source/Servicios/RODLFILE.res
index 6f5cfcae..7efa5ce4 100644
Binary files a/Source/Servicios/RODLFILE.res and b/Source/Servicios/RODLFILE.res differ
diff --git a/Source/Servidor/Configuracion/srvConfiguracion_Impl.dfm b/Source/Servidor/Configuracion/srvConfiguracion_Impl.dfm
index 95fac36b..8707eb17 100644
--- a/Source/Servidor/Configuracion/srvConfiguracion_Impl.dfm
+++ b/Source/Servidor/Configuracion/srvConfiguracion_Impl.dfm
@@ -38,12 +38,40 @@ object srvConfiguracion: TsrvConfiguracion
item
Name = 'VALOR'
DataType = datString
- Size = 100
+ Size = 255
end>
end>
JoinDataTables = <>
UnionDataTables = <>
- Commands = <>
+ Commands = <
+ item
+ Params = <
+ item
+ Name = 'CODIGO'
+ Value = ''
+ end
+ item
+ Name = 'VALOR'
+ Value = ''
+ end
+ item
+ Name = 'ID_EMPRESA'
+ Value = ''
+ end>
+ Statements = <
+ item
+ Connection = 'IBX'
+ ConnectionType = 'Interbase'
+ Default = True
+ Name = 'IBX'
+ SQL =
+ 'insert into CONFIGURACION (ID, CODIGO, VALOR, ID_EMPRESA)'#10'values' +
+ '(GEN_ID(GEN_CONFIGURACION_ID, 1), :CODIGO, :VALOR, :ID_EMPRESA)'#10
+ StatementType = stSQL
+ ColumnMappings = <>
+ end>
+ Name = 'InsertarValor'
+ end>
RelationShips = <>
UpdateRules = <>
Version = 0
diff --git a/Source/Servidor/Configuracion/srvConfiguracion_Impl.pas b/Source/Servidor/Configuracion/srvConfiguracion_Impl.pas
index a1e1f1a1..5ec37ded 100644
--- a/Source/Servidor/Configuracion/srvConfiguracion_Impl.pas
+++ b/Source/Servidor/Configuracion/srvConfiguracion_Impl.pas
@@ -21,14 +21,14 @@ uses
type
{ TsrvConfiguracion }
TsrvConfiguracion = class(TDataAbstractService, IsrvConfiguracion)
- schConfiguracion: TDASchema;
Bin2DataStreamer: TDABin2DataStreamer;
+ schConfiguracion: TDASchema;
procedure DARemoteServiceCreate(Sender: TObject);
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
var aConnectionName: string);
protected
{ IsrvConfiguracion methods }
- function DarValor(const CODIGO: String): String;
+ function DarValor(const CODIGO: String; const ValorPorDefecto: String = ''): String;
end;
implementation
@@ -49,9 +49,12 @@ begin
SessionManager := dmServer.SessionManager;
end;
-function TsrvConfiguracion.DarValor(const CODIGO: String): String;
+function TsrvConfiguracion.DarValor(const CODIGO: String; const ValorPorDefecto: String = ''): String;
var
ADataSet : IDADataset;
+ ASchema : TDASchema;
+ ACurrentConn : IDAConnection;
+ ACommand : IDASQLCommand;
begin
try
ADataSet := schConfiguracion.NewDataset(Connection, 'darValor', ['CODIGO'], [CODIGO]);
@@ -59,7 +62,26 @@ begin
if ADataSet.Dataset.RecordCount > 0 then
Result := ADataSet.Dataset.Fields[0].AsVariant
else
- RaiseError('Falta variable de configuracion: ' + CODIGO);
+ begin
+ Result := ValorPorDefecto;
+ //Creamos la variable de configuración con su valor por defecto
+ ACurrentConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName);
+ ACommand := schConfiguracion.NewCommand(ACurrentConn, 'InsertarValor');
+ try
+ with ACommand do
+ begin
+ ParamByName('CODIGO').Value := CODIGO;
+ ParamByName('VALOR').Value := ValorPorDefecto;
+ ParamByName('ID_EMPRESA').Value := Null;
+ Execute;
+ ACurrentConn.CommitTransaction;
+ end;
+ except
+ ACurrentConn.RollbackTransaction;
+ end;
+ ACommand := NIL;
+// RaiseError('Falta variable de configuracion: ' + CODIGO);
+ end;
finally
ADataSet.Close;
end;
diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES
index dc077af1..139a5bda 100644
Binary files a/Source/Servidor/FactuGES_Server.RES and b/Source/Servidor/FactuGES_Server.RES differ
diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr
index d9f84245..6ec4f12b 100644
--- a/Source/Servidor/FactuGES_Server.dpr
+++ b/Source/Servidor/FactuGES_Server.dpr
@@ -125,7 +125,10 @@ uses
schUsuariosClient_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosClient_Intf.pas',
schUsuariosServer_Intf in '..\ApplicationBase\Usuarios\Model\schUsuariosServer_Intf.pas',
schAlmacenesClient_Intf in '..\Modulos\Almacenes\Model\schAlmacenesClient_Intf.pas',
- schAlmacenesServer_Intf in '..\Modulos\Almacenes\Model\schAlmacenesServer_Intf.pas';
+ schAlmacenesServer_Intf in '..\Modulos\Almacenes\Model\schAlmacenesServer_Intf.pas',
+ srvGestorDocumentos_Impl in '..\Modulos\Gestion de documentos\Servidor\srvGestorDocumentos_Impl.pas' {srvGestorDocumentos: TDataAbstractService},
+ uStringsUtils in '..\Base\Utiles\uStringsUtils.pas',
+ uSistemaFunc in '..\Base\Utiles\uSistemaFunc.pas';
{$R *.res}
{$R ..\Servicios\RODLFile.res}
diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj
index d40573b0..afd8852f 100644
--- a/Source/Servidor/FactuGES_Server.dproj
+++ b/Source/Servidor/FactuGES_Server.dproj
@@ -58,6 +58,8 @@
+
+
@@ -138,6 +140,10 @@
+
+
+ TDataAbstractService
+
diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc
index e9d1d545..bbf79d4f 100644
--- a/Source/Servidor/FactuGES_Server.rc
+++ b/Source/Servidor/FactuGES_Server.rc
@@ -16,7 +16,7 @@ BEGIN
VALUE "FileVersion", "2.2.4.0\0"
VALUE "ProductName", "FactuGES (Servidor)\0"
VALUE "ProductVersion", "2.2.4.0\0"
- VALUE "CompileDate", "jueves, 31 de julio de 2008 12:02\0"
+ VALUE "CompileDate", "lunes, 08 de septiembre de 2008 18:46\0"
END
END
BLOCK "VarFileInfo"