public ActionResult DeleteConfirmed(int id)
        {
            BodyFragmentDB bodyFragment = db.BodyFragmentDB.Find(id);

            db.BodyFragmentDB.Remove(bodyFragment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,RollingID,Name,Designation")] BodyFragmentDB bodyFragment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bodyFragment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RollingID = new SelectList(db.RollingDB, "ID", "Name", bodyFragment.RollingID);
     return(View(bodyFragment));
 }
        public ActionResult Create([Bind(Include = "RollingID,Name,Designation")] BodyFragmentDB bodyFragment)
        {
            if (ModelState.IsValid)
            {
                bodyFragment.ID = db.BodyFragmentDB.ToList().Last().ID + 1;
                db.BodyFragmentDB.Add(bodyFragment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.RollingID = new SelectList(db.RollingDB, "ID", "Name", bodyFragment.RollingID);
            return(View(bodyFragment));
        }
        // GET: BodyFragmentDB/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BodyFragmentDB bodyFragmentDB = db.BodyFragmentDB.Find(id);

            if (bodyFragmentDB == null)
            {
                return(HttpNotFound());
            }
            return(View(bodyFragmentDB));
        }
        // GET: BodyFragmentDB/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BodyFragmentDB bodyFragment = db.BodyFragmentDB.Find(id);

            if (bodyFragment == null)
            {
                return(HttpNotFound());
            }
            ViewBag.RollingID = new SelectList(db.RollingDB, "ID", "Name", bodyFragment.RollingID);
            return(View(bodyFragment));
        }