public void CrearAccionPunto(int p_oid)
        {
            /*PROTECTED REGION ID(ReciclaUAGenNHibernate.CP.ReciclaUA_PuntoReciclaje_crearAccionPunto) ENABLED START*/

            IPuntoReciclajeCAD puntoReciclajeCAD = null;
            PuntoReciclajeCEN  puntoReciclajeCEN = null;
            AccionWebCEN       accionWebCEN      = null;
            ITipoAccionCAD     tipoAccionCAD     = null;
            TipoAccionCEN      tipoAccionCEN     = null;
            TipoAccionEN       tipoAccion        = null;
            IUsuarioWebCAD     usuarioWebCAD     = null;
            UsuarioWebCEN      usuarioWebCEN     = null;
            PuntoReciclajeEN   punto             = null;


            try
            {
                SessionInitializeTransaction();
                puntoReciclajeCAD = new PuntoReciclajeCAD(session);
                puntoReciclajeCEN = new PuntoReciclajeCEN(puntoReciclajeCAD);
                tipoAccionCAD     = new TipoAccionCAD(session);
                tipoAccionCEN     = new TipoAccionCEN(tipoAccionCAD);
                usuarioWebCAD     = new UsuarioWebCAD(session);
                usuarioWebCEN     = new UsuarioWebCEN(usuarioWebCAD);
                accionWebCEN      = new AccionWebCEN();

                punto = puntoReciclajeCEN.BuscarPorId(p_oid);

                if (punto.Usuario != null && usuarioWebCEN.BuscarPorId(punto.Usuario.Id) != null)
                {
                    tipoAccion = tipoAccionCEN.BuscarTodos(0, -1).Where(t => t.Nombre.Equals("Punto")).FirstOrDefault();

                    if (tipoAccion == null)
                    {
                        var id = tipoAccionCEN.Crear(30, "Punto");
                        tipoAccion = tipoAccionCEN.BuscarPorId(id);
                    }
                    accionWebCEN.Crear(punto.Usuario.Id, tipoAccion.Id);
                }

                SessionCommit();
            }
            catch (Exception ex)
            {
                SessionRollBack();
                throw ex;
            }
            finally
            {
                SessionClose();
            }


            /*PROTECTED REGION END*/
        }
        public System.Collections.Generic.IList <ReciclaUAGenNHibernate.EN.ReciclaUA.PuntoReciclajeEN> ObtenerPuntosCercanos(double p_latitud, double p_longitud, int p_limit)
        {
            /*PROTECTED REGION ID(ReciclaUAGenNHibernate.CP.ReciclaUA_PuntoReciclaje_obtenerPuntosCercanos) ENABLED START*/

            IPuntoReciclajeCAD puntoReciclajeCAD = null;
            PuntoReciclajeCEN  puntoReciclajeCEN = null;

            System.Collections.Generic.IList <ReciclaUAGenNHibernate.EN.ReciclaUA.PuntoReciclajeEN> result = null;


            try
            {
                SessionInitializeTransaction();
                puntoReciclajeCAD = new PuntoReciclajeCAD(session);
                puntoReciclajeCEN = new PuntoReciclajeCEN(puntoReciclajeCAD);

                GeoCoordinateWrapper referencia = new GeoCoordinateWrapper(p_latitud, p_longitud);

                IList <Tuple <GeoCoordinateWrapper, PuntoReciclajeEN> > coordenadas = new List <Tuple <GeoCoordinateWrapper, PuntoReciclajeEN> >();

                foreach (PuntoReciclajeEN punto in puntoReciclajeCEN.BuscarPuntosValidados())
                {
                    Console.WriteLine(punto.Estancia.Edificio + " " + punto.Estancia.Planta);
                    coordenadas.Add(new Tuple <GeoCoordinateWrapper, PuntoReciclajeEN>(new GeoCoordinateWrapper(punto.Latitud, punto.Longitud), punto));
                }

                var query = coordenadas.OrderBy(tupla => tupla.Item1.GetDistanceTo(referencia)).Select(tupla => tupla.Item2);

                if (p_limit > 0)
                {
                    query = query.Take(p_limit);
                }

                result = query.ToList();


                SessionCommit();
            }
            catch (Exception ex)
            {
                SessionRollBack();
                throw ex;
            }
            finally
            {
                SessionClose();
            }
            return(result);


            /*PROTECTED REGION END*/
        }
        public void CrearPunto(int p_oid)
        {
            /*PROTECTED REGION ID(ReciclaUAGenNHibernate.CP.ReciclaUA_PuntoReciclaje_crearPunto) ENABLED START*/

            IPuntoReciclajeCAD puntoReciclajeCAD = null;
            PuntoReciclajeCEN  puntoReciclajeCEN = null;



            try
            {
                SessionInitializeTransaction();
                puntoReciclajeCAD = new PuntoReciclajeCAD(session);
                puntoReciclajeCEN = new  PuntoReciclajeCEN(puntoReciclajeCAD);



                // Write here your custom transaction ...

                throw new NotImplementedException("Method CrearPunto() not yet implemented.");



                SessionCommit();
            }
            catch (Exception ex)
            {
                SessionRollBack();
                throw ex;
            }
            finally
            {
                SessionClose();
            }


            /*PROTECTED REGION END*/
        }
 public PuntoReciclajeCEN(IPuntoReciclajeCAD _IPuntoReciclajeCAD)
 {
     this._IPuntoReciclajeCAD = _IPuntoReciclajeCAD;
 }
 public PuntoReciclajeCEN()
 {
     this._IPuntoReciclajeCAD = new PuntoReciclajeCAD();
 }