Exemplo n.º 1
0
        public static List <Newsfeed> RankNewsFeed(List <Newsfeed> lst)
        {
            foreach (var post in lst)
            {
                post.AffinityScore = 0;
                post.PostWeight    = 0;

                if (post.Type == Global.PHOTO || post.Type == Global.TAG_PHOTO)
                {
                    post.PostWeight += Global.WEIGHT_PHOTO;
                }
                else
                if (post.Type == Global.VIDEO || post.Type == Global.TAG_VIDEO)
                {
                    post.PostWeight += Global.WEIGHT_VIDEO;
                }
                else
                if (post.Type == Global.TAG_VIDEOLINK)
                {
                    post.PostWeight += Global.WEIGHT_VIDEOLINK;
                }
                else
                if (post.Type == Global.TEXT_POST)
                {
                    post.PostWeight += Global.WEIGHT_TEXT;
                }
                long likesCount = LikesDAL.countPost(post._id.ToString(), Global.WALL);

                long sharesCount   = ShareDAL.countPost(post._id.ToString(), Global.WALL);
                long commentsCount = CommentsDAL.countComment(post._id.ToString(), Global.WALL);

                post.PostWeight += (int)likesCount;

                post.PostWeight += (int)sharesCount;
                post.PostWeight += (int)commentsCount;

                post.PostRank = post.PostWeight + post.AffinityScore;
            }
            return(lst);
        }
Exemplo n.º 2
0
 public static long countPost(string Atid, int type)
 {
     return LikesDAL.countPost(Atid, type);
 }
Exemplo n.º 3
0
 public static List<Likes> getLikesTop(int Type, string AtId)
 {
     return LikesDAL.getLikesTop( Type,  AtId);
 }
Exemplo n.º 4
0
 public static LikesBO getLikesByLikesId(string LikesId)
 {
     return LikesDAL.getLikesByLikesId(LikesId);
 }
Exemplo n.º 5
0
 public static List<Likes> getAllLikesList()
 {
     return LikesDAL.getAllLikesList();
 }
Exemplo n.º 6
0
        public static bool youLikes(LikesBO objClass)
        {
            return LikesDAL.youLikes(objClass);

        }
Exemplo n.º 7
0
        public static void unLikes(LikesBO objClass)
        {

            LikesDAL.unLikes(objClass);
        }
Exemplo n.º 8
0
 public static void updateLikes(LikesBO objLikes)
 {
     LikesDAL.updateLikes(objLikes);
 }
Exemplo n.º 9
0
 public static void deleteLikes(string LikesId)
 {
     LikesDAL.deleteLikes(LikesId);
 }
Exemplo n.º 10
0
 public static void insertLikes(LikesBO objLikes)
 {
       LikesDAL.insertLikes(objLikes);
 }