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

            db.theme_park.Remove(theme_park);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "theme_park_id,theme_park_name,park_open,park_close,park_country,park_state_or_province,park_city,park_street_address")] theme_park theme_park)
 {
     if (ModelState.IsValid)
     {
         db.Entry(theme_park).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(theme_park));
 }
コード例 #3
0
        // GET: ThemeParkAdmin/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            theme_park theme_park = db.theme_park.Find(id);

            if (theme_park == null)
            {
                return(HttpNotFound());
            }
            return(View(theme_park));
        }