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