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