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

            db.GoTours.Remove(goTour);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "TourId,FName,LName,Contact,EmailId,TourDate,TourTime,TourType,GTUserId")] GoTour goTour)
 {
     if (ModelState.IsValid)
     {
         db.Entry(goTour).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GTUserId = new SelectList(db.Students, "UserId", "Passwd", goTour.GTUserId);
     return(View(goTour));
 }
コード例 #3
0
        // GET: GoTour/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GoTour goTour = db.GoTours.Find(id);

            if (goTour == null)
            {
                return(HttpNotFound());
            }
            return(View(goTour));
        }
コード例 #4
0
        // GET: GoTour/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GoTour goTour = db.GoTours.Find(id);

            if (goTour == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GTUserId = new SelectList(db.Students, "UserId", "Passwd", goTour.GTUserId);
            return(View(goTour));
        }