public JsonResult ReplyComment(long newid, long commentid, int status, string TraLoicontent) { try { CommentsNewsBusiness commentbusiness = new CommentsNewsBusiness(); Common.CommentsNew comment = new Common.CommentsNew(); comment = commentbusiness.GetCommentsByParentID(commentid); if (comment == null) { Common.CommentsNew comment1 = new Common.CommentsNew(); comment1.Content = TraLoicontent; comment1.CreateDate = DateTime.Now; comment1.NewId = newid; comment1.ParentId = commentid; comment1.Status = 2; comment1.NickName = SessionUtility.GetSessionName(Session); comment1.Email = ""; comment1.Rate = 5; commentbusiness.AddNew(comment1); } else { comment.Content = TraLoicontent; commentbusiness.Edit(comment); } return(Json(1, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { // _logger.Debug(ex.Message); return(Json(0, JsonRequestBehavior.AllowGet)); } }
public JsonResult ApprovedComment(long commentid, int status) { try { var Comments = _commentsNewBusiness.GetById(commentid); Comments.Status = status; _commentsNewBusiness.Edit(Comments); return(Json(1, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(0, JsonRequestBehavior.AllowGet)); } }