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