public ActionResult SelectDate(int id)
        {
            var rest  = _reservationService.GetRestaurant(id);
            var model = new Kyckling.Web.Models.SelectDateModel
            {
                Id              = rest.Id,
                Name            = rest.Name,
                NumberOfPersons = 1,
                ReservationDate = DateTime.Now,
                PersonCountList = new SelectList(Enumerable.Range(1, rest.MaxPersonsBooking))
            };

            return(View(model));
        }
        public ActionResult SelectDate(SelectDateModel model)
        {
            if (ModelState.IsValid)
            {
                var totalReservations = _reservationService.GetReservations(model.Id, model.ReservationDate).ToList();
                int sum = 0;
                foreach (var v in totalReservations)
                {
                    sum += v.PersonCount;
                }

                var rest = _reservationService.GetRestaurant(model.Id);
                if (rest.DayCapacity - sum < model.NumberOfPersons)
                {
                    return RedirectToAction("Error", "Reservation",
                        new { id = rest.Id, message = "Tyvärr är restaurangen fullbokad denna dag!" });
                }

                //TEMPORÄRT
                return RedirectToAction("Create", "Reservation", new { id = model.Id, numberOfPersons = model.NumberOfPersons, date = model.ReservationDate});
            }
            //TEMPORÄRT
            return View();
        }
 public ActionResult SelectDate(int id)
 {
     var rest = _reservationService.GetRestaurant(id);
     var model = new Kyckling.Web.Models.SelectDateModel
     {
         Id = rest.Id,
         Name = rest.Name,
         NumberOfPersons = 1,
         ReservationDate = DateTime.Now,
         PersonCountList = new SelectList(Enumerable.Range(1, rest.MaxPersonsBooking))
     };
     return View(model);
 }