Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            GustosEN t = obj as GustosEN;

            if (t == null)
            {
                return(false);
            }
            if (Id.Equals(t.Id))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public NuevoInmueblateGenNHibernate.EN.RedSocial.GustosEN              GetGustosOfUsuario_NuevoInmueblate(int id)
        {
            NuevoInmueblateGenNHibernate.EN.RedSocial.GustosEN result = null;
            try
            {
                SessionInitializeTransaction();

                /*
                 * String sql = @"select self FROM GustosEN self inner join self.Usuario as target with target.Id=:p_Id";
                 * IQuery query = session.CreateQuery(sql).SetParameter("p_Id", id);
                 */
                String sql   = @"select self.Gustos FROM UsuarioEN self where self.Id=:p_Id";
                IQuery query = session.CreateQuery(sql).SetParameter("p_Id", id);



                result = query.UniqueResult <NuevoInmueblateGenNHibernate.EN.RedSocial.GustosEN>();

                SessionCommit();
            }

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


            finally
            {
                SessionClose();
            }

            return(result);
        }
Exemplo n.º 3
0
 public GustosEN(GustosEN gustos)
 {
     this.init(Id, gustos.PendienteModeracion, gustos.Musica, gustos.Libros, gustos.Peliculas, gustos.Juegos, gustos.Usuario);
 }