Ejemplo n.º 1
0
        public void DesvincularOpinion(int p_Notificacion_OID, int p_opinion_OID)
        {
            LePapeoGenNHibernate.EN.LePapeo.NotificacionEN notificacionEN = null;
            try
            {
                SessionInitializeTransaction();
                notificacionEN         = (NotificacionEN)session.Load(typeof(NotificacionEN), p_Notificacion_OID);
                notificacionEN.Opinion = (LePapeoGenNHibernate.EN.LePapeo.OpinionEN)session.Load(typeof(LePapeoGenNHibernate.EN.LePapeo.OpinionEN), p_opinion_OID);

                notificacionEN.Opinion.Notificacion.Add(notificacionEN);



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

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


            finally
            {
                SessionClose();
            }
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            NotificacionEN t = obj as NotificacionEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public void DesvincularReserva(int p_Notificacion_OID, int p_reserva_OID)
        {
            try
            {
                SessionInitializeTransaction();
                LePapeoGenNHibernate.EN.LePapeo.NotificacionEN notificacionEN = null;
                notificacionEN = (NotificacionEN)session.Load(typeof(NotificacionEN), p_Notificacion_OID);

                if (notificacionEN.Reserva.Id == p_reserva_OID)
                {
                    notificacionEN.Reserva = null;
                }
                else
                {
                    throw new ModelException("The identifier " + p_reserva_OID + " in p_reserva_OID you are trying to unrelationer, doesn't exist in NotificacionEN");
                }

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

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


            finally
            {
                SessionClose();
            }
        }
Ejemplo n.º 4
0
 public NotificacionEN(NotificacionEN notificacion)
 {
     this.init(Id, notificacion.Contenido, notificacion.NotificacionGenerica, notificacion.Fecha, notificacion.Enviada, notificacion.Usuario, notificacion.Opinion, notificacion.Reserva);
 }