Exemplo n.º 1
0
        public MultitecUAGenNHibernate.EN.MultitecUA.EventoEN New_(string p_nombre, string p_descripcion, Nullable <DateTime> p_fechaInicio, Nullable <DateTime> p_fechaFin, Nullable <DateTime> p_fechaInicioInscripcion, Nullable <DateTime> p_fechaTopeInscripcion, System.Collections.Generic.IList <string> p_fotos)
        {
            /*PROTECTED REGION ID(MultitecUAGenNHibernate.CP.MultitecUA_Evento_new_) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;

            MultitecUAGenNHibernate.EN.MultitecUA.EventoEN result = null;


            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);



                int oid;
                //Initialized EventoEN
                EventoEN eventoEN;
                eventoEN        = new EventoEN();
                eventoEN.Nombre = p_nombre;

                eventoEN.Descripcion = p_descripcion;

                eventoEN.FechaInicio = p_fechaInicio;

                eventoEN.FechaFin = p_fechaFin;

                eventoEN.FechaInicioInscripcion = p_fechaInicioInscripcion;

                eventoEN.FechaTopeInscripcion = p_fechaTopeInscripcion;

                eventoEN.Fotos = p_fotos;

                //Call to EventoCAD

                oid    = eventoCAD.New_(eventoEN);
                result = eventoCAD.ReadOIDDefault(oid);



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


            /*PROTECTED REGION END*/
        }
Exemplo n.º 2
0
        public void BorrarEvento(int p_oid)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Evento_borrarEvento) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);

                MapaCP       mapa = new MapaCP(session);
                PuntuacionCP punt = new PuntuacionCP(session);
                ReporteCP    rep  = new ReporteCP(session);
                ComentarioCP com  = new ComentarioCP(session);

                mapa.BorrarMapaParaEvento(p_oid);
                punt.BorrarPuntuacionEvento(p_oid);
                rep.BorrarReportesEvento(p_oid);
                com.BorrarComentariosEvento(p_oid);

                eventoCAD.Destroy(p_oid);



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


            /*PROTECTED REGION END*/
        }
        public void ModificarEvento(WhateverGenNHibernate.EN.Whatever.MapaEN mapa, WhateverGenNHibernate.EN.Whatever.EventoEN evento)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Evento_modificarEvento) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);

                MapaCAD map = new MapaCAD(session);

                MapaEN mapen = evento.Mapa;
                mapen.Latitud  = mapa.Latitud;
                mapen.Longitud = mapa.Longitud;
                mapen.Zoom     = mapa.Zoom;

                eventoCAD.Modify(evento);
                map.Modify(mapen);


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


            /*PROTECTED REGION END*/
        }
Exemplo n.º 4
0
        public void CrearEvento(WhateverGenNHibernate.EN.Whatever.EventoEN evento, string lat, string long_, int zoom)
        {
            /*PROTECTED REGION ID(WhateverGenNHibernate.CP.Whatever_Evento_crearEvento) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);



                MapaCP mapa      = new MapaCP(session);
                MapaEN map       = new MapaEN();
                int    id_evento = eventoCAD.New_(evento);
                mapa.CrearMapaParaEvento(id_evento, lat, long_, zoom);
                SessionCommit();
            }
            catch (Exception ex)
            {
                SessionRollBack();
                throw ex;
            }
            finally
            {
                SessionClose();
            }


            /*PROTECTED REGION END*/
        }
Exemplo n.º 5
0
 public EventoCEN(IEventoCAD _IEventoCAD)
 {
     this._IEventoCAD = _IEventoCAD;
 }
Exemplo n.º 6
0
 public EventoCEN()
 {
     this._IEventoCAD = new EventoCAD();
 }
