示例#1
0
        public ActionResult DeleteConfirmed(string id)
        {
            track_info track_info = db.track_info.Find(id);

            db.track_info.Remove(track_info);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "From_stn,To_stn,Track_route")] track_info track_info)
 {
     if (ModelState.IsValid)
     {
         db.Entry(track_info).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(track_info));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "From_stn,To_stn,Track_route")] track_info track_info)
        {
            if (ModelState.IsValid)
            {
                db.track_info.Add(track_info);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(track_info));
        }
示例#4
0
        // GET: track_info/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            track_info track_info = db.track_info.Find(id);

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