public async Task <IActionResult> Edit(int id, [Bind("Id,film,Redatelj,Jezik,Opis,ŽanrId")] Film filmovi)
        {
            if (id != filmovi.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(filmovi);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FilmExists(filmovi.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ŽanrId"] = new SelectList(_context.Žanr, "Id", "Filmskižanr", filmovi.ŽanrId);
            return(View(filmovi));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Film,Izašao")] Vani vani)
        {
            if (id != vani.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vani);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VaniExists(vani.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vani));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Filmskižanr")] Žanr žanr)
        {
            if (id != žanr.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(žanr);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ŽanrExists(žanr.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(žanr));
        }