示例#1
0
 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"));
 }
示例#2
0
 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"));
 }
示例#3
0
 public ActionResult DeleteConfirmed(int id)
 {
     Livro.Model.Admin Admin = db.Admin.Find(id);
     _C.Excluir(Admin);
     return(RedirectToAction("Cadastro"));
 }