public ActionResult Reply(string message = "", int commentId = 0, int replyId = 0) { int result = (int)ErrorMessage.失败; bool isOpen = SiteSection.Comment.IsOpen; if (isOpen && commentId > 0) { NovelCommentReply reply = new NovelCommentReply(); reply = GetClientLogInfo(reply) as NovelCommentReply; reply.UserId = currentUser.UserId; reply.UserName = currentUser.UserName; reply.Message = StringHelper.HtmlEncode(message); reply.GoodCount = 0; reply.BadCount = 0; reply.ToUserId = 0; reply.ToUserName = ""; reply.ToNickName = ""; reply.ReplyId = replyId; reply.ReplyPath = "0"; reply.ReplyLevel = replyId == 0 ? 1 : 2; reply.Status = (int)Constants.Status.yes; reply.Creator = ""; reply.CommentId = commentId; reply.ToReplyId = replyId; result = _commentService.Reply(reply); } return(Json(new ComplexResponse <string>(result))); }
public int Reply(NovelCommentReply reply) { if (reply == null) { return(0); } using (var conn = DbConnection(DbOperation.Write)) { var repo = new NovelCommentReplyRepo(conn); return(repo.Reply(reply)); } }