public async Task <IActionResult> Edit(int id, [Bind("FormId,FullName,AvailableAudienceSize")] Form form) { if (id != form.FormId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(form); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FormExists(form.FormId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(form)); }
public async Task <IActionResult> Edit(int id, [Bind("LocationId,Country,City,Capacity")] Location location) { if (id != location.LocationId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(location); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocationExists(location.LocationId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(location)); }
public async Task <IActionResult> Edit(int id, [Bind("OrganizerId,FullName,RegistrationDate,Occupation")] Organizer organizer) { if (id != organizer.OrganizerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(organizer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrganizerExists(organizer.OrganizerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(organizer)); }
public async Task <IActionResult> Edit(int id, [Bind("WorkAndParticipantId,WorkId,ParticipantId")] WorksAndParticipant worksAndParticipant) { if (id != worksAndParticipant.WorkAndParticipantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(worksAndParticipant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorksAndParticipantExists(worksAndParticipant.WorkAndParticipantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ParticipantId"] = new SelectList(_context.Participants, "ParticipantId", "FullName", worksAndParticipant.ParticipantId); ViewData["WorkId"] = new SelectList(_context.Works, "WorkId", "Title", worksAndParticipant.WorkId); return(View(worksAndParticipant)); }
public async Task <IActionResult> Edit(int id, [Bind("ConferenceAndParticipantId,ParticipantId,ConferenceId")] ConferencesAndParticipant conferencesAndParticipant) { if (id != conferencesAndParticipant.ConferenceAndParticipantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(conferencesAndParticipant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConferencesAndParticipantExists(conferencesAndParticipant.ConferenceAndParticipantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ConferenceId"] = new SelectList(_context.Conferences, "ConferenceId", "Aim", conferencesAndParticipant.ConferenceId); ViewData["ParticipantId"] = new SelectList(_context.Participants, "ParticipantId", "FullName", conferencesAndParticipant.ParticipantId); return(View(conferencesAndParticipant)); }
public async Task <IActionResult> Edit(int id, [Bind("ConferenceId,Title,Aim,Topic,FormId,RequirementsForWorks,RequirementsForParticipants,Price,DateAndTime,OrganizerId,LocationId")] Conference conference) { if (id != conference.ConferenceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(conference); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConferenceExists(conference.ConferenceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FormId"] = new SelectList(_context.Forms, "FormId", "AvailableAudienceSize", conference.FormId); ViewData["LocationId"] = new SelectList(_context.Locations, "LocationId", "City", conference.LocationId); ViewData["OrganizerId"] = new SelectList(_context.Organizers, "OrganizerId", "FullName", conference.OrganizerId); return(View(conference)); }
public async Task <IActionResult> Edit(int id, [Bind("ParticipantId,FullName,BirthDate,RegistrationDate,Occupation,Institution")] Participant participant) { if (id != participant.ParticipantId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(participant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParticipantExists(participant.ParticipantId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(participant)); }
public async Task <IActionResult> Edit(int id, [Bind("WorkId,ParticipantId,Title,Topic,PublicationDate,ConferenceId")] Work work) { if (id != work.WorkId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(work); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkExists(work.WorkId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(work)); }