Exemple #1
0
 public IActionResult Registrar(Categoria c)
 {
     if (ModelState.IsValid)
     {
         _context.Add(c);
         _context.SaveChanges();
         return(RedirectToAction("Registrar"));
     }
     return(View(c));
 }
        public IActionResult Registrar(Producto x)
        {
            ViewBag.Categorias = _context.Categorias.ToList();

            if (ModelState.IsValid)
            {
                _context.Add(x);
                _context.SaveChanges();
                return(RedirectToAction("Zapatilla"));
            }
            return(View(x));
        }
Exemple #3
0
        public IActionResult RegistrarUsu(RegistrarUsuario r)
        {
            if (ModelState.IsValid)
            {
                _context.Add(r);
                _context.SaveChanges();

                return(RedirectToAction("Mostrar"));
            }
            else
            {
                return(View(r));
            }
        }