Beispiel #1
0
 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));
 }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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());
        }
Beispiel #4
0
 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));
 }