Пример #1
0
        public JsonResult ReplyList(int type, int pageIndex, int pageSize)
        {
            int total     = 0;
            int pageCount = 0;
            var list      = UserReplyBusiness.GetUserReplys(type == 1 ? "": CurrentUser.UserID,
                                                            type == 1 ?  CurrentUser.UserID:"", type == 2 ? 1 : type, pageSize, pageIndex, ref total, ref pageCount);

            if (type == 2)
            {
                list.ForEach(x =>
                {
                    if (x.Status == 0)
                    {
                        x.Content = "该信息共有" + x.Content.Length + "个字...";
                    }
                }
                             );
            }
            JsonDictionary.Add("items", list);
            JsonDictionary.Add("totalCount", total);
            JsonDictionary.Add("pageCount", pageCount);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Пример #2
0
        public JsonResult GetMsgList(int type, int pageIndex)
        {
            int total     = 0;
            int pageCount = 0;
            var list      = UserReplyBusiness.GetUserReplys(CurrentUser.UserID, "", type, PageSize, pageIndex, ref total,
                                                            ref pageCount);

            JsonDictionary.Add("items", list);
            JsonDictionary.Add("totalCount", total);
            JsonDictionary.Add("pageCount", pageCount);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }