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