public ActionResult DeleteConfirmed(int id) { empDB empDB = db.empDBs.Find(id); db.empDBs.Remove(empDB); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] empDB empDB) { if (ModelState.IsValid) { db.Entry(empDB).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(empDB)); }
public ActionResult Create([Bind(Include = "Id,Name")] empDB empDB) { if (ModelState.IsValid) { db.empDBs.Add(empDB); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(empDB)); }
// GET: empDBs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } empDB empDB = db.empDBs.Find(id); if (empDB == null) { return(HttpNotFound()); } return(View(empDB)); }