Beispiel #1
0
        public ActionResult LoadComment()
        {
            int id          = int.Parse(Request["id"]);
            var CommentList = ArticelCommentBLL.LoadEntity(a => a.ArticelID == id && a.IsPass == 1).ToList();
            List <ArticleCommentViewModel> newList = new List <ArticleCommentViewModel>();

            foreach (var articleModel in CommentList)
            {
                ArticleCommentViewModel model = new ArticleCommentViewModel();
                TimeSpan ts = DateTime.Now - articleModel.AddDate;
                model.AddDate = WebCommon.GetTimespan(ts);
                model.Msg     = articleModel.Msg;
                newList.Add(model);
            }
            return(Content(Common.SerializeHelper.SerializeToString(newList)));
        }