Example #1
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            if (shareList.SelectedItems.Count <= 0)
            {
                MessageBox.Show("请选择要停止共享的用户!", "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            foreach (ListViewItem item in shareList.SelectedItems)
            {
                try
                {
                    if (item.Tag is CUserEntity)
                    {
                        CUserEntity user = (CUserEntity)(item.Tag);
                        _currentUser.Deny(user.Usr_Id, ACLROLETYPE.USERROLE, _resourceId);
                    }
                    else if (item.Tag is CGroupEntity)
                    {
                        CGroupEntity group = (CGroupEntity)(item.Tag);
                        _currentUser.Deny(group.Grp_Id, ACLROLETYPE.GROUPROLE, _resourceId);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("无法共享:" + ex.Message, "文档管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            // refill user lists
            FillUserLists();
        }