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