Exemplo n.º 7
0
        public DSMGenNHibernate.EN.DSM.EventoEN CrearEvento(string p_lugar, Nullable <DateTime> p_fecha, DSMGenNHibernate.Enumerated.DSM.TipoEventoEnum p_tipo, string p_descripcion, string p_nombre, DSMGenNHibernate.Enumerated.DSM.GeneroEventoEnum p_genero)
        {
            /*PROTECTED REGION ID(DSMGenNHibernate.CP.DSM_Evento_crearEvento) ENABLED START*/

            //COMO SE LE PASA POR PARAMETRO EL PRECIO DE LAS ENTRADAS AL METODO SI EVENTO PAGO HEREDA?

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;


            DSMGenNHibernate.EN.DSM.EventoEN result = null;


            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new EventoCEN(eventoCAD);
                //  eventoPagoCAD = new EventoPagoCAD(session);



                int oid;
                //Initialized EventoEN
                EventoEN eventoEN;
                eventoEN       = new EventoEN();
                eventoEN.Lugar = p_lugar;

                eventoEN.Fecha = p_fecha;

                eventoEN.Tipo = p_tipo;

                eventoEN.Descripcion = p_descripcion;

                eventoEN.Nombre = p_nombre;

                eventoEN.Genero = p_genero;

                //MIRARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
                //inicializo tipos evento
                EventoPagoEN eventoPagoEN;
                eventoPagoEN          = new EventoPagoEN();
                eventoPagoEN.Entradas = 1;
                //eventoPagoEN.Precio = 1.0;

                EventoGratisEN eventoGratisEN;
                eventoGratisEN = new EventoGratisEN();

                EntradaEN entradaEN;
                entradaEN         = new EntradaEN();
                entradaEN.Precio  = 1.0;
                entradaEN.Vendida = false;

                //Call to EventoCAD

                oid    = eventoCAD.CrearEvento(eventoEN);
                result = eventoCAD.ReadOIDDefault(oid);


                /* if (comentarioEN.Tipocom == TipoComentarioEnum.Evento)
                 * {
                 *  comentarioCEN.VincEv(comentarioEN.Id, idref);
                 * }*/

                if (eventoEN.Id == eventoPagoEN.Id)
                {
                }


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


            /*PROTECTED REGION END*/
        }
        public void EliminaProyectosAsociados(int p_Evento_OID, System.Collections.Generic.IList <int> p_proyectosPresentados_OIDs)
        {
            /*PROTECTED REGION ID(MultitecUAGenNHibernate.CP.MultitecUA_Evento_eliminaProyectosAsociados) ENABLED START*/

            IEventoCAD   eventoCAD   = null;
            EventoCEN    eventoCEN   = null;
            IProyectoCAD proyectoCAD = null;
            ProyectoCEN  proyectoCEN = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);

                proyectoCAD = new ProyectoCAD(session);
                proyectoCEN = new ProyectoCEN(proyectoCAD);



                NotificacionProyectoCEN notificacionProyectoCEN = new NotificacionProyectoCEN();
                NotificacionUsuarioCEN  notificacionUsuarioCEN  = new NotificacionUsuarioCEN();
                UsuarioCEN usuarioCEN = new UsuarioCEN();

                foreach (int OID_Evento in p_proyectosPresentados_OIDs)
                {
                    ProyectoEN proyectoEN = proyectoCAD.ReadOID(OID_Evento);

                    EventoEN eventoEN = eventoCEN.ReadOID(OID_Evento);

                    int OID_notificacionProyecto = notificacionProyectoCEN.New_("Proyecto retirado de evento", "El proyecto " + proyectoEN.Nombre + " ha sido retirado del evento " + eventoEN.Nombre + " por un administrador", proyectoEN.Id);

                    foreach (UsuarioEN usuario in usuarioCEN.DameModeradoresProyecto(OID_Evento))
                    {
                        notificacionUsuarioCEN.New_(usuario.Id, OID_notificacionProyecto);
                    }
                }



                //Call to EventoCAD

                eventoCAD.EliminaProyectosAsociados(p_Evento_OID, p_proyectosPresentados_OIDs);



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


            /*PROTECTED REGION END*/
        }
Exemplo n.º 9
0
 public EventoCEN(IEventoCAD _IEventoCAD)
 {
     this._IEventoCAD = _IEventoCAD;
 }
Exemplo n.º 10
0
 public EventoCEN()
 {
     this._IEventoCAD = new EventoCAD ();
 }
