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
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