X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/75a406555442f5c80dbdd40162767d0096a3a6cb..HEAD:/demo/src/Reportes/PrestacionesRealizadasReport.cs diff --git a/demo/src/Reportes/PrestacionesRealizadasReport.cs b/demo/src/Reportes/PrestacionesRealizadasReport.cs index f7de05f..ca1372f 100644 --- a/demo/src/Reportes/PrestacionesRealizadasReport.cs +++ b/demo/src/Reportes/PrestacionesRealizadasReport.cs @@ -4,6 +4,9 @@ using System.Xml; using Dominio.Autorizaciones; using Dominio.Afiliados; using com.db4o; +using System.Configuration; +using System.IO; + namespace Reportes { @@ -122,7 +125,25 @@ namespace Reportes public void Serializar() { - XmlTextWriter writer = new XmlTextWriter("c:\\borrame.xml",null); + string currentDir = Directory.GetCurrentDirectory(); + string dirPagos = Path.Combine( currentDir, ConfigurationSettings.AppSettings["DirectorioPagos"] ); + if ( ! Directory.Exists(dirPagos) ) + { + Directory.CreateDirectory( dirPagos ); + } + + int secuencia = 0; + + string baseFileName = "rp_" + DateTime.Now.ToString("yyyy-MM-dd") + "_"; + string pathName = Path.Combine( dirPagos, baseFileName + secuencia.ToString("00") + ".xml" ); + + while ( File.Exists(pathName) ) + { + secuencia += 1; + pathName = Path.Combine( dirPagos, baseFileName + secuencia.ToString("00") + ".xml"); + } + + XmlTextWriter writer = new XmlTextWriter( pathName, null ); writer.Formatting = Formatting.Indented; this.xmlDoc.Save(writer); }