Esempio n. 1
0
        public ActionResult CustomerIndex(string search, string type)
        {
            ViewBag.RestaurantTypes = new SelectList(typeDb.GetRestaurantTypes(), "Name", "Name");
            IndexRestaurantsVM vm = new IndexRestaurantsVM
            {
                Restaurants = db.GetRestaurantsFull(search, type),
                Search      = search,
                Type        = type
            };

            return(View(vm));
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            if (User.IsInRole("Manager"))
            {
                return(RedirectToAction("ManagerIndex", "Tables"));
            }
            if (User.IsInRole("Customer"))
            {
                return(RedirectToAction("CustomerIndex", "Restaurants"));
            }

            var         restaurants = restDb.GetRestaurantsFull();
            HomeIndexVM vm          = new HomeIndexVM
            {
                Restaurants = restaurants
            };

            return(View(vm));
        }