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