public void TcUpdatePGroupUser() { List <User> listUser = _provider.getAllUser(); List <User> user = new List <User>(); listUser[0].Checked = true; listUser[1].Checked = true; user.Add(listUser[0]); user.Add(listUser[1]); Assert.AreEqual(_provider.updatePGroupUser(4, user.ToArray()), true); Assert.AreEqual(_provider.updatePGroupUser(1000, user.ToArray()), false); }
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)); }