public ActionResult CheckPort(int port, int server) { try { var loggedUser = UsersUtilities.GetLoggedUser(); if (loggedUser == null) { return(Redirect("~/User/Login")); } ServerUtilities.CheckPort(loggedUser, loggedUser.Servers.Where(i => i.Id == server).FirstOrDefault(), port); return(Json(new { Port = port, Status = "Aberta" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { Port = port, Status = ex.Message }, JsonRequestBehavior.AllowGet)); } }