コード例 #1
0
        public ActionResult RenderItems(int? page, string order)
        {
            string message = (string)TempData["StatusMessage"];
            ViewBag.message = message;
            var options = new QuoteFilterOptions()
            {
                Order = string.IsNullOrEmpty(order) ? string.Empty : order.ToLower()
            };

            ViewBag.order = order;

            int pageNo = page ?? 1;
            int total = _quoteService.Total(options);
            int totalPages = System.Convert.ToInt32(Math.Ceiling((decimal)total / (decimal)10));

            if (totalPages > pageNo)
                ViewBag.Next = (pageNo + 1);

            var model = _quoteService.GetAll(options, new PagingSettings() { PageCount = 10, PageIndex = pageNo });

            return PartialView("Controls/_RenderItems", model);
        }
コード例 #2
0
        public ActionResult Index(string order)
        {
            string message = (string)TempData["StatusMessage"];
            ViewBag.message = message;
            var options = new QuoteFilterOptions()
            {
                Order = string.IsNullOrEmpty(order) ? string.Empty : order.ToLower()
            };

            ViewBag.order = order;

            List<Quote> model = _quoteService.GetAll(options);
            return View(model);
        }