// Modify default (Update all attributes of the class) public void ModifyDefault(NotificacionGenericaEN notificacionGenerica) { try { SessionInitializeTransaction(); NotificacionGenericaEN notificacionGenericaEN = (NotificacionGenericaEN)session.Load(typeof(NotificacionGenericaEN), notificacionGenerica.Id); notificacionGenericaEN.Tipo = notificacionGenerica.Tipo; notificacionGenericaEN.Texto = notificacionGenerica.Texto; notificacionGenericaEN.Nombre = notificacionGenerica.Nombre; session.Update(notificacionGenericaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is LePapeoGenNHibernate.Exceptions.ModelException) { throw ex; } throw new LePapeoGenNHibernate.Exceptions.DataLayerException("Error in NotificacionGenericaCAD.", ex); } finally { SessionClose(); } }
public NotificacionGenericaEN ReadOIDDefault(int id ) { NotificacionGenericaEN notificacionGenericaEN = null; try { SessionInitializeTransaction(); notificacionGenericaEN = (NotificacionGenericaEN)session.Get(typeof(NotificacionGenericaEN), id); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is LePapeoGenNHibernate.Exceptions.ModelException) { throw ex; } throw new LePapeoGenNHibernate.Exceptions.DataLayerException("Error in NotificacionGenericaCAD.", ex); } finally { SessionClose(); } return(notificacionGenericaEN); }
public void Destroy(int id ) { try { SessionInitializeTransaction(); NotificacionGenericaEN notificacionGenericaEN = (NotificacionGenericaEN)session.Load(typeof(NotificacionGenericaEN), id); session.Delete(notificacionGenericaEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is LePapeoGenNHibernate.Exceptions.ModelException) { throw ex; } throw new LePapeoGenNHibernate.Exceptions.DataLayerException("Error in NotificacionGenericaCAD.", ex); } finally { SessionClose(); } }
public int New_(NotificacionGenericaEN notificacionGenerica) { try { SessionInitializeTransaction(); session.Save(notificacionGenerica); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is LePapeoGenNHibernate.Exceptions.ModelException) { throw ex; } throw new LePapeoGenNHibernate.Exceptions.DataLayerException("Error in NotificacionGenericaCAD.", ex); } finally { SessionClose(); } return(notificacionGenerica.Id); }
public NotificacionGenericaEN ReadOID(int id ) { NotificacionGenericaEN notificacionGenericaEN = null; notificacionGenericaEN = _INotificacionGenericaCAD.ReadOID(id); return(notificacionGenericaEN); }
// GET: Registrado/Details/5 public ActionResult Details(int id) { NotificacionGenericaCEN NotificacionGenericaCEN = new NotificacionGenericaCEN(); NotificacionGenericaEN notiEN = NotificacionGenericaCEN.ReadOID(id); NotificacionGenericaViewModel notiVM = new AssemblerNotificacionGenerica().ConvertENToModelUI(notiEN); return(View(notiVM)); }
public NotificacionGenericaViewModel ConvertENToModelUI(NotificacionGenericaEN notigeEN) { NotificacionGenericaViewModel notige = new NotificacionGenericaViewModel(); notige.Id = notigeEN.Id; notige.Tipo = notigeEN.Tipo; notige.Texto = notigeEN.Texto; notige.Nombre = notigeEN.Nombre; return(notige); }
public void Modify(int p_NotificacionGenerica_OID, LePapeoGenNHibernate.Enumerated.LePapeo.TipoNotificacionEnum p_tipo, string p_texto, string p_nombre) { NotificacionGenericaEN notificacionGenericaEN = null; //Initialized NotificacionGenericaEN notificacionGenericaEN = new NotificacionGenericaEN(); notificacionGenericaEN.Id = p_NotificacionGenerica_OID; notificacionGenericaEN.Tipo = p_tipo; notificacionGenericaEN.Texto = p_texto; notificacionGenericaEN.Nombre = p_nombre; //Call to NotificacionGenericaCAD _INotificacionGenericaCAD.Modify(notificacionGenericaEN); }
public int New_(LePapeoGenNHibernate.Enumerated.LePapeo.TipoNotificacionEnum p_tipo, string p_texto, string p_nombre) { NotificacionGenericaEN notificacionGenericaEN = null; int oid; //Initialized NotificacionGenericaEN notificacionGenericaEN = new NotificacionGenericaEN(); notificacionGenericaEN.Tipo = p_tipo; notificacionGenericaEN.Texto = p_texto; notificacionGenericaEN.Nombre = p_nombre; //Call to NotificacionGenericaCAD oid = _INotificacionGenericaCAD.New_(notificacionGenericaEN); return(oid); }
// GET: Registrado/Delete/5 public ActionResult Delete(int id) { try { SessionInitialize(); NotificacionGenericaCAD notigeCAD = new NotificacionGenericaCAD(session); NotificacionGenericaCEN cen = new NotificacionGenericaCEN(notigeCAD); NotificacionGenericaEN notigeEN = cen.ReadOID(id); NotificacionGenericaViewModel notige = new AssemblerNotificacionGenerica().ConvertENToModelUI(notigeEN); SessionClose(); return(View(notige)); } catch { //Meter aqui el mensaje de error return(View()); } }