public async Task <IActionResult> Edit(int id, [Bind("EventId,EventName,EventDate,StartTime,EndTime,Capacity")] Events events) { if (id != events.EventId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(events); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventsExists(events.EventId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(events)); }
public async Task <IActionResult> Edit(int id, [Bind("GameId,GameName,ListPrice,ContentRating,Genre,AvailablePlatforms,MaxPlayers")] Games games) { if (id != games.GameId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(games); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GamesExists(games.GameId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(games)); }
public async Task <IActionResult> Edit(int id, [Bind("MemberEventsId,EventId,MemberId")] MemberEvents memberEvents) { if (id != memberEvents.MemberEventsId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(memberEvents); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MemberEventsExists(memberEvents.MemberEventsId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["EventId"] = new SelectList(_context.Events, "EventId", "EventName", memberEvents.EventId); ViewData["MemberId"] = new SelectList(_context.Members, "MemberId", "MemberId", memberEvents.MemberId); return(View(memberEvents)); }
public async Task <IActionResult> Edit(string id, [Bind("MemberId,DisplayName,FirstName,LastName,Email,Password,Gender,BirthDate,ReceiveEmails,MailingAddressId,ShippingAddressId,CardType,CardNumber,CardExpires")] Members members) { if (id != members.MemberId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(members); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MembersExists(members.MemberId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(members)); }
public async Task <IActionResult> Edit(int id, [Bind("ReviewId,MemberId,GameId,GameReview")] GameReviews gameReviews) { if (id != gameReviews.ReviewId) { return(NotFound()); } if (ModelState.IsValid) { try { gameReviews.MemberId = HttpContext.Session.GetString("userId"); _context.Update(gameReviews); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GameReviewsExists(gameReviews.ReviewId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GameId"] = new SelectList(_context.Games, "GameId", "GameName", gameReviews.GameId); ViewData["MemberId"] = new SelectList(_context.Members, "MemberId", "MemberId", gameReviews.MemberId); return(View(gameReviews)); }
public async Task <IActionResult> Edit(int id, [Bind("LibraryGameId,MemberId,GameId")] GamesLibrary gamesLibrary) { if (id != gamesLibrary.LibraryGameId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gamesLibrary); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GamesLibraryExists(gamesLibrary.LibraryGameId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["GameId"] = new SelectList(_context.Games, "GameId", "AvailablePlatforms", gamesLibrary.GameId); ViewData["MemberId"] = new SelectList(_context.Members, "MemberId", "MemberId", gamesLibrary.MemberId); return(View(gamesLibrary)); }