Пример #1
0
        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));
            }
        }
Пример #2
0
        public JsonResult SubmitFaq(long id, string Name, string Email, string Content)
        {
            bool check = false;

            try
            {
                CommentsNewsBusiness commentbusiness = new CommentsNewsBusiness();
                Common.CommentsNew   comment         = new Common.CommentsNew();
                comment.NewId      = id;
                comment.Content    = Content;
                comment.CreateDate = DateTime.Now;
                comment.Email      = Email;
                comment.Status     = 1;
                comment.NickName   = Name;
                commentbusiness.AddNew(comment);
                check = true;
            }
            catch
            {
                check = false;
            }
            return(Json(new
            {
                data = check,
            }, JsonRequestBehavior.AllowGet));
        }