public async Task <IActionResult> Create([Bind("GenreID,Genre")] FilmGenre filmGenre) { if (ModelState.IsValid) { _context.Add(filmGenre); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(filmGenre)); }
public async Task <IActionResult> Create([Bind("CertificateID,CertificateName")] Certificate certificate) { if (ModelState.IsValid) { _context.Add(certificate); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(certificate)); }
public async Task <IActionResult> Create([Bind("ActorID,ActorFullName,ActorNotes")] Actor actor) { if (ModelState.IsValid) { _context.Add(actor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(actor)); }
public async Task <IActionResult> Create([Bind("RoleID,RolName")] Role role) { if (ModelState.IsValid) { _context.Add(role); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(role)); }
public async Task <IActionResult> Create([Bind("ProducerID,ProducerName,ProducerEmail,ProducerWeb")] Producer producer) { if (ModelState.IsValid) { _context.Add(producer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(producer)); }
public async Task <IActionResult> Create([Bind("ProducerID,FilmTitleID")] FilmTitlesProducer filmTitlesProducer) { if (ModelState.IsValid) { _context.Add(filmTitlesProducer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["FilmTitleID"] = new SelectList(_context.FilmTitles, "FilmTitleID", "FilmTitles", filmTitlesProducer.FilmTitleID); ViewData["ProducerID"] = new SelectList(_context.Producers, "ProducerID", "ProducerName", filmTitlesProducer.ProducerID); return(View(filmTitlesProducer)); }
public async Task <IActionResult> Create([Bind("FilmTitleID,GenreID,CertificateID,FilmName,FilmStory,FilmReleaseDate,FilmDuration,FilmAdditionalInfo")] FilmTitle filmTitle) { if (ModelState.IsValid) { _context.Add(filmTitle); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CertificateID"] = new SelectList(_context.Certificate, "CertificateID", "CertificateName", filmTitle.CertificateID); ViewData["GenreID"] = new SelectList(_context.Genre, "GenreID", "GenreName", filmTitle.GenreID); return(View(filmTitle)); }
public async Task <IActionResult> Create([Bind("FilmTitleID,ActorID,RoleTypeID,CharacterName,CharacterDescription")] FilmsActorRol filmsActorRol) { if (ModelState.IsValid) { _context.Add(filmsActorRol); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ActorID"] = new SelectList(_context.Actors, "ActorID", "ActorFullName", filmsActorRol.ActorID); ViewData["FilmTitleID"] = new SelectList(_context.FilmTitles, "FilmTitleID", "FilmAdditionalInfo", filmsActorRol.FilmTitleID); ViewData["RoleTypeID"] = new SelectList(_context.RoleTypes, "RoleTypeID", "RoleTypes", filmsActorRol.RoleTypeID); return(View(filmsActorRol)); }