X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/b674f20b66a5a72d55c80bb6d14bd3b673013442..062fb3e6189970c90daa714ede941edf05f5f5c0:/demo/src/Reportes/PrestacionesRealizadasReport.cs diff --git a/demo/src/Reportes/PrestacionesRealizadasReport.cs b/demo/src/Reportes/PrestacionesRealizadasReport.cs index 96c2a46..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,10 +125,27 @@ 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); - } #endregion Metodos publicos