Пример #1
0
        public void BorrarUnReporte(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_borrarUnReporte) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;



            try
            {
                SessionInitializeTransaction();
                reporteCAD = new ReporteCAD(session);
                reporteCEN = new  ReporteCEN(reporteCAD);



                // Write here your custom transaction ...

                EventoEN even = new EventoEN();
                even = reporteCAD.GetID(p_oid).Evento;
                RetoEN reten = new RetoEN();
                reten = reporteCAD.GetID(p_oid).Reto;
                GymkanaEN gymen = new GymkanaEN();
                gymen = reporteCAD.GetID(p_oid).Gymkana;

                if (even != null)
                {
                    reporteCAD.UnrelationerReporteEvento(p_oid, even.ID);
                    reporteCAD.Destroy(p_oid);
                }
                else if (reten != null)
                {
                    reporteCAD.UnrelationerReporteReto(p_oid, reten.ID);
                    reporteCAD.Destroy(p_oid);
                }
                else if (gymen != null)
                {
                    reporteCAD.UnrelationerReporteGymkana(p_oid, gymen.ID);
                    reporteCAD.Destroy(p_oid);
                }


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


            /*PROTECTED REGION END*/
        }
        public void BorrarUsuario(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Usuario_BorrarUsuario) ENABLED START*/

            // Write here your custom code...

            UsuarioCAD    usu  = new UsuarioCAD();
            EventoCAD     eve  = new EventoCAD();
            EventoCEN     evec = new EventoCEN();
            RetoCAD       ret  = new RetoCAD();
            RetoCEN       retc = new RetoCEN();
            PuntuacionCAD pun  = new PuntuacionCAD();
            ReporteCAD    rep  = new ReporteCAD();
            ComentarioCAD com  = new ComentarioCAD();

            System.Collections.Generic.IList <EventoEN>     eventos;
            System.Collections.Generic.IList <RetoEN>       retos;
            System.Collections.Generic.IList <PuntuacionEN> puntuaciones;
            System.Collections.Generic.IList <ReporteEN>    reportes;
            System.Collections.Generic.IList <ComentarioEN> comentarios;

            usu.Destroy(p_oid);

            eventos = eve.FiltrarPorUsuario(p_oid);
            foreach (EventoEN element in eventos)
            {
                evec.BorrarEvento(element.ID);
            }

            retos = ret.FiltrarPorUsuario(p_oid);
            foreach (RetoEN element in retos)
            {
                retc.BorrarReto(element.ID);
            }

            puntuaciones = pun.FiltrarPorUsuario(p_oid);
            foreach (PuntuacionEN element in puntuaciones)
            {
                pun.Destroy(element.Id);
            }

            reportes = rep.FiltrarPorUsuario(p_oid);
            foreach (ReporteEN element in reportes)
            {
                rep.Destroy(element.ID);
            }

            comentarios = com.FiltrarPorUsuario(p_oid);
            foreach (ComentarioEN element in comentarios)
            {
                rep.Destroy(element.ID);
            }

            /*PROTECTED REGION END*/
        }
        public void BorrarEvento(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Evento_borrarEvento) ENABLED START*/

            // Write here your custom code...
            MapaCAD       mapa = new MapaCAD();
            PuntuacionCAD punt = new PuntuacionCAD();
            ReporteCAD    rep  = new ReporteCAD();

            System.Collections.Generic.IList <MapaEN>       mapas;
            System.Collections.Generic.IList <PuntuacionEN> puntos;
            System.Collections.Generic.IList <ReporteEN>    reportes;

            Destroy(p_oid);

            mapas = mapa.FiltrarPorEvento(p_oid);
            mapa.Destroy(mapas [0].Id);

            puntos = punt.FiltrarTodosEventos(p_oid);
            foreach (PuntuacionEN element in puntos)
            {
                punt.Destroy(element.Id);
            }

            reportes = rep.FiltrarTodosEventos(p_oid);
            foreach (ReporteEN element in reportes)
            {
                rep.Destroy(element.ID);
            }



            /*PROTECTED REGION END*/
        }
        public void BorrarReportesGymkana(int id_gym)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Reporte_BorrarReportesGymkana) ENABLED START*/

            IReporteCAD reporteCAD = null;
            ReporteCEN  reporteCEN = null;



            try
            {
                SessionInitializeTransaction();
                reporteCAD = new ReporteCAD(session);
                reporteCEN = new  ReporteCEN(reporteCAD);



                // Write here your custom transaction ...

                System.Collections.Generic.IList <ReporteEN> reportes = new System.Collections.Generic.List <ReporteEN>();
                reportes = reporteCAD.FiltrarReportesPorGymkana(id_gym);
                foreach (ReporteEN element in reportes)
                {
                    reporteCAD.UnrelationerReporteGymkana(element.ID, id_gym);
                    reporteCAD.Destroy(element.ID);
                }


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


            /*PROTECTED REGION END*/
        }
Пример #5
0
        public void BorrarReto(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CEN.Whatever_Reto_borrarReto) ENABLED START*/
            PuntuacionCAD punt = new PuntuacionCAD();
            ReporteCAD    rep  = new ReporteCAD();

            System.Collections.Generic.IList <PuntuacionEN> puntos;
            System.Collections.Generic.IList <ReporteEN>    reportes;

            Destroy(p_oid);

            puntos = punt.FiltrarTodosRetos(p_oid);
            foreach (PuntuacionEN element in puntos)
            {
                punt.Destroy(element.Id);
            }

            reportes = rep.FiltrarTodosRetos(p_oid);
            foreach (ReporteEN element in reportes)
            {
                rep.Destroy(element.ID);
            }
            /*PROTECTED REGION END*/
        }