public void AgregarDireccion(int p_Registrado_OID, int p_direccion_0_OID) { LePapeoGenNHibernate.EN.LePapeo.RegistradoEN registradoEN = null; try { SessionInitializeTransaction(); registradoEN = (RegistradoEN)session.Load(typeof(RegistradoEN), p_Registrado_OID); registradoEN.Direccion_0 = (LePapeoGenNHibernate.EN.LePapeo.DireccionEN)session.Load(typeof(LePapeoGenNHibernate.EN.LePapeo.DireccionEN), p_direccion_0_OID); registradoEN.Direccion_0.Registrado.Add(registradoEN); session.Update(registradoEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is LePapeoGenNHibernate.Exceptions.ModelException) { throw ex; } throw new LePapeoGenNHibernate.Exceptions.DataLayerException("Error in RegistradoCAD.", ex); } finally { SessionClose(); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } RegistradoEN t = obj as RegistradoEN; if (t == null) { return(false); } if (Id.Equals(t.Id)) { return(true); } else { return(false); } }
public void DesvincularDireccion(int p_Registrado_OID, int p_direccion_0_OID) { try { SessionInitializeTransaction(); LePapeoGenNHibernate.EN.LePapeo.RegistradoEN registradoEN = null; registradoEN = (RegistradoEN)session.Load(typeof(RegistradoEN), p_Registrado_OID); if (registradoEN.Direccion_0.Id == p_direccion_0_OID) { registradoEN.Direccion_0 = null; } else { throw new ModelException("The identifier " + p_direccion_0_OID + " in p_direccion_0_OID you are trying to unrelationer, doesn't exist in RegistradoEN"); } session.Update(registradoEN); SessionCommit(); } catch (Exception ex) { SessionRollBack(); if (ex is LePapeoGenNHibernate.Exceptions.ModelException) { throw ex; } throw new LePapeoGenNHibernate.Exceptions.DataLayerException("Error in RegistradoCAD.", ex); } finally { SessionClose(); } }
public RegistradoEN(RegistradoEN registrado) { this.init(Id, registrado.Nombre, registrado.Apellidos, registrado.Fecha_nac, registrado.Reserva, registrado.Opinion, registrado.Direccion_0, registrado.Email, registrado.Pass, registrado.Notificacion, registrado.Fecha_inscripcion); }