public JsonResult PUser(int ID) { List <User> getAllUser = _provider.getAllUser(); User[] OwnPermission = _provider.GetAllUserOfGroupByID(ID); foreach (User item in getAllUser) { if (OwnPermission.Where(s => s.ID == item.ID).Count() == 1) { item.Checked = true; } } return(Json(new { success = true, content = ReflectionHelper.ArrayModelToArrObject(getAllUser.ToArray()) }, JsonRequestBehavior.AllowGet)); }
public JsonResult PPermission(int ID) { List <Permission> getAllPermission = _provider.getAllPermission(); Permission[] OwnPermission = _provider.GetAllPermissionsOfRoleByID(ID); foreach (Permission item in getAllPermission) { if (OwnPermission.Where(s => s.ID == item.ID).Count() == 1) { item.Checked = true; } } return(Json(new { success = true, content = ReflectionHelper.ArrayModelToArrObject(getAllPermission.OrderBy(g => g.Category).ToArray()) }, JsonRequestBehavior.AllowGet)); }