public IHttpActionResult PutCat_Jugador(int id, Cat_Jugador cat_Jugador) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cat_Jugador.id) { return(BadRequest()); } db.Entry(cat_Jugador).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Cat_JugadorExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { Cat_Jugador cat_Jugador = db.Cat_Jugador.Find(id); db.Cat_Jugador.Remove(cat_Jugador); db.SaveChanges(); return(RedirectToAction("Index")); }
public IHttpActionResult GetCat_Jugador(int id) { Cat_Jugador cat_Jugador = db.Cat_Jugador.Find(id); if (cat_Jugador == null) { return(NotFound()); } return(Ok(cat_Jugador)); }
public ActionResult Edit([Bind(Include = "id,primer_nombre,segundo_nombre,primer_apellido,segundo_apellido,fec_nacimiento,fec_registro,dorsal,equipo")] Cat_Jugador cat_Jugador) { if (ModelState.IsValid) { db.Entry(cat_Jugador).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.equipo = new SelectList(db.Cat_Equipo, "id", "nombre", cat_Jugador.equipo); return(View(cat_Jugador)); }
public IHttpActionResult PostCat_Jugador(Cat_Jugador cat_Jugador) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Cat_Jugador.Add(cat_Jugador); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = cat_Jugador.id }, cat_Jugador)); }
public IHttpActionResult DeleteCat_Jugador(int id) { Cat_Jugador cat_Jugador = db.Cat_Jugador.Find(id); if (cat_Jugador == null) { return(NotFound()); } db.Cat_Jugador.Remove(cat_Jugador); db.SaveChanges(); return(Ok(cat_Jugador)); }
// GET: Jugadores/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cat_Jugador cat_Jugador = db.Cat_Jugador.Find(id); if (cat_Jugador == null) { return(HttpNotFound()); } return(View(cat_Jugador)); }
// GET: Jugadores/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cat_Jugador cat_Jugador = db.Cat_Jugador.Find(id); if (cat_Jugador == null) { return(HttpNotFound()); } ViewBag.equipo = new SelectList(db.Cat_Equipo, "id", "nombre", cat_Jugador.equipo); return(View(cat_Jugador)); }