예제 #1
0
        public JsonResult PRole(int ID)
        {
            List <Role> getAllRole = _provider.getAllRole();

            Role[] OwnPermission = _provider.GetAllRoleOfGroupByID(ID);
            foreach (Role item in getAllRole)
            {
                if (OwnPermission.Where(s => s.ID == item.ID).Count() == 1)
                {
                    item.Checked = true;
                }
            }
            return(Json(new { success = true, content = ReflectionHelper.ArrayModelToArrObject(getAllRole.ToArray()) }, JsonRequestBehavior.AllowGet));
        }
 public void TcGetAllRoleOfGroupByID()
 {
     Assert.IsNotNull(_provider.GetAllRoleOfGroupByID(1));
     Assert.IsNull(_provider.GetAllRoleOfGroupByID(1000));
 }