コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("GenreID,Genre")] FilmGenre filmGenre)
        {
            if (id != filmGenre.GenreID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(filmGenre);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilmGenreExists(filmGenre.GenreID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(filmGenre));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("CertificateID,CertificateName")] Certificate certificate)
        {
            if (id != certificate.CertificateID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(certificate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CertificateExists(certificate.CertificateID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(certificate));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ActorID,ActorFullName,ActorNotes")] Actor actor)
        {
            if (id != actor.ActorID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(actor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ActorExists(actor.ActorID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(actor));
        }
コード例 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ProducerID,FilmTitleID")] FilmTitlesProducer filmTitlesProducer)
        {
            if (id != filmTitlesProducer.ProducerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(filmTitlesProducer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilmTitlesProducerExists(filmTitlesProducer.ProducerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FilmTitleID"] = new SelectList(_context.FilmTitles, "FilmTitleID", "FilmAdditionalInfo", filmTitlesProducer.FilmTitleID);
            ViewData["ProducerID"]  = new SelectList(_context.Producers, "ProducerID", "ContactEmailAddress", filmTitlesProducer.ProducerID);
            return(View(filmTitlesProducer));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("ProducerID,ProducerName,ProducerEmail,ProducerWeb")] Producer producer)
        {
            if (id != producer.ProducerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(producer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProducerExists(producer.ProducerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(producer));
        }
コード例 #6
0
        public async Task <IActionResult> Edit(int id, [Bind("FilmTitleID,GenreID,CertificateID,FilmName,FilmStory,FilmReleaseDate,FilmDuration,FilmAdditionalInfo")] FilmTitle filmTitle)
        {
            if (id != filmTitle.FilmTitleID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(filmTitle);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilmTitleExists(filmTitle.FilmTitleID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
コード例 #7
0
        public async Task <IActionResult> Edit(int id, [Bind("FilmTitleID,ActorID,RoleTypeID,CharacterName,CharacterDescription")] FilmsActorRol filmsActorRol)
        {
            if (id != filmsActorRol.FilmTitleID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(filmsActorRol);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilmsActorRolExists(filmsActorRol.ActorID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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));
        }
コード例 #8
0
        public async Task <IActionResult> Edit(int id, [Bind("RoleTypeID,RoleTypes")] RoleType roleType)
        {
            if (id != roleType.RoleTypeID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(roleType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoleTypeExists(roleType.RoleTypeID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(roleType));
        }