コード例 #1
0
        public JsonResult AddLikeORDislikeOFComment(SubjectForum_Like_OR_Dislike Info)
        {
            OnlineCommunityComment CommentInfo = new OnlineCommunityComment();
            ResultInfo <string>    ResultInfo  = new ResultInfo <string>()
            {
                Status      = false,
                Description = "Failed|Login"
            };

            try
            {
                if (Info != null)
                {
                    SchoolStudent PageObj = new SchoolStudent();
                    ResultInfo.Info = PageObj.InsertLikeOrDislikeValueOfSubjectForum(Info);
                    ResultInfo.Info = PageObj.UpdateLikesDislikesInCommentTable(Info.CommentID, Info.LikeVal, Info.UID);

                    if (ResultInfo.Info != null)
                    {
                        ResultInfo.Description = "Success| Insert Like or dislike";
                        ResultInfo.Status      = true;
                    }
                }
            }
            catch (Exception ex)
            {
                ResultInfo.Description = ex.Message;
            }
            return(Json(ResultInfo, JsonRequestBehavior.AllowGet));
        }