コード例 #1
0
        public void BorrarEvento(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Admin_borrarEvento) ENABLED START*/

            // Write here your custom code...
            EventoCEN evento = new EventoCEN();
            MapaCEN   mapa   = new MapaCEN();

            System.Collections.Generic.IList <MapaEN> aux;
            aux = mapa.FiltrarPorEvento(p_oid);
            int id_mapa = -1;

            foreach (MapaEN element in aux)
            {
                id_mapa = element.Id;
                mapa.Destroy(id_mapa);
            }


            evento.Destroy(p_oid);
            /*PROTECTED REGION END*/
        }
コード例 #2
0
        public float VerMedia(int id_gym, int id_reto)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Puntuacion_verMedia) ENABLED START*/

            // Write here your custom code...

            float media = 0;
            int   cont  = 0;

            if (id_gym == -1)
            {
                PuntuacionCEN puntuacion = new PuntuacionCEN();
                RetoCEN       reto       = new RetoCEN();
                System.Collections.Generic.IList <PuntuacionEN> puntuaciones;
                puntuaciones = FiltrarMediaReto(id_reto);
                foreach (PuntuacionEN element in puntuaciones)
                {
                    media = media + element.Puntuacion;
                    cont++;
                }
                return(media = media / cont);
            }
            else if (id_reto == -1)
            {
                PuntuacionCEN puntuacion = new PuntuacionCEN();
                EventoCEN     evento     = new EventoCEN();
                System.Collections.Generic.IList <PuntuacionEN> puntuaciones;
                puntuaciones = FiltrarMediaEvento(id_gym);
                foreach (PuntuacionEN element in puntuaciones)
                {
                    media = media + element.Puntuacion;
                    cont++;
                }
                return(media = media / cont);
            }
            return(-1);
            /*PROTECTED REGION END*/
        }