Пример #1
0
        public ActionResult AddComment(String contentID, String content, String toMember, String commentId)
        {
            String userID = User.Identity.Name;
            CBB.ExceptionHelper.OperationResult result = null;

            BiZ.Comment.Comment comment = AddCommentFunc(userID, contentID, content);

            Models.PageModels.Comment.CommentModel model = new Models.PageModels.Comment.CommentModel();
            model.contentObject = new BiZ.Content.PublicContent().getPublicContent(contentID);
            //增加用户关联动态
            ActivityController.addActivityToContent(model.contentObject, comment, userID, "addComment");

            //评论被评论
            if (toMember != "" && toMember != null)
            {
                IList<BiZ.Content.PublicContent> pcs = BiZ.Content.ContentProvider.GetIDMemberContent(contentID, toMember, 0, 0);
                string strContentType = "",
                    imagesStr = "";
                if (pcs.Count < 1)
                {
                    BiZ.Comment.Comment comment2 = BiZ.Comment.CommentProvider.GetComment(commentId);

                    switch (model.contentObject.ContentType)
                    {
                        case BiZ.Content.ContentType.Image:
                            strContentType = "图片";
                            imagesStr = ActivityController.GetMemberActivityContentImages(model.contentObject);
                            break;
                        case BiZ.Content.ContentType.SuiSuiNian:
                            imagesStr = ActivityController.GetMemberActivityContentImages(model.contentObject);
                            strContentType = "说说";
                            break;
                        case BiZ.Content.ContentType.IWant:
                            strContentType = "我想";
                            imagesStr = ActivityController.GetMemberActivityContentImages(model.contentObject);
                            break;
                        case BiZ.Content.ContentType.Mood:
                            strContentType = "心情";
                            string statusMood = ((BiZ.Content.MoodContent)model.contentObject).Type;
                            switch (statusMood)
                            {
                                case "0": strContentType = "好心情";
                                    break;
                                case "1": strContentType = "坏心情";
                                    break;
                                default: break;
                            }
                            break;
                        case BiZ.Content.ContentType.InterView:
                            strContentType = "访谈";
                            break;
                        case BiZ.Content.ContentType.CallFor:
                            imagesStr = ActivityController.GetMemberActivityContentImages(model.contentObject);
                            strContentType = "号召";
                            break;
                        case BiZ.Content.ContentType.Interest:
                            strContentType = "兴趣";
                            break;
                        case BiZ.Content.ContentType.Member:
                            strContentType = "用户动态";
                            string statusMember = ((BiZ.Content.MemberContent)model.contentObject).Type;
                            switch (statusMember)
                            {
                                case "0":
                                    strContentType = "新位置";
                                    break;
                                case "1":
                                    strContentType = "新头像";
                                    break;
                                default:
                                    break;
                            }

                            break;
                        default:
                            break;
                    }

                    ////增加用户关联动态
                    //result = BiZ.Member.Activity.ActivityController.AddActivityRelatedToMe(
                    //    toMember,
                    //    userID,
                    //    BiZ.Member.Activity.ActivityType.CommentBeenReplied,
                    //    BiZ.Member.Activity.ActivityController.GetActivityContent_CommentBeenReplied_Title(),
                    //    BiZ.Member.Activity.ActivityController.GetActivityContent_CommentBeenReplied(
                    //        model.contentObject.ID,
                    //        comment.Content,
                    //        comment2.Content,
                    //        strContentType,
                    //        imagesStr
                    //        ),
                    //    false
                    //    );

                    string replyStr = comment.Content;
                    int replyIndexOfChar = replyStr.IndexOf(':');
                    string replyStr2 = replyStr.Substring(replyIndexOfChar + 1, replyStr.Length - replyIndexOfChar - 1);
                    BiZ.Member.Member member = BiZ.MemberManager.MemberManager.GetMember(toMember);

                    string msgStr = "|" + member.MemberInfomation.NickName + ":" + comment2.Content + "\n" + replyStr2 + "";
                    BiZ.Member.Activity.ActivityController.MsgToMember(
                        userID,
                        toMember,
                        msgStr,
                        BiZ.Member.Activity.ActivityType.CommentBeenReplied);

                }
            }

            //增加用户动态到后台
            BiZ.Sys.MemberActivity.MemberActivityProvider.CreateMemberActivity(
                userID,
                toMember,
                BiZ.Sys.MemberActivity.MemberActivityType.Comment,
                "/Content/ContentDetail/" + model.contentObject.ID);

            return Json(new JavaScriptSerializer().Serialize(model));
        }
Пример #2
0
        public ActionResult AddMemberLabelComment(String contentID, String content, String memberLabel)
        {
            String userID = User.Identity.Name;

            BiZ.Comment.Comment comment = AddCommentFunc(userID, contentID, content);

            Models.PageModels.Comment.CommentModel model = new Models.PageModels.Comment.CommentModel();
            model.commentList = BiZ.Comment.CommentProvider.GetMemberNameContentIDComment(contentID, "回应" + memberLabel + ":", BiZ.Comm.DeletedFlag.No, 0, 0);
            model.commentCount = model.commentList.Count;
            model.contentObject = new BiZ.Content.PublicContent().getPublicContent(contentID);

            //增加用户关联动态
            ActivityController.addActivityToContent(model.contentObject, comment, userID, "addComment");
            return Json(new JavaScriptSerializer().Serialize(model));
        }
Пример #3
0
 public ActionResult GetMemberLabelComment(String contentID, String memberLabel)
 {
     Models.PageModels.Comment.CommentModel model = new Models.PageModels.Comment.CommentModel();
     model.commentList = BiZ.Comment.CommentProvider.GetMemberNameContentIDComment(contentID, "回应" + memberLabel + ":", BiZ.Comm.DeletedFlag.No, 0, 0);
     model.commentCount = model.commentList.Count;
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Пример #4
0
        public ActionResult ShowComment(String contentID, string pageno, string pagesize)
        {
            if (contentID == null) return RedirectToAction("Error", "Error", new { errorno = "0" });
            if (pageno == null) return RedirectToAction("Error", "Error", new { errorno = "0" });
            if (pagesize == null) return RedirectToAction("Error", "Error", new { errorno = "0" });
            int pgNo = 0, pgSize = 0;
            if (!int.TryParse(pageno, out pgNo)) return RedirectToAction("Error", "Error", new { errorno = "0" });
            if (!int.TryParse(pagesize, out pgSize)) return RedirectToAction("Error", "Error", new { errorno = "0" });

            IList<BiZ.Comment.Comment> commentList = BiZ.Comment.CommentProvider.findForContent(contentID, BiZ.Comm.DeletedFlag.No, pgNo, pgSize);
            Models.PageModels.Comment.CommentModel model = new Models.PageModels.Comment.CommentModel();
            model.commentList = commentList;
            model.contentObject = new BiZ.Content.PublicContent().getPublicContent(contentID);
            return Json(new JavaScriptSerializer().Serialize(model));
        }