Example #1
0
        public ActionResult Edit(ArticleComment comment)
        {
            try
            {
                comment.LastUpdate = DateTime.Now;

                ViewBag.Success = true;

                if (comment.ID == -1)
                {
                    ArticleComments.Insert(comment);

                    UserNotifications.Send(UserID, String.Format("ویرایش نظر '{0}'", comment.Subject), "/Admin/ArticleComments/Edit/" + comment.ID, NotificationType.Success);

                    comment = new ArticleComment();
                }
                else
                {
                    ArticleComments.Update(comment);
                }
            }
            catch (Exception ex)
            {
                SetErrors(ex);
            }

            return(ClearView(model: comment));
        }
Example #2
0
        public JsonResult UpdateCheck(string Comment, int CommentID)
        {
            string          result = string.Empty;
            ArticleComments ac     = new ArticleComments();
            Boolean         check  = ac.Update(Comment, CommentID);

            if (check)
            {
                result = "OK";
            }
            else
            {
                result = "FAIL";
            }


            return(Json(result, JsonRequestBehavior.AllowGet));
        }