public ActionResult Edit([Bind(Include = "Id,nonName")] NonWorksTable nonWorksTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nonWorksTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(nonWorksTable));
 }
        public ActionResult Create([Bind(Include = "Id,nonName")] NonWorksTable nonWorksTable)
        {
            if (ModelState.IsValid)
            {
                db.NonWorksTables.Add(nonWorksTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(nonWorksTable));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            foreach (var item in db.NonWorks.Where(x => x.NonId == id))
            {
                db.NonWorks.Remove(item);
            }
            NonWorksTable nonWorksTable = db.NonWorksTables.Find(id);

            db.NonWorksTables.Remove(nonWorksTable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: NonWorksTables/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NonWorksTable nonWorksTable = db.NonWorksTables.Find(id);

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