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

            db.HotelT.Remove(hotelT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "hotelid,hotelname,hotelcapacity,hoteltype,hotelprice,hotelphone,hoteladdress,countryid,tourid")] HotelT hotelT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hotelT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", hotelT.countryid);
     ViewBag.tourid    = new SelectList(db.TourT, "tourid", "tourname", hotelT.tourid);
     return(View(hotelT));
 }
コード例 #3
0
        // GET: HotelTs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HotelT hotelT = db.HotelT.Find(id);

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

            if (hotelT == null)
            {
                return(HttpNotFound());
            }
            ViewBag.countryid = new SelectList(db.CountryT, "countryid", "countryname", hotelT.countryid);
            ViewBag.tourid    = new SelectList(db.TourT, "tourid", "tourname", hotelT.tourid);
            return(View(hotelT));
        }