Example #1
0
        public IActionResult OnGet(int restaurantId)
        {
            Cuisines = htmlHelper.GetEnumSelectList <CuisineType>();

            Restaurant = RestaurantData.GetRestaurantById(restaurantId);
            if (Restaurant == null)
            {
                return(RedirectToPage("./NotFound", new { ResourceName = "EditRestaurant" }));
            }

            return(Page());
        }
        public IActionResult OnGet(int restaurantId)
        {
            Restaurant = RestaurantData.GetRestaurantById(restaurantId);

            if (Restaurant == null)
            {
                return(RedirectToPage("./NotFound", new { ResourceName = "RestaurantDetails" }));
            }

            return(Page());
            //System.Diagnostics.Debug.WriteLine(Restaurant); (To write a msg on Output View)
        }
Example #3
0
 public ActionResult OnGet(int restaurantId)
 {
     Restaurant = new Restaurant();
     Restaurant = _restaurant.GetRestaurantById(restaurantId);
     if (Restaurant == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     else
     {
         return(Page());
     }
 }
Example #4
0
        // GET: Restaurants/Details/5
        public IActionResult CustomerDetails(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var restaurant = _restRepo.GetRestaurantById(id);

            if (restaurant == null)
            {
                return(NotFound());
            }

            var restaurantMenu = new RestaurantMenu
            {
                Dishes = _dishRepo.AllDishes.Where(m => m.MenuId == restaurant.MenuId),
                //Category = cat.AllCategories,
                Category   = restaurant.Categories,
                Restaurant = restaurant
            };

            TempData["Reffer"] = Request.Headers["Referer"].ToString();
            return(View(restaurantMenu));
        }
Example #5
0
 public IActionResult Index(int?id)
 {
     TempData["RestID"] = id;
     return(View(_dishRepo.AllDishes.Where(D => D.MenuId == _restRepo.GetRestaurantById(id).MenuId).ToList()));
 }
Example #6
0
 public ActionResult OnGet(int restaurantId)
 {
     Restaurant = restaurantData.GetRestaurantById(restaurantId);
     return(Restaurant == null?RedirectToPage("./NotFound") : (ActionResult)Page());
 }