示例#1
0
        public ActionResult IndexProducts(int?categoryId)
        {
            Logica.BL.Categories categories = new Logica.BL.Categories();
            var listCategories = (from q in categories.GetCategories()
                                  select new Logica.Models.ViewModels.CategoriesIndexViewModel
            {
                Id = q.Id,
                Name = q.Name,
                Active = q.Active
            }).ToList();

            return(View(listCategories));
        }
示例#2
0
        // GET: Categories
        public ActionResult Index()
        {
            Logica.BL.Categories categories = new Logica.BL.Categories();

            var listCategories = (from q in categories.GetCategories()
                                  select new Logica.Models.ViewModels.CategoriesIndexViewModel
            {
                Id = q.Id,
                Name = q.Name,
                Active = q.Active
            }).ToList();

            return(RedirectToAction("IndexProducts"));
        }