]> 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 96c2a46d01682ace5cc07e5f0b626a4aceacb293..ca1372f2ba2f26dfd6c8b98fca5301811f3abb4c 100644 (file)
@@ -4,6 +4,9 @@ using System.Xml;
 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
@@ -122,10 +125,27 @@ namespace Reportes
 \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
                }\r
 \r
                #endregion Metodos publicos\r