public ActionResult Edit([Bind(Include = "ID,Nome,Login,Senha,Email,Telefone")] Livro.Model.Admin admin) { if (Session["AdminID"] != null) { if (ModelState.IsValid) { _C.Alterar(admin); return(RedirectToAction("Cadastro")); } return(RedirectToAction("Cadastro")); } return(RedirectToAction("Index", "Home")); }
public ActionResult Delete(int?id) { if (Session["AdminID"] != null) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Livro.Model.Admin Admin = db.Admin.Find(id); if (Admin == null) { return(HttpNotFound()); } return(View(Admin)); } return(RedirectToAction("Index", "Home")); }
public ActionResult DeleteConfirmed(int id) { Livro.Model.Admin Admin = db.Admin.Find(id); _C.Excluir(Admin); return(RedirectToAction("Cadastro")); }