コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IdRol,IdOperaciones")] RolOperacion rolOperacion)
        {
            if (id != rolOperacion.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rolOperacion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RolOperacionExists(rolOperacion.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdOperaciones"] = new SelectList(_context.Operaciones, "Id", "Id", rolOperacion.IdOperaciones);
            ViewData["IdRol"]         = new SelectList(_context.Rol, "Id", "Id", rolOperacion.IdRol);
            return(View(rolOperacion));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,IdModulo")] Operaciones operaciones)
        {
            if (id != operaciones.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(operaciones);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OperacionesExists(operaciones.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdModulo"] = new SelectList(_context.Modulo, "Id", "Id", operaciones.IdModulo);
            return(View(operaciones));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre")] Modulo modulo)
        {
            if (id != modulo.Id)
            {
                return(NotFound());
            }

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