Example #1
0
        public IActionResult Aanmaken(ResRevViewModel vm)
        {
            Reservering reservering = ReserveringConverter.DetailViewModelToModel(vm.ReserveringDetailViewModel);
            Restaurant  restaurant  = RestaurantConverter.DetailViewModelToModel(vm.RestaurantDetailViewModel);

            ReserveringRepo.CreateReservering(reservering.datetime, restaurant.RestaurantID, 1);
            return(RedirectToAction("Index", controllerName: "Restaurant"));
        }
Example #2
0
        //Bekijkt de detail van een restaurant.
        public IActionResult Detail(int id)
        {
            Restaurant r = rep.GetRestaurantByID(id);

            if (r == null)
            {
                r = rep.GetRestaurantByID((int)HttpContext.Session.GetInt32("RestaurantID"));
            }
            ResRevViewModel vm = new ResRevViewModel();

            vm.RestaurantDetailViewModel = converter.ModelToDetailViewModel(r);
            return(View(vm));
        }