Exemplo 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;
        }
Exemplo n.º 2
0
        void btnNew_Click(object sender, RoutedEventArgs e)
        {
            if (uiUsers.SelectedValue != null && Guid.Parse(uiUsers.SelectedValue.ToString()) != Guid.Empty)
            {
                OneUserRoleAuth control = new OneUserRoleAuth();
                control.UserRoleAuthData        = new UserRoleAuth();
                control.UserRoleAuthData.UserId = Guid.Parse(uiUsers.SelectedValue.ToString());
                control.AspRoles   = _aspRoles;
                control.AspUsers   = _aspUsers;
                control.SiteGroups = _siteGroup;
                control.IsUserView = true;

                control.RebindCombobox();
                control.DeleteButtonClicked += new EventHandler(control_DeleteButtonClicked);
                uiUserRoleAuthList.Items.Add(control);
            }
        }
Exemplo n.º 3
0
        void control_DeleteButtonClicked(object sender, EventArgs e)
        {
            MessageBoxResult result = MessageBox.Show(ResourceHelper.GetReourceValue("Common_ConfirmDeleteNoParam"), ResourceHelper.GetReourceValue("Common_ConfirmationRequired"), MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                OneUserRoleAuth deletedItem = sender as OneUserRoleAuth;
                if (deletedItem != null)
                {
                    if (deletedItem.UserRoleAuthData != null && deletedItem.UserRoleAuthData.UserRoleAuthId > 0)
                    {
                        deletedItem.UserRoleAuthData.IsDeleted = true;
                        _deleteList.Add(deletedItem.UserRoleAuthData);
                    }
                    uiUserRoleAuthList.Items.Remove(deletedItem);
                }
            }
        }
        void btnNew_Click(object sender, RoutedEventArgs e)
        {
            if (uiUsers.SelectedValue != null && Guid.Parse(uiUsers.SelectedValue.ToString()) != Guid.Empty)
            {
                OneUserRoleAuth control = new OneUserRoleAuth();
                control.UserRoleAuthData = new UserRoleAuth();
                control.UserRoleAuthData.UserId = Guid.Parse(uiUsers.SelectedValue.ToString());
                control.AspRoles = _aspRoles;
                control.AspUsers = _aspUsers;
                control.SiteGroups = _siteGroup;
                control.IsUserView = true;

                control.RebindCombobox();
                control.DeleteButtonClicked += new EventHandler(control_DeleteButtonClicked);
                uiUserRoleAuthList.Items.Add(control);
            }
        }
        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;
        }