Example #1
0
// Modify default (Update all attributes of the class)

        public void ModifyDefault(ReporteComentarioEN reporteComentario)
        {
            try
            {
                SessionInitializeTransaction();
                ReporteComentarioEN reporteComentarioEN = (ReporteComentarioEN)session.Load(typeof(ReporteComentarioEN), reporteComentario.Id_reporte);

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

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


            finally
            {
                SessionClose();
            }
        }
Example #2
0
        public ReporteComentarioEN ReadOIDDefault(int id_reporte
                                                  )
        {
            ReporteComentarioEN reporteComentarioEN = null;

            try
            {
                SessionInitializeTransaction();
                reporteComentarioEN = (ReporteComentarioEN)session.Get(typeof(ReporteComentarioEN), id_reporte);
                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(reporteComentarioEN);
        }
Example #3
0
        public int New_(ReporteComentarioEN reporteComentario)
        {
            try
            {
                SessionInitializeTransaction();
                if (reporteComentario.Comentario != null)
                {
                    // Argumento OID y no colección.
                    reporteComentario.Comentario = (YoureOnGenNHibernate.EN.YoureOn.ComentarioEN)session.Load(typeof(YoureOnGenNHibernate.EN.YoureOn.ComentarioEN), reporteComentario.Comentario.Id_comentario);

                    reporteComentario.Comentario.ReporteComentario
                    .Add(reporteComentario);
                }

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

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


            finally
            {
                SessionClose();
            }

            return(reporteComentario.Id_reporte);
        }
Example #4
0
        public void Modify(int p_ReporteComentario_OID, Nullable<DateTime> p_fecha)
        {
            ReporteComentarioEN reporteComentarioEN = null;

            //Initialized ReporteComentarioEN
            reporteComentarioEN = new ReporteComentarioEN ();
            reporteComentarioEN.Id_reporte = p_ReporteComentario_OID;
            reporteComentarioEN.Fecha = p_fecha;
            //Call to ReporteComentarioCAD

            _IReporteComentarioCAD.Modify (reporteComentarioEN);
        }
Example #5
0
        public int New_(Nullable<DateTime> p_fecha, int p_comentario)
        {
            ReporteComentarioEN reporteComentarioEN = null;
            int oid;

            //Initialized ReporteComentarioEN
            reporteComentarioEN = new ReporteComentarioEN ();
            reporteComentarioEN.Fecha = p_fecha;

            if (p_comentario != -1) {
                // El argumento p_comentario -> Property comentario es oid = false
                // Lista de oids id_reporte
                reporteComentarioEN.Comentario = new YoureOnGenNHibernate.EN.YoureOn.ComentarioEN ();
                reporteComentarioEN.Comentario.Id_comentario = p_comentario;
            }

            //Call to ReporteComentarioCAD

            oid = _IReporteComentarioCAD.New_ (reporteComentarioEN);
            return oid;
        }