public ActionResult DeleteConfirmed(int id) { league_team league_team = db.league_team.Find(id); db.league_team.Remove(league_team); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "league_id,team_id,match_played,win,loss,ties,points")] league_team league_team) { if (ModelState.IsValid) { db.Entry(league_team).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.league_id = new SelectList(db.leagues, "league_id", "league_name", league_team.league_id); ViewBag.team_id = new SelectList(db.teams, "team_id", "team_name", league_team.team_id); return(View(league_team)); }
// GET: league_team/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } league_team league_team = db.league_team.Find(id); if (league_team == null) { return(HttpNotFound()); } return(View(league_team)); }
// GET: league_team/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } league_team league_team = db.league_team.Find(id); if (league_team == null) { return(HttpNotFound()); } ViewBag.league_id = new SelectList(db.leagues, "league_id", "league_name", league_team.league_id); ViewBag.team_id = new SelectList(db.teams, "team_id", "team_name", league_team.team_id); return(View(league_team)); }