Beispiel #1
0
        public ActionResult Edit(int Id)
        {
            ReservationsRepository repo          = new ReservationsRepository();
            Reservation            dbreservation = new Reservation();

            dbreservation = repo.Get(Id);
            ReservationsEditViewModel model = new ReservationsEditViewModel();

            model.PeopleCount     = dbreservation.PeopleCount;
            model.ReservationTime = dbreservation.ReservationTime;
            model.Comment         = dbreservation.Comment;
            model.UserId          = dbreservation.UserId;
            model.ResraurantId    = dbreservation.RestaurantId;
            model.Id = Id;
            UsersRepository rep = new UsersRepository();

            ViewBag.UserId = new SelectList(rep.GetAll(), "Id", "Name");
            RestaurantsRepository repository = new RestaurantsRepository();

            ViewBag.RestaurantId = new SelectList(repository.GetAll(), "Id", "Name");
            return(View(model));
        }