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)); }
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)); }