Ejemplo n.º 1
0
        void ListUserRoleAuthCompleted(List <UserRoleAuth> userRoleAuthList)
        {
            uiUserRoleAuthList.Items.Clear();
            //userRoleAuthList = (from u in userRoleAuthList
            //                    join role in _aspRoles on u.RoleId equals role.RoleId
            //                    select u).ToList();
            userRoleAuthList = userRoleAuthList.Take(_nbrItemsShowed).ToList();

            foreach (UserRoleAuth dataItem in userRoleAuthList)
            {
                OneUserRoleAuth control = new OneUserRoleAuth();
                control.UserRoleAuthData = dataItem;
                control.AspRoles         = _aspRoles;
                control.AspUsers         = _aspUsers;
                control.SiteGroups       = _siteGroup;
                control.IsUserView       = true;
                control.RebindCombobox();
                control.DeleteButtonClicked += new EventHandler(control_DeleteButtonClicked);
                uiUserRoleAuthList.Items.Add(control);
            }

            _roleComponentItemSource.Clear();
            var roleList = (from i in userRoleAuthList
                            select i.RoleId).Distinct();

            _roleCount = roleList.Count();
            foreach (Guid roleId in roleList)
            {
                DataServiceHelper.ListRoleComponentPermissionAsync(roleId, null, ListRoleComponentCompleted);
            }

            Globals.IsBusy = false;
        }
 void RebindRoleComponentData()
 {
     if (uiRoles.SelectedValue != null)
     {
         Globals.IsBusy = true;
         Guid roleId = (Guid)uiRoles.SelectedValue;
         DataServiceHelper.ListRoleComponentPermissionAsync(roleId, null, ListRoleComponentCompleted);
     }
 }