public int New_(string p_titulo, string p_mensaje, int p_eventoGenerador)
        {
            /*PROTECTED REGION ID(MultitecUAGenNHibernate.CEN.MultitecUA_NotificacionEvento_new__customized) ENABLED START*/

            NotificacionEventoEN notificacionEventoEN = null;

            int oid;

            //Initialized NotificacionEventoEN
            notificacionEventoEN        = new NotificacionEventoEN();
            notificacionEventoEN.Titulo = p_titulo;

            notificacionEventoEN.Mensaje = p_mensaje;


            if (p_eventoGenerador != -1)
            {
                notificacionEventoEN.EventoGenerador    = new MultitecUAGenNHibernate.EN.MultitecUA.EventoEN();
                notificacionEventoEN.EventoGenerador.Id = p_eventoGenerador;
            }

            notificacionEventoEN.Fecha = DateTime.Now;

            //Call to NotificacionEventoCAD

            oid = _INotificacionEventoCAD.New_(notificacionEventoEN);
            return(oid);
            /*PROTECTED REGION END*/
        }
        public NotificacionEventoEN ReadOIDDefault(int id
                                                   )
        {
            NotificacionEventoEN notificacionEventoEN = null;

            try
            {
                SessionInitializeTransaction();
                notificacionEventoEN = (NotificacionEventoEN)session.Get(typeof(NotificacionEventoEN), id);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(notificacionEventoEN);
        }
// Modify default (Update all attributes of the class)

        public void ModifyDefault(NotificacionEventoEN notificacionEvento)
        {
            try
            {
                SessionInitializeTransaction();
                NotificacionEventoEN notificacionEventoEN = (NotificacionEventoEN)session.Load(typeof(NotificacionEventoEN), notificacionEvento.Id);

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

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


            finally
            {
                SessionClose();
            }
        }
        public int New_(NotificacionEventoEN notificacionEvento)
        {
            try
            {
                SessionInitializeTransaction();
                if (notificacionEvento.EventoGenerador != null)
                {
                    // Argumento OID y no colección.
                    notificacionEvento.EventoGenerador = (MultitecUAGenNHibernate.EN.MultitecUA.EventoEN)session.Load(typeof(MultitecUAGenNHibernate.EN.MultitecUA.EventoEN), notificacionEvento.EventoGenerador.Id);

                    notificacionEvento.EventoGenerador.NotificacionGenerada
                    .Add(notificacionEvento);
                }

                session.Save(notificacionEvento);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(notificacionEvento.Id);
        }
Ejemplo n.º 5
0
        public NotificacionEventoEN ReadOID(int id
                                            )
        {
            NotificacionEventoEN notificacionEventoEN = null;

            notificacionEventoEN = _INotificacionEventoCAD.ReadOID(id);
            return(notificacionEventoEN);
        }