public async Task <IActionResult> Edit(int id, [Bind("PaginaId,Titel")] Pagina pagina)
        {
            if (id != pagina.PaginaId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pagina);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaginaExists(pagina.PaginaId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pagina));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ZoektermId,ActionId")] ZoektermAction zoektermAction)
        {
            if (id != zoektermAction.ZoektermId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(zoektermAction);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ZoektermActionExists(zoektermAction.ZoektermId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ActionId"]   = new SelectList(_context.Action, "Id", "Id", zoektermAction.ActionId);
            ViewData["ZoektermId"] = new SelectList(_context.Zoekterm, "Id", "Id", zoektermAction.ZoektermId);
            return(View(zoektermAction));
        }
示例#3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,PagAction,pagTitle")] Action action)
        {
            if (id != action.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(action);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ActionExists(action.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(action));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AnswerId,Question,Answer")] QenA qenA)
        {
            if (id != qenA.AnswerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(qenA);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!QenAExists(qenA.AnswerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(qenA));
        }
        public async Task <IActionResult> Edit(string id, [Bind("Naam,Openingsdag,Sluitingsdag,OpeningstijdMaandag,SluitingstijdMaandag,OpeningstijdDinsdag,SluitingstijdDinsdag,OpeningstijdWoensdag,SluitingstijdWoensdag,OpeningstijdDonderdag,SluitingstijdDonderdag,OpeningstijdVrijdag,SluitingstijdVrijdag,OpeningstijdZaterdag,SluitingstijdZaterdag,OpeningstijdZondag,SluitingstijdZondag")] Park park)
        {
            if (id != park.Naam)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(park);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ParkExists(park.Naam))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(park));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ContentId,Titel,Tekst")] Content content)
        {
            if (id != content.ContentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(content);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContentExists(content.ContentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(content));
        }
示例#7
0
        public async Task <IActionResult> Edit(int id, [Bind("AdminId,Username,FirstName,MiddleName,LastName")] Admin admin)
        {
            if (id != admin.AdminId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(admin);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AdminExists(admin.AdminId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(admin));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,ZoektermString")] Zoekterm zoekterm)
        {
            if (id != zoekterm.Id)
            {
                return(NotFound());
            }

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