Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Artist,Album,Utgivning")] CDskivor cDskivor)
        {
            if (id != cDskivor.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cDskivor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CDskivorExists(cDskivor.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cDskivor));
        }
        public async Task <IActionResult> Edit(int id, [Bind("CDId,Title,ReleaseDate,Genre,RecordCompany,SongsAmount,ArtistId")] CD cD)
        {
            if (id != cD.CDId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cD);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CDExists(cD.CDId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArtistId"] = new SelectList(_context.Artist, "ArtistId", "ArtistName", cD.ArtistId);
            return(View(cD));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Author,ReleaseDate")] CD cD)
        {
            if (id != cD.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cD);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CDExists(cD.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cD));
        }
        public async Task <IActionResult> Edit(int id, [Bind("GlumacFilmID")] GlumacFilm glumacFilm)
        {
            if (id != glumacFilm.GlumacFilmID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(glumacFilm);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GlumacFilmExists(glumacFilm.GlumacFilmID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(glumacFilm));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ZanrID")] Zanr zanr)
        {
            if (id != zanr.ZanrID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(zanr);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ZanrExists(zanr.ZanrID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(zanr));
        }
        public async Task <IActionResult> Edit(int id, [Bind("KorisnikID,Ime,Prezime")] Korisnik korisnik)
        {
            if (id != korisnik.KorisnikID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(korisnik);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KorisnikExists(korisnik.KorisnikID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(korisnik));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ListaPregledanihID")] ListaPregledanih listaPregledanih)
        {
            if (id != listaPregledanih.ListaPregledanihID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(listaPregledanih);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ListaPregledanihExists(listaPregledanih.ListaPregledanihID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(listaPregledanih));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ArtistId,ArtistName,ArtistAge,NumberOfAlbums")] Artist artist)
        {
            if (id != artist.ArtistId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(artist);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ArtistExists(artist.ArtistId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(artist));
        }
        public async Task <IActionResult> Edit(int id, [Bind("PlacanjeID,Datum,brojkartice")] Placanje placanje)
        {
            if (id != placanje.PlacanjeID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(placanje);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PlacanjeExists(placanje.PlacanjeID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(placanje));
        }
Beispiel #10
0
        public async Task <IActionResult> Edit(int id, [Bind("FilmID,naziv,trajanje,ocjena,godinaFilma,brojOcjena,opisFilma,reziser,cijena,poster,link")] Film film)
        {
            if (id != film.FilmID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(film);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilmExists(film.FilmID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(film));
        }
Beispiel #11
0
        public async Task <IActionResult> Edit(int id, [Bind("UserId,UserName,BorrowingDate,CDId")] User user)
        {
            if (id != user.UserId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.UserId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CDId"] = new SelectList(_context.CD, "CDId", "Title", user.CDId);
            return(View(user));
        }