예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Nombre")] Modulo modulo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(modulo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(modulo));
        }
        public async Task <IActionResult> Create([Bind("Id,Nombre,IdModulo")] Operaciones operaciones)
        {
            if (ModelState.IsValid)
            {
                _context.Add(operaciones);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdModulo"] = new SelectList(_context.Modulo, "Id", "Id", operaciones.IdModulo);
            return(View(operaciones));
        }
        public async Task <IActionResult> Create([Bind("Id,IdRol,IdOperaciones")] RolOperacion rolOperacion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rolOperacion);
                await _context.SaveChangesAsync();

                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));
        }