Cambios en las cargas de ficheros EDI para controlar si se han movido o no correctamente los ficheros

git-svn-id: https://192.168.0.254/svn/Proyectos.Varela_PuntosVenta/trunk@97 1c943782-d109-9647-9548-93b3ac332352
This commit is contained in:
David Arranz 2007-10-18 12:24:19 +00:00
parent ed0eb64c3c
commit 79b5320470
4 changed files with 827 additions and 777 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{86364157-b301-43dd-bfad-250a58064559}</ProjectGuid> <ProjectGuid>{86364157-b301-43dd-bfad-250a58064559}</ProjectGuid>

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@ var
ADirEntrada : String; ADirEntrada : String;
ADirTemp : String; ADirTemp : String;
NumRegNuevos : Integer; NumRegNuevos : Integer;
bCargarFicheros: Boolean;
procedure GuardarFicheros; procedure GuardarFicheros;
var var
@ -84,9 +85,25 @@ begin
try try
if not DirectoryExists(ADirTemp) then if not DirectoryExists(ADirTemp) then
ForceDirectories(ADirTemp); ForceDirectories(ADirTemp);
FileMove(ADirEntrada + FicheroCAB, ADirTemp + FicheroCAB);
FileMove(ADirEntrada + FicheroLIN, ADirTemp + FicheroLIN); if not FileMove(ADirEntrada + FicheroCAB, ADirTemp + FicheroCAB) then
FileMove(ADirEntrada + FicheroCANT, ADirTemp + FicheroCANT); begin
MsgError := 'No se ha podido mover FicheroCAB';
bCargarFicheros := False;
end;
if not FileMove(ADirEntrada + FicheroLIN, ADirTemp + FicheroLIN) then
begin
MsgError := 'No se ha podido mover FicheroLIN';
bCargarFicheros := False;
end;
if not FileMove(ADirEntrada + FicheroCANT, ADirTemp + FicheroCANT) then
begin
MsgError := 'No se ha podido mover FicheroCANT';
bCargarFicheros := False;
end;
except except
on E: Exception do on E: Exception do
begin begin
@ -97,6 +114,8 @@ begin
end; end;
try try
if bCargarFicheros then
begin
try try
dmEDIInventary.CargarFicheros (ADirTemp + FicheroCAB, ADirTemp + FicheroLIN, ADirTemp + FicheroCANT, NumRegNuevos); dmEDIInventary.CargarFicheros (ADirTemp + FicheroCAB, ADirTemp + FicheroLIN, ADirTemp + FicheroCANT, NumRegNuevos);
if NumRegNuevos > 0 then if NumRegNuevos > 0 then
@ -108,6 +127,9 @@ begin
GuardarFicheros; GuardarFicheros;
dmServer.BorrarFicherosDeCargaAntiguos; dmServer.BorrarFicherosDeCargaAntiguos;
end; end;
end
else
InsertarLog(False, MsgError + ' (CargarFicheroEDI3 INV)');
except except
on E: Exception do on E: Exception do
begin begin

View File

@ -47,6 +47,7 @@ var
ADirEntrada : String; ADirEntrada : String;
ADirTemp : String; ADirTemp : String;
NumRegNuevos : Integer; NumRegNuevos : Integer;
bCargarFicheros: Boolean;
procedure GuardarFicheros; procedure GuardarFicheros;
var var
@ -86,10 +87,32 @@ begin
try try
if not DirectoryExists(ADirTemp) then if not DirectoryExists(ADirTemp) then
ForceDirectories(ADirTemp); ForceDirectories(ADirTemp);
FileMove(ADirEntrada + FicheroCAB, ADirTemp + FicheroCAB);
FileMove(ADirEntrada + FicheroLUG, ADirTemp + FicheroLUG); bCargarFicheros := True;
FileMove(ADirEntrada + FicheroART, ADirTemp + FicheroART); if not FileMove(ADirEntrada + FicheroCAB, ADirTemp + FicheroCAB) then
FileMove(ADirEntrada + FicheroART, ADirTemp + 'CONVEN.TXT'); begin
MsgError := 'No se ha podido mover FicheroCAB';
bCargarFicheros := False;
end;
if not FileMove(ADirEntrada + FicheroLUG, ADirTemp + FicheroLUG) then
begin
MsgError := 'No se ha podido mover FicheroLUG';
bCargarFicheros := False;
end;
if not FileMove(ADirEntrada + FicheroART, ADirTemp + FicheroART) then
begin
MsgError := 'No se ha podido mover FicheroART';
bCargarFicheros := False;
end;
// if not FileMove(ADirEntrada + FicheroART, ADirTemp + 'CONVEN.TXT') then
// begin
// MsgError := 'No se ha podido mover FicheroCONVEN';
// bCargarFicheros := False;
// end;
except except
on E: Exception do on E: Exception do
begin begin
@ -100,6 +123,8 @@ begin
end; end;
try try
if bCargarFicheros then
begin
try try
dmEDISales.CargarFicheros (ADirTemp + FicheroCAB, ADirTemp + FicheroLUG, ADirTemp + FicheroART, NumRegNuevos); dmEDISales.CargarFicheros (ADirTemp + FicheroCAB, ADirTemp + FicheroLUG, ADirTemp + FicheroART, NumRegNuevos);
if NumRegNuevos > 0 then if NumRegNuevos > 0 then
@ -111,6 +136,9 @@ begin
GuardarFicheros; GuardarFicheros;
dmServer.BorrarFicherosDeCargaAntiguos; dmServer.BorrarFicherosDeCargaAntiguos;
end; end;
end
else
InsertarLog(False, MsgError + ' (CargarFicheroEDI3 SLS)');
except except
on E: Exception do on E: Exception do
begin begin