public ActionResult FeedbackPage(int pageSize, int pageNum = 1) { int totalCount = 0; List <Feedback> FeedbackList = FeedbackDataSvc.GetPagedEntitys(ref pageNum, pageSize, it => true, it => it.InsertDate, true, out totalCount).ToList(); ViewBag.FeedbackList = FeedbackList; ViewBag.TotalCount = totalCount; ViewBag.CurrentPage = pageNum; ViewBag.ShowPager = totalCount > pageSize; return(View()); }
public ActionResult AddFeedback(string txt) { if (string.IsNullOrEmpty(txt)) { return(Json(new { msg = "参数错误" })); } if (txt.GetByteCount() > 400) { return(Json(new { msg = "参数太长" })); } Feedback fb = new Feedback(); fb.UserName = CurrentUser.UserName; fb.Content = HttpUtility.HtmlEncode(txt); FeedbackDataSvc.Add(fb); return(Json(new { msg = "done" })); }