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