public async Task <IActionResult> Edit(int id, [Bind("SyllabusId,Level,DanceId")] Syllabus syllabus) { if (id != syllabus.SyllabusId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(syllabus); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SyllabusExists(syllabus.SyllabusId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["DanceId"] = new SelectList(_context.Dance, "DanceId", "DanceId", syllabus.DanceId); return(View(syllabus)); }
public async Task <IActionResult> Edit(int id, [Bind("DanceVideoId,Title,VideoUrl,Description")] DanceVideo danceVideo) { if (id != danceVideo.DanceVideoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(danceVideo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DanceVideoExists(danceVideo.DanceVideoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(danceVideo)); }
public async Task <IActionResult> Edit(int id, [Bind("DanceMoveId,Name,DanceVideoId,SyllabusId")] DanceMove danceMove) { if (id != danceMove.DanceMoveId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(danceMove); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DanceMoveExists(danceMove.DanceMoveId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SyllabusId"] = new SelectList(_context.Syllabus, "SyllabusId", "SyllabusId", danceMove.SyllabusId); ViewData["DanceVideoId"] = new SelectList(_context.DanceVideo, "DanceVideoId", "DanceVideoId", danceMove.DanceVideoId); return(View(danceMove)); }
public async Task <IActionResult> Edit(int id, [Bind("DanceId,Name,Speed")] Dance dance) { if (id != dance.DanceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dance); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DanceExists(dance.DanceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dance)); }