Exemple #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*/
        }
Exemple #2
0
        public void EliminaCategorias(int p_Evento_OID, System.Collections.Generic.IList <int> p_categoriasEventos_OIDs)
        {
            try
            {
                SessionInitializeTransaction();
                MultitecUAGenNHibernate.EN.MultitecUA.EventoEN eventoEN = null;
                eventoEN = (EventoEN)session.Load(typeof(EventoEN), p_Evento_OID);

                MultitecUAGenNHibernate.EN.MultitecUA.CategoriaProyectoEN categoriasEventosENAux = null;
                if (eventoEN.CategoriasEventos != null)
                {
                    foreach (int item in p_categoriasEventos_OIDs)
                    {
                        categoriasEventosENAux = (MultitecUAGenNHibernate.EN.MultitecUA.CategoriaProyectoEN)session.Load(typeof(MultitecUAGenNHibernate.EN.MultitecUA.CategoriaProyectoEN), item);
                        if (categoriasEventosENAux.EventosCategorizados.Contains(eventoEN))
                        {
                            if (eventoEN.CategoriasEventos.Contains(categoriasEventosENAux) == true)
                            {
                                eventoEN.CategoriasEventos.Remove(categoriasEventosENAux);
                                categoriasEventosENAux.EventosCategorizados.Remove(eventoEN);
                            }
                            else
                            {
                                throw new ModelException("The identifier " + item + " in p_categoriasEventos_OIDs you are trying to unrelationer, doesn't exist in EventoEN");
                            }
                        }
                    }
                }

                session.Update(eventoEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is MultitecUAGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new MultitecUAGenNHibernate.Exceptions.DataLayerException("Error in EventoCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
        public void AgregaEventos(int p_Proyecto_OID, System.Collections.Generic.IList <int> p_eventosAsociados_OIDs)
        {
            MultitecUAGenNHibernate.EN.MultitecUA.ProyectoEN proyectoEN = null;
            try
            {
                SessionInitializeTransaction();
                proyectoEN = (ProyectoEN)session.Load(typeof(ProyectoEN), p_Proyecto_OID);
                MultitecUAGenNHibernate.EN.MultitecUA.EventoEN eventosAsociadosENAux = null;
                if (proyectoEN.EventosAsociados == null)
                {
                    proyectoEN.EventosAsociados = new System.Collections.Generic.List <MultitecUAGenNHibernate.EN.MultitecUA.EventoEN>();
                }

                foreach (int item in p_eventosAsociados_OIDs)
                {
                    eventosAsociadosENAux = new MultitecUAGenNHibernate.EN.MultitecUA.EventoEN();
                    eventosAsociadosENAux = (MultitecUAGenNHibernate.EN.MultitecUA.EventoEN)session.Load(typeof(MultitecUAGenNHibernate.EN.MultitecUA.EventoEN), item);
                    if (!proyectoEN.EventosAsociados.Contains(eventosAsociadosENAux))
                    {
                        eventosAsociadosENAux.ProyectosPresentados.Add(proyectoEN);

                        proyectoEN.EventosAsociados.Add(eventosAsociadosENAux);
                    }
                }


                session.Update(proyectoEN);
                SessionCommit();
            }

            catch (Exception ex) {
                SessionRollBack();
                if (ex is MultitecUAGenNHibernate.Exceptions.ModelException)
                {
                    throw ex;
                }
                throw new MultitecUAGenNHibernate.Exceptions.DataLayerException("Error in ProyectoCAD.", ex);
            }


            finally
            {
                SessionClose();
            }
        }
Exemple #4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            EventoEN t = obj as EventoEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #5
0
 public EventoEN(EventoEN evento)
 {
     this.init(Id, evento.Nombre, evento.Descripcion, evento.FotosEvento, evento.FechaInicio, evento.FechaFin, evento.FechaInicioInscripcion, evento.ProyectosPresentados, evento.RecuerdosEvento, evento.CategoriasEventos, evento.NotificacionGenerada, evento.FechaTopeInscripcion);
 }