public JsonResult Role_hasname(string strid, string newrolename) { string oldname = ""; if (strid != "") { int id = int.Parse(strid); oldname = dbDrive.FindRole(id).rolename; } if (oldname.Equals(newrolename)) { return(Json(true)); } List <Role> roleList = dbDrive.AccurateQueryRoles(newrolename); if (roleList != null && roleList.Count > 0) { return(Json(false)); } return(Json(true)); }