public ActionResult DeleteConfirmed(int id) { TouristCompetitionInfo touristCompetitionInfo = db.TouristCompetitionInfoes.Find(id); db.TouristCompetitionInfoes.Remove(touristCompetitionInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TouristId,CompetitionId")] TouristCompetitionInfo touristCompetitionInfo) { if (ModelState.IsValid) { db.Entry(touristCompetitionInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompetitionId = new SelectList(db.Competitions, "Id", "Description", touristCompetitionInfo.CompetitionId); ViewBag.TouristId = new SelectList(db.Tourists, "Id", "Name", touristCompetitionInfo.TouristId); return(View(touristCompetitionInfo)); }
// GET: TouristCompetitionInfoes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TouristCompetitionInfo touristCompetitionInfo = db.TouristCompetitionInfoes.Find(id); if (touristCompetitionInfo == null) { return(HttpNotFound()); } return(View(touristCompetitionInfo)); }
// GET: TouristCompetitionInfoes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TouristCompetitionInfo touristCompetitionInfo = db.TouristCompetitionInfoes.Find(id); if (touristCompetitionInfo == null) { return(HttpNotFound()); } ViewBag.CompetitionId = new SelectList(db.Competitions, "Id", "Description", touristCompetitionInfo.CompetitionId); ViewBag.TouristId = new SelectList(db.Tourists, "Id", "Name", touristCompetitionInfo.TouristId); return(View(touristCompetitionInfo)); }