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

            db.DoInFlights.Remove(doInFlight);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "DoInFlightID,Name")] DoInFlight doInFlight)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doInFlight).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(doInFlight));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "DoInFlightID,Name")] DoInFlight doInFlight)
        {
            if (ModelState.IsValid)
            {
                db.DoInFlights.Add(doInFlight);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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