]> git.llucax.com Git - z.facultad/75.10/miklolife.git/blobdiff - demo/src/Reportes/ConsumoAfiliadosReport.cs
mas fixes y puesta linda
[z.facultad/75.10/miklolife.git] / demo / src / Reportes / ConsumoAfiliadosReport.cs
index 04878d24175e7a4778d41f784e53d4b51f15f00e..945a246b59eec19d648253bd1ecd66b46a95c3b5 100644 (file)
@@ -1,9 +1,11 @@
 using System;\r
 using System.Collections;\r
 using System;\r
 using System.Collections;\r
+using System.Configuration;\r
 using System.Xml;\r
 using Dominio.Autorizaciones;\r
 using Dominio.Afiliados;\r
 using com.db4o;\r
 using System.Xml;\r
 using Dominio.Autorizaciones;\r
 using Dominio.Afiliados;\r
 using com.db4o;\r
+using System.IO;\r
 \r
 \r
 namespace Reportes\r
 \r
 \r
 namespace Reportes\r
@@ -122,7 +124,25 @@ namespace Reportes
 \r
                public void Serializar()\r
                {\r
 \r
                public void Serializar()\r
                {\r
-                       XmlTextWriter writer = new XmlTextWriter("c:\\rc_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 = "rc_" + 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