Ejemplo n.º 1
0
        // GET: MySearch
        public ActionResult Index()
        {
            // get 20 first categories for search combobox
            ProductionService service    = new ProductionService();
            List <Category>   categories = Task.Run(() => service.getAllCategories()).Result;

            categories = categories.OrderBy(c => c.CategoryId).Take(20).ToList();

            ViewBag.categories = categories;
            return(PartialView());
        }
Ejemplo n.º 2
0
        // GET: Category
        public async Task <ActionResult> Index(int?page)
        {
            // get all categories in system
            ProductionService service    = new ProductionService();
            List <Category>   categories = await service.getAllCategories();

            int pageSize   = 8;
            int pageNumber = (page ?? 1);

            return(View(categories.ToPagedList(pageNumber, pageSize)));
        }