public ActionResult DeleteConfirmed(int id) { Suspensoes suspensoes = db.Suspensoes.Find(id); suspensoes.Ativo = (OpcaoStatusSuspensoes)1; db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Nome,Ativo")] Suspensoes suspensoes) { if (ModelState.IsValid) { db.Entry(suspensoes).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(suspensoes)); }
public ActionResult Create([Bind(Include = "Id,Nome,Ativo")] Suspensoes suspensoes) { if (ModelState.IsValid) { db.Suspensoes.Add(suspensoes); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(suspensoes)); }
// GET: Suspensoes/Delete public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Suspensoes suspensoes = db.Suspensoes.Find(id); if (suspensoes == null) { return(HttpNotFound()); } return(View(suspensoes)); }