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)); }
public IActionResult RegistrarUsu(RegistrarUsuario r) { if (ModelState.IsValid) { _context.Add(r); _context.SaveChanges(); return(RedirectToAction("Mostrar")); } else { return(View(r)); } }