Ejemplo n.º 1
0
 public ActionResult CambiarEstado(string id, string estado)
 {
     if (estado.Equals("habilitado"))
     {
         if (per.CambiarEstado(id, 0))
         {
             return(Json("true", JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json("false", JsonRequestBehavior.AllowGet));
         }
     }
     if (estado.Equals("deshabilitado"))
     {
         if (per.CambiarEstado(id, 1))
         {
             return(Json("true", JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json("false", JsonRequestBehavior.AllowGet));
         }
     }
     return(Json("false", JsonRequestBehavior.AllowGet));
 }