public async Task <IActionResult> Edit(int id, [Bind("CodJornada,Nombre")] TbJornadas tbJornadas) { if (id != tbJornadas.CodJornada) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tbJornadas); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbJornadasExists(tbJornadas.CodJornada)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tbJornadas)); }
public async Task <IActionResult> Create([Bind("CodJornada,Nombre")] TbJornadas tbJornadas) { if (ModelState.IsValid) { _context.Add(tbJornadas); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tbJornadas)); }