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