X-Git-Url: https://git.llucax.com/z.facultad/75.10/miklolife.git/blobdiff_plain/75a406555442f5c80dbdd40162767d0096a3a6cb..1a14964592379a39d96bc84c53db779507d12415:/demo/src/Reportes/ConsumoAfiliadosReport.cs diff --git a/demo/src/Reportes/ConsumoAfiliadosReport.cs b/demo/src/Reportes/ConsumoAfiliadosReport.cs index 04878d2..945a246 100644 --- a/demo/src/Reportes/ConsumoAfiliadosReport.cs +++ b/demo/src/Reportes/ConsumoAfiliadosReport.cs @@ -1,9 +1,11 @@ using System; using System.Collections; +using System.Configuration; using System.Xml; using Dominio.Autorizaciones; using Dominio.Afiliados; using com.db4o; +using System.IO; namespace Reportes @@ -122,7 +124,25 @@ namespace Reportes public void Serializar() { - XmlTextWriter writer = new XmlTextWriter("c:\\rc_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 = "rc_" + 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); }