Пример #1
0
        public static string GetHtml_statusBoxLikeShare(string statusId, string userId)
        {
            ApplicationDbContext dbContext = new ApplicationDbContext();
            ILikeRepository likeRepository = new LikeRepository(dbContext);

            int isLike = likeRepository.IsLiked(statusId, userId);
            string strLike = (isLike == 1) ? "unlike" : "like";

            return
            "<div class='box-like-share'>"
                + "<a class='like' data-isliked='" + isLike + "' data-statusid='" + statusId + "'>"
                    + strLike
                + "</a> &nbsp;<span data-statusid='" + statusId + "' class='glyphicon glyphicon-thumbs-up icon-liked' data-toggle='modal' data-target='#liked'></span> <span id='numLike-" + statusId + "'>" + likeRepository.Count(statusId) + "</span>"
                + "&nbsp;.&nbsp;"
                + "<a class='share' data-statusid='" + statusId + "'>Share</a> &nbsp;<span class='glyphicon glyphicon-share-alt'></span> <span id='numShare-" + statusId + "'>0</span>"
            + "</div>";
        }