public async Task <IActionResult> PutEvento([FromRoute] int id, [FromBody] Evento evento) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != evento.id) { return(BadRequest()); } _context.Entry(evento).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventoExiste(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "ID,Nombre,Apellido,Dni,Fechanacimiento,Telefono,Enfermedad,Alergia,Sexo,ParroquiaID")] Persona persona) { if (ModelState.IsValid) { db.Entry(persona).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(persona)); }
public ActionResult Edit(Evento evento) { if (ModelState.IsValid) { db.Entry(evento).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(evento)); }
public ActionResult Editar([Bind(Include = "Id,Titulo,DataInicial,DataFinal,Cor")] Evento evento) { if (ModelState.IsValid) { db.Entry(evento).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(evento)); }
public ActionResult Edit([Bind(Include = "ParroquiaID,Nombre")] Parroquia parroquia) { if (ModelState.IsValid) { db.Entry(parroquia).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(parroquia)); }
public ActionResult Edit([Bind(Include = "ParticipanteID,EventoID,PersonaID,Puesto,Observacion,Autobus,Pagado,Documentacion")] Participante participante) { if (ModelState.IsValid) { db.Entry(participante).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { eventoID = participante.EventoID })); } ViewBag.EventoID = new SelectList(db.Eventos, "ID", "Nombre", participante.EventoID); ViewBag.PersonaID = new SelectList(db.Personas, "ID", "Nombre", participante.PersonaID); return(View(participante)); }
public async Task <ActionResult> PutEvento(long id, Evento evento) { if (id != evento.Id) { return(BadRequest()); } _context.Entry(evento).State = EntityState.Modified; await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetEvento), new { id = evento.Id }, evento)); }