public ActionResult DeleteConfirmed(int id) { TourT tourT = db.TourT.Find(id); db.TourT.Remove(tourT); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "tourid,tourname,tourprice,tourcapacity,startdate,finishdate,tourtypeid,countryid")] TourT tourT) { if (ModelState.IsValid) { db.Entry(tourT).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", tourT.countryid); ViewBag.tourtypeid = new SelectList(db.TourtypeT, "tourtypeid", "tourtypename", tourT.tourtypeid); return(View(tourT)); }
// GET: TourTs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TourT tourT = db.TourT.Find(id); if (tourT == null) { return(HttpNotFound()); } return(View(tourT)); }
// GET: TourTs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TourT tourT = db.TourT.Find(id); if (tourT == null) { return(HttpNotFound()); } ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", tourT.countryid); ViewBag.tourtypeid = new SelectList(db.TourtypeT, "tourtypeid", "tourtypename", tourT.tourtypeid); return(View(tourT)); }