Пример #1
0
        public JsonResult Gets(int status = 2, int page = 1, int pageSize = 5)
        {
            try
            {
                List <Banner> data     = dao.Gets(status, page, pageSize);
                int           totalRow = dao.Count(status);

                return(Json(new
                {
                    data = data,
                    totalRow = totalRow
                }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new
                {
                    data = DBNull.Value.ToString()
                }, JsonRequestBehavior.AllowGet));
            }
        }
Пример #2
0
        public PartialViewResult SlidePartial()
        {
            var bannerDAO = new BannerDAO();

            return(PartialView(bannerDAO.Gets(1, 0, 0)));
        }