MVC Json 回报

/// <summary>
        /// 获取评论列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public ActionResult GetCommentList(int pageIndex=1)
        { 
            try{
                WebUser webuser= FunSession.GetSession() as WebUser;
                var pageCount=0;
                var list = HotelOrderInfoService.GetHotelCommentList(webuser.Id, pageIndex, out pageCount);
                return new JsonResult
                {
                    Data = new { mdata = list, pageIndex = pageIndex, pageCount = pageCount, success = true },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                };

            }catch(Exception ex)
            {
                return new JsonResult
                {
                    Data = new { mdata = "", pageIndex = pageIndex, pageCount = 0, success = false },
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet
                };
            }
           
        }

版权声明:本文博客原创文章,博客,未经同意,不得转载。

posted @ 2015-07-26 10:46  hrhguanli  阅读(137)  评论(0编辑  收藏  举报