コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TourT tourT = db.TourT.Find(id);

            db.TourT.Remove(tourT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        // 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));
        }