using System;\r
+using System.Collections;\r
+using System.Xml;\r
+using Dominio.Autorizaciones;\r
+using Dominio.Afiliados;\r
+using com.db4o;\r
+\r
\r
namespace Reportes\r
{\r
/// </summary>\r
public class ConsumoAfiliadosReport\r
{\r
+ #region Constructores\r
+ \r
public ConsumoAfiliadosReport()\r
{\r
+ XmlDeclaration xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null);\r
+ xmlDoc.AppendChild(xmlDeclaration);\r
+\r
+ XmlElement root = this.xmlDoc.CreateElement( "reporteConsumo" );\r
+ root.SetAttribute( "fechaGeneracion", DateTime.Now.ToString( "yyyy-MM-dd" ) );\r
+ \r
+ root.AppendChild( xmlDoc.CreateElement( "lineas" ) );\r
+\r
+ xmlDoc.AppendChild( root );\r
+ }\r
+\r
+ #endregion Constructores\r
+\r
+ private XmlDocument xmlDoc = new XmlDocument(); \r
+\r
+ #region Metodos Publicos\r
+\r
+ public void AgregarInfo( Prestador p, LineaInfoPrestacionesReport lineaIp )\r
+ {\r
+ \r
+ }\r
+\r
+ #endregion Metodos Publicos\r
+\r
+\r
+ #region Metodos privados\r
+\r
+ private Autorizacion getAutorizacion( int codigo )\r
+ {\r
+ this.db = com.db4o.Db4o.openFile("os.yap");\r
+ \r
+ ArrayList al = new ArrayList();\r
+\r
+ al = this.ObjectSetToArrayList( db.get( new AutorizacionManual(codigo) ) );\r
+ Autorizacion a = ( (al.Count == 0)? null : al[0] ) as AutorizacionManual;\r
+\r
+ if ( a == null )\r
+ {\r
+ al = this.ObjectSetToArrayList( db.get( new AutorizacionAutomatica(codigo) ) );\r
+ a = ( (al.Count == 0)? null : al[0] ) as AutorizacionAutomatica;\r
+ }\r
+\r
+ this.db.close();\r
+ this.db = null;\r
+\r
+ return a;\r
}\r
+\r
+ #endregion Metodos privados\r
+\r
+ #region DB\r
+ private com.db4o.ObjectContainer db = null;
+
+ private ArrayList ObjectSetToArrayList (ObjectSet result)
+ {
+ ArrayList lst = new ArrayList ();
+ Object s;
+ if (result == null)
+ return lst;
+
+ while ((s = result.next ()) != null) \r
+ {
+ lst.Add (s);
+ }
+ return lst;
+ }
+
+ #endregion DB\r
+\r
+ \r
}\r
}\r