Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            yard yard = db.yards.Find(id);

            db.yards.Remove(yard);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,yardName")] yard yard)
 {
     if (ModelState.IsValid)
     {
         db.Entry(yard).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(yard));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Id,yardName")] yard yard)
        {
            if (ModelState.IsValid)
            {
                db.yards.Add(yard);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(yard));
        }
Esempio n. 4
0
        // GET: yards/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            yard yard = db.yards.Find(id);

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