Exemplo n.º 1
0
 private void CreateDynamicInfo()
 {
     Task.Factory.StartNew(() =>
     {
         try
         {
             UserDynamicInfoBo.CreateDynamicInfoMessage(UserInfoID, DynamicInfoType.NewWebFolder, this);
         }
         catch (Exception ex)
         {
             LogHelper.WriteException("CreateDynamicInfoMessage", ex, new { UserInfoID = UserInfoID, Folder = this });
         }
     });
 }
Exemplo n.º 2
0
 private void CreateDynamicInfo()
 {
     Task.Factory.StartNew(() =>
     {
         try
         {
             var model = DAL.GetByUserInfoIAndHashcode(UserInfoID, HashCode);
             if (model != null)
             {
                 BookmarkInfoID = model.BookmarkInfoID;
                 UserDynamicInfoBo.CreateDynamicInfoMessage(UserInfoID, DynamicInfoType.NewBookmark, this);
             }
         }
         catch (Exception ex)
         {
             LogHelper.WriteException("CreateDynamicInfoMessage", ex, new { UserInfoID = UserInfoID, Bookmark = this });
         }
     });
 }
Exemplo n.º 3
0
        public ActionResult AddBookmarkLikeLog(long bookmarkID)
        {
            BizResultInfo result   = new BizResultInfo();
            var           loginUID = UILoginHelper.GetUIDFromHttpContext(HttpContext);

            var bookmarkInfo = BizBookmarkInfo.LoadByID(bookmarkID);

            if (bookmarkInfo != null)
            {
                var likelog = BizLikeLog.LoadUserIDAndBookmarkID(loginUID, bookmarkID);
                if (likelog != null)
                {
                    result.IsSuccess    = false;
                    result.ErrorMessage = "你已经点赞过了呀,不要重复点赞了。";
                }
                else
                {
                    likelog            = new BizLikeLog();
                    likelog.InfoID     = bookmarkID;
                    likelog.InfoType   = (int)InfoTypeEnum.Bookmark;
                    likelog.UserInfoID = loginUID;
                    likelog.Save();

                    bookmarkInfo.LoadLikeLog();
                    result.Target         = bookmarkInfo.LikeCount;
                    result.IsSuccess      = true;
                    result.SuccessMessage = "点赞成功。";

                    UserDynamicInfoBo.CreateDynamicInfoMessage(loginUID, DynamicInfoType.NewLikeBookmark, bookmarkInfo);
                    MessageBo.CreateMessage(loginUID, MessageTypeEnum.NewLikeBookmarkLog, bookmarkInfo);
                }
            }
            else
            {
                result.IsSuccess    = false;
                result.ErrorMessage = "找不到书签呀,刷新一下再来试试?";
            }


            return(Json(result));
        }
Exemplo n.º 4
0
        public ActionResult SaveBookmarkComment(long bookmarkID, string content)
        {
            BizResultInfo result = new BizResultInfo();

            try
            {
                var bookmark = BizBookmarkInfo.LoadByID(bookmarkID);
                if (bookmark == null || bookmark.BookmarkInfoID == 0)
                {
                    result.IsSuccess    = false;
                    result.ErrorMessage = "序列化书签数据失败,目测你要重新加载页面。";
                    return(Json(result));
                }
                BizBookmarkComment comment = new BizBookmarkComment();
                comment.CriticsUserID  = UILoginHelper.GetUIDFromHttpContext(HttpContext);
                comment.CommentTitle   = "";
                comment.CommentContent = content;
                comment.BookmarkInfoID = bookmark.BookmarkInfoID;
                comment.CreateTime     = DateTime.Now;
                comment.BookmarkUserID = bookmark.UserInfoID;
                comment.Save();
                var loginUID = UILoginHelper.GetUIDFromHttpContext(HttpContext);
                MessageBo.CreateMessage(bookmark.UserInfoID, MessageTypeEnum.NewBookmarkComment, comment);
                UserDynamicInfoBo.CreateDynamicInfoMessage(loginUID, DynamicInfoType.NewBookmarkComment, bookmark);

                result.IsSuccess      = true;
                result.SuccessMessage = "提交成功。";
            }catch (Exception ex)
            {
                LogHelper.WriteException("SaveBookmarkComment", ex, new {
                    BookmarkID = bookmarkID,
                    SubmitUser = UILoginHelper.GetUIDFromHttpContext(HttpContext),
                    Content    = content,
                });
                result.ErrorMessage = "提交失败,目测网络挂了或者别的....";
                result.IsSuccess    = false;
            }
            return(Json(result));
        }
Exemplo n.º 5
0
        public ActionResult FollowUser(long beFollowUserID)
        {
            BizResultInfo result     = new BizResultInfo();
            var           befollower = BizUserInfo.LoadByUserInfoID(beFollowUserID);

            if (beFollowUserID == 0 || befollower == null || befollower.UserInfoID == 0)
            {
                result.IsSuccess    = false;
                result.ErrorMessage = "关注者ID为空,这是一条垃圾数据呀。";
                return(Json(result));
            }
            long userID = UILoginHelper.GetUIDFromHttpContext(HttpContext);
            var  status = UserRelationshipBo.CheckFollowStatus(beFollowUserID, userID);

            if (status)
            {
                result.IsSuccess    = false;
                result.ErrorMessage = "您已经关注了此用户,不能重复关注。";
                return(Json(result));
            }

            var userRelationship = new BizUserRelationship()
            {
                BeFollwedUID = beFollowUserID,
                FollowerID   = userID,
                CreateTime   = DateTime.Now,
            };

            userRelationship.Save();

            MessageBo.CreateMessage(userID, MessageTypeEnum.NewBeFollow, userRelationship);
            UserDynamicInfoBo.CreateDynamicInfoMessage(userID, DynamicInfoType.NewFollower, befollower);
            result.IsSuccess = true;

            return(Json(result));
        }