public IActionResult Registrar(Categoria x) { if (ModelState.IsValid) { _context.Add(x); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
public async Task <IActionResult> Create([Bind("Id,Nombre,Descripcion,Cantidad")] Producto producto) { if (ModelState.IsValid) { _context.Add(producto); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(producto)); }
public IActionResult Registrar(Empleado e) { ViewBag.Empleados = _context.Empleados.ToList(); if (ModelState.IsValid) { _context.Add(e); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(e)); }
public IActionResult Registrar(Orden x) { ViewBag.Categorias = _context.Ordenes.ToList(); if (ModelState.IsValid) { _context.Add(x); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(x)); }
public IActionResult Registrar(Cliente c) { ViewBag.Clientes = _context.Clientes.ToList(); if (ModelState.IsValid) { _context.Add(c); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(c)); }