public ActionResult Edit([Bind(Include = "AsignaturaID,Asignatura")] Asignatura asignatura) { if (ModelState.IsValid) { db.Entry(asignatura).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(asignatura)); }
public ActionResult Edit([Bind(Include = "LibroID,Titulo,Autor,Edicion,Editora,Año")] Libro libro) { if (ModelState.IsValid) { db.Entry(libro).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(libro)); }
public async Task <IActionResult> Put(int id, LibroItem item) { if (id != item.Id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public ActionResult Edit([Bind(Include = "RegistroID,AsignaturaID,LibroID")] Registro registro) { if (ModelState.IsValid) { db.Entry(registro).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.AsignaturaID = new SelectList(db.Asignaturas, "AsignaturaID", "ASIGNATURA", registro.AsignaturaID); ViewBag.LibroID = new SelectList(db.Libros, "LibroID", "Titulo", registro.LibroID); return(View(registro)); }