Пример #1
0
        public bool IsVip(string userid)
        {
            Boolean isvip = false;
            myWeiboDB202005061120Entities db = new myWeiboDB202005061120Entities();
            Users userI = db.UsersSet.Where(useri => useri.UserId == userid).FirstOrDefault();

            if (userI.Vip == true)
            {
                isvip = true;
            }
            return(isvip);
        }
Пример #2
0
        public bool IsSPFollowed(string user1id, int user2id)
        {
            Boolean isspfollowed             = false;
            myWeiboDB202005061120Entities db = new myWeiboDB202005061120Entities();
            Users           userI            = db.UsersSet.Where(useri => useri.UserId == user1id).FirstOrDefault();
            SpecialFollowed spfollow         = db.SpecialFollowedSet.Where(spi => spi.UsersId == userI.Id && spi.SPFollowedsId == user2id).FirstOrDefault();

            if (spfollow != null)
            {
                isspfollowed = true;
            }
            return(isspfollowed);
        }
Пример #3
0
        public bool IsFollowed(string userid, int followedid)
        {
            Boolean isfollowed = false;
            myWeiboDB202005061120Entities db = new myWeiboDB202005061120Entities();
            Users    userI  = db.UsersSet.Where(useri => useri.UserId == userid).FirstOrDefault();
            Followed follow = db.FollowedSet.Where(f => f.UsersId == userI.Id && f.FollowedsId == followedid).FirstOrDefault();

            if (follow != null)
            {
                isfollowed = true;
            }
            return(isfollowed);
        }
Пример #4
0
        public bool IsLiked(string userid, int postid)
        {
            Boolean isliked = false;
            myWeiboDB202005061120Entities db = new myWeiboDB202005061120Entities();
            Users userI = db.UsersSet.Where(ui => ui.UserId == userid).FirstOrDefault();
            Likes like  = db.LikesSet.Where(l => l.UsersId == userI.Id && l.PostsId == postid).FirstOrDefault();

            if (like != null)
            {
                isliked = true;
            }
            return(isliked);
        }