public async Task <IActionResult> Edit(int id, [Bind("PuestodetrabajoID,Codigo,Descripcion")] Puestodetrabajo puestodetrabajo) { if (id != puestodetrabajo.PuestodetrabajoID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(puestodetrabajo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PuestodetrabajoExists(puestodetrabajo.PuestodetrabajoID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(puestodetrabajo)); }
public async Task <IActionResult> Create([Bind("PuestodetrabajoID,Codigo,Descripcion")] Puestodetrabajo puestodetrabajo) { if (ModelState.IsValid) { _context.Add(puestodetrabajo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(puestodetrabajo)); }