public ActionResult DeleteConfirmed(string id) { Work_center work_center = db.Work_centers.Find(id); db.Work_centers.Remove(work_center); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "WorkcenterID,WorkcenterName")] Work_center work_center) { if (ModelState.IsValid) { db.Entry(work_center).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(work_center)); }
public ActionResult Create([Bind(Include = "WorkcenterID,WorkcenterName")] Work_center work_center) { if (ModelState.IsValid) { db.Work_centers.Add(work_center); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(work_center)); }
// GET: Work_Centers/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Work_center work_center = db.Work_centers.Find(id); if (work_center == null) { return(HttpNotFound()); } return(View(work_center)); }