예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("VisitRideId,VisitId,RideId,VisitRideRating,VisitRideComments")] VisitRide visitRide)
        {
            if (id != visitRide.VisitRideId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(visitRide);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VisitRideExists(visitRide.VisitRideId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RideId"]  = new SelectList(_context.Rides, "RideId", "RideId", visitRide.RideId);
            ViewData["VisitId"] = new SelectList(_context.Visits, "VisitId", "VisitId", visitRide.VisitId);
            return(View(visitRide));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ParkId,Name,Description,City,State,WebsiteLink,ParkMapLink")] Park park)
        {
            if (id != park.ParkId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(park);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ParkExists(park.ParkId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(park));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("RideId,Name,Description,Height,Length,TopSpeed,GForce,RideType,ThrillType,MaterialType,WebsiteLink,BuildDate,Manufacturer,ParkId")] Ride ride)
        {
            if (id != ride.RideId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ride);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RideExists(ride.RideId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ParkId"] = new SelectList(_context.Parks, "ParkId", "ParkId", ride.ParkId);
            return(View(ride));
        }