public ReporteContenidoEN ReadOIDDefault(int id_reporte ) { ReporteContenidoEN reporteContenidoEN = null; try { SessionInitializeTransaction(); reporteContenidoEN = (ReporteContenidoEN)session.Get(typeof(ReporteContenidoEN), id_reporte); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is YoureOnGenNHibernate.Exceptions.ModelException) { throw ex; } throw new YoureOnGenNHibernate.Exceptions.DataLayerException("Error in ReporteContenidoCAD.", ex); } finally { SessionClose(); } return(reporteContenidoEN); }
// Modify default (Update all attributes of the class) public void ModifyDefault(ReporteContenidoEN reporteContenido) { try { SessionInitializeTransaction(); ReporteContenidoEN reporteContenidoEN = (ReporteContenidoEN)session.Load(typeof(ReporteContenidoEN), reporteContenido.Id_reporte); session.Update(reporteContenidoEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is YoureOnGenNHibernate.Exceptions.ModelException) { throw ex; } throw new YoureOnGenNHibernate.Exceptions.DataLayerException("Error in ReporteContenidoCAD.", ex); } finally { SessionClose(); } }
public int New_(ReporteContenidoEN reporteContenido) { try { SessionInitializeTransaction(); if (reporteContenido.Contenido != null) { // Argumento OID y no colección. reporteContenido.Contenido = (YoureOnGenNHibernate.EN.YoureOn.ContenidoEN)session.Load(typeof(YoureOnGenNHibernate.EN.YoureOn.ContenidoEN), reporteContenido.Contenido.Id_contenido); reporteContenido.Contenido.Reporte .Add(reporteContenido); } session.Save(reporteContenido); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is YoureOnGenNHibernate.Exceptions.ModelException) { throw ex; } throw new YoureOnGenNHibernate.Exceptions.DataLayerException("Error in ReporteContenidoCAD.", ex); } finally { SessionClose(); } return(reporteContenido.Id_reporte); }
public void Modify(int p_ReporteContenido_OID, Nullable <DateTime> p_fecha) { ReporteContenidoEN reporteContenidoEN = null; //Initialized ReporteContenidoEN reporteContenidoEN = new ReporteContenidoEN(); reporteContenidoEN.Id_reporte = p_ReporteContenido_OID; reporteContenidoEN.Fecha = p_fecha; //Call to ReporteContenidoCAD _IReporteContenidoCAD.Modify(reporteContenidoEN); }
public int New_(Nullable <DateTime> p_fecha, int p_contenido) { ReporteContenidoEN reporteContenidoEN = null; int oid; //Initialized ReporteContenidoEN reporteContenidoEN = new ReporteContenidoEN(); reporteContenidoEN.Fecha = p_fecha; if (p_contenido != -1) { // El argumento p_contenido -> Property contenido es oid = false // Lista de oids id_reporte reporteContenidoEN.Contenido = new YoureOnGenNHibernate.EN.YoureOn.ContenidoEN(); reporteContenidoEN.Contenido.Id_contenido = p_contenido; } //Call to ReporteContenidoCAD oid = _IReporteContenidoCAD.New_(reporteContenidoEN); return(oid); }