Ejemplo n.º 1
0
        public ActionResult UnactiveMenuItems()
        {
            IEnumerable <MenuItemViewModel> model  = new List <MenuItemViewModel>();
            MenuItemRepository inventoryRepository = new MenuItemRepository(new ApplicationDbContext());
            string             customerId          = null;
            var firstOrDefault = new ApplicationDbContext().Users.FirstOrDefault(cus => cus.UserName == User.Identity.Name);

            if (firstOrDefault !=
                null)
            {
                customerId = firstOrDefault.Id;
                model      = inventoryRepository.GetAllUnactive(customerId);
                return(View(model));
            }


            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult UnactiveMenuItems()
        {
            IEnumerable<MenuItemViewModel> model = new List<MenuItemViewModel>();
            MenuItemRepository inventoryRepository = new MenuItemRepository(new ApplicationDbContext());
            string customerId = null;
            var firstOrDefault = new ApplicationDbContext().Users.FirstOrDefault(cus => cus.UserName == User.Identity.Name);
            if (firstOrDefault !=
                null)
            {
                customerId = firstOrDefault.Id;
                model = inventoryRepository.GetAllUnactive(customerId);
                return View(model);
            }

            return View(model);
        }