コード例 #1
0
ファイル: CourseController.cs プロジェクト: lzb-cc/Cmty
        public JsonResult MakeComment(string code, string content)
        {
            var ret = new CourseOperatorResp
            {
                Status = 0,
            };

            if (!Authority())
            {
                ret.Status = 1;
                ret.Msg    = @"请先登录!";
                return(Json(ret));
            }

            if (string.IsNullOrEmpty(code) || string.IsNullOrEmpty(content))
            {
                ret.Status = 2;
                ret.Msg    = @"";
                return(Json(ret));
            }

            var model = new CourseCommentService.CourseCommentView()
            {
                Code    = code,
                Content = content,
                Email   = Request.Cookies.Get(DefaultAuthenticationTypes.ApplicationCookie).Value,
                PubDate = DateTime.Now,
                Floor   = courseCommentClient.GetValidFloor(code)
            };

            courseCommentClient.AddComment(model);
            return(Json(ret));
        }
コード例 #2
0
ファイル: CourseController.cs プロジェクト: lzb-cc/Cmty
        public JsonResult CommentCancel(int id)
        {
            var ret = new CourseOperatorResp
            {
                Status = 0,
                Msg    = @"撤销成功!"
            };

            if (!Authority())
            {
                ret.Status = 1;
                ret.Msg    = @"请先登录!";
            }

            courseCommentClient.RemoveCommentById(id);
            return(Json(ret));
        }