public async Task <IActionResult> Edit(int id, [Bind("IdParticipant,ParticipantName,IdRepresentedCity,IdParticipantType,ParticipantDate,Biography")] Participants participants) { if (id != participants.IdParticipant) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participants); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipantsExists(participants.IdParticipant)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdParticipantType"] = new SelectList(_context.ParticipantTypes, "IdParticipantType", "ParticipantType", participants.IdParticipantType); ViewData["IdRepresentedCity"] = new SelectList(_context.Cities, "IdCity", "CityName", participants.IdRepresentedCity); return(View(participants)); }
public async Task <IActionResult> Edit(int id, [Bind("IdParticipantType,ParticipantType")] ParticipantTypes participantTypes) { if (id != participantTypes.IdParticipantType) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participantTypes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipantTypesExists(participantTypes.IdParticipantType)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(participantTypes)); }
public async Task <IActionResult> Edit(int id, [Bind("IdParticipation,IdYearOfContest,IdParticipant,IdSong,IdNomination,Place")] Participations participations) { if (id != participations.IdParticipation) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participations); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipationsExists(participations.IdParticipation)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdNomination"] = new SelectList(_context.Nominations, "IdNomination", "NominationName", participations.IdNomination); ViewData["IdParticipant"] = new SelectList(_context.Participants, "IdParticipant", "ParticipantName", participations.IdParticipant); ViewData["IdSong"] = new SelectList(_context.Songs, "IdSong", "SongName", participations.IdSong); ViewData["IdYearOfContest"] = new SelectList(_context.Years, "IdYearOfContest", "YearOfContest", participations.IdYearOfContest); return(View(participations)); }
public async Task <IActionResult> Edit(int id, [Bind("IdYearOfContest,YearOfContest,IdHostCity,Slogan,Stage")] Years years) { if (id != years.IdYearOfContest) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(years); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!YearsExists(years.IdYearOfContest)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdHostCity"] = new SelectList(_context.Cities, "IdCity", "CityName", years.IdHostCity); return(View(years)); }
public async Task <IActionResult> Edit(int id, [Bind("IdSong,SongName,Duration")] Songs songs) { if (id != songs.IdSong) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(songs); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SongsExists(songs.IdSong)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(songs)); }
public async Task <IActionResult> Edit(int id, [Bind("IdNomination,NominationName")] Nominations nominations) { if (id != nominations.IdNomination) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(nominations); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NominationsExists(nominations.IdNomination)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(nominations)); }
public async Task <IActionResult> Edit(int id, [Bind("IdCity,CityName,Description")] Cities cities) { if (id != cities.IdCity) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cities); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CitiesExists(cities.IdCity)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cities)); }