Exemplo n.º 11
0
        public void Destroy(int p_Evento_OID)
        {
            /*PROTECTED REGION ID(MultitecUAGenNHibernate.CP.MultitecUA_Evento_destroy) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;
            EventoEN   eventoEN  = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new  EventoCEN(eventoCAD);
                eventoEN  = eventoCAD.ReadOID(p_Evento_OID);

                NotificacionCEN notificacionCEN        = new NotificacionCEN();
                int             OID_notificacionEvento = notificacionCEN.New_("Evento eliminado", "El evento " + eventoEN.Nombre + " ha sido cancelado");

                ProyectoCEN            proyectoCEN            = new ProyectoCEN();
                UsuarioCEN             usuarioCEN             = new UsuarioCEN();
                NotificacionUsuarioCEN notificacionUsuarioCEN = new NotificacionUsuarioCEN();
                List <int>             OIDsParticipantes      = new List <int>();

                foreach (ProyectoEN proyectoEN in proyectoCEN.DameProyectosPorEvento(p_Evento_OID))
                {
                    foreach (UsuarioEN usuario in usuarioCEN.DameParticipantesProyecto(proyectoEN.Id))
                    {
                        if (!OIDsParticipantes.Contains(usuario.Id))
                        {
                            OIDsParticipantes.Add(usuario.Id);
                        }
                    }
                }


                foreach (int OIDUsuario in OIDsParticipantes)
                {
                    notificacionUsuarioCEN.New_(OIDUsuario, OID_notificacionEvento);
                }

                // Eliminar todos las relaciones entre proyectos presentados a este evento
                ProyectoCP proyectoCP = new ProyectoCP();
                foreach (ProyectoEN proyectoEN in proyectoCEN.DameProyectosPorEvento(p_Evento_OID))
                {
                    proyectoCP.EliminaEventos(proyectoEN.Id, new List <int> {
                        p_Evento_OID
                    });
                }



                eventoCAD.Destroy(p_Evento_OID);


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


            /*PROTECTED REGION END*/
        }
Exemplo n.º 12
0
        public void Modify(int p_Evento_OID, string p_nombre, string p_descripcion, Nullable <DateTime> p_fechaInicio, Nullable <DateTime> p_fechaFin, Nullable <DateTime> p_fechaInicioInscripcion, Nullable <DateTime> p_fechaTopeInscripcion, System.Collections.Generic.IList <string> p_fotos)
        {
            /*PROTECTED REGION ID(MultitecUAGenNHibernate.CP.MultitecUA_Evento_modify) ENABLED START*/

            IEventoCAD eventoCAD = null;
            EventoCEN  eventoCEN = null;



            try
            {
                SessionInitializeTransaction();
                eventoCAD = new EventoCAD(session);
                eventoCEN = new EventoCEN(eventoCAD);



                EventoEN eventoEN = null;
                //Initialized EventoEN
                eventoEN                        = new EventoEN();
                eventoEN.Id                     = p_Evento_OID;
                eventoEN.Nombre                 = p_nombre;
                eventoEN.Descripcion            = p_descripcion;
                eventoEN.FechaInicio            = p_fechaInicio;
                eventoEN.FechaFin               = p_fechaFin;
                eventoEN.FechaInicioInscripcion = p_fechaInicioInscripcion;
                eventoEN.FechaTopeInscripcion   = p_fechaTopeInscripcion;
                eventoEN.FotosEvento            = p_fotos;


                NotificacionEventoCEN notificacionEventoCEN = new NotificacionEventoCEN();
                int OID_notificacionEvento = notificacionEventoCEN.New_("Evento modificado", "El evento " + eventoEN.Nombre + " ha sido modificado", eventoEN.Id);

                ProyectoCEN            proyectoCEN            = new ProyectoCEN();
                UsuarioCEN             usuarioCEN             = new UsuarioCEN();
                NotificacionUsuarioCEN notificacionUsuarioCEN = new NotificacionUsuarioCEN();
                List <int>             OIDsParticipantes      = new List <int>();

                foreach (ProyectoEN proyectoEN in proyectoCEN.DameProyectosPorEvento(p_Evento_OID))
                {
                    foreach (UsuarioEN usuario in usuarioCEN.DameParticipantesProyecto(proyectoEN.Id))
                    {
                        if (!OIDsParticipantes.Contains(usuario.Id))
                        {
                            OIDsParticipantes.Add(usuario.Id);
                        }
                    }
                }

                foreach (int OIDUsuario in OIDsParticipantes)
                {
                    notificacionUsuarioCEN.New_(OIDUsuario, OID_notificacionEvento);
                }

                //Call to EventoCAD

                eventoCAD.Modify(eventoEN);


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


            /*PROTECTED REGION END*/
        }