public async Task <IActionResult> Edit(int id, [Bind("BandID,EventID,EventName,EDate,ImageUrl,Opis")] Event @event) { if (id != @event.EventID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(@event); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventExists(@event.EventID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(@event)); }
public async Task <IActionResult> Edit(int id, [Bind("BandName,Music")] Band band) { if (id != band.BandID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(band); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BandExists(band.BandID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(band)); }
public async Task <IActionResult> Edit(int id, [Bind("ReservationID,UserID,EventID,ReservationDate,EventDate,EventName,UserNick")] Reservation reservation) { if (id != reservation.ReservationID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reservation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReservationExists(reservation.ReservationID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reservation)); }
public async Task <IActionResult> Edit(int id, [Bind("UserID,Nick,UserSurname,UserName,Member,Music")] User user) { if (id != user.UserID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.UserID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task<IActionResult> Edit(int id, [Bind("MediaID,EventID,MediaDate,Url,ImageName")] Media media) { if (id != media.MediaID) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(media); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MediaExists(media.MediaID)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } ViewData["EventID"] = new SelectList(_context.Events, "EventID", "EventID", media.EventID); return View(media); }