示例#1
0
        protected void removeButton_OnClick(object sender, EventArgs e)
        {
            AreYouSureText.Text = "Something went wrong when trying to remove the user from the team";

            SPUser userToRemove = SPContext.Current.Web.WBxEnsureUserOrNull(LoginNameOfUserToRemove.Value);

            if (userToRemove == null)
            {
                return;
            }

            if (RoleToRemove.Value == "Owner")
            {
                team.RemoveOwner(SPContext.Current.Site, userToRemove);
            }
            else
            {
                team.RemoveMember(SPContext.Current.Site, userToRemove);
            }

            CloseDialogAndRefresh("?panel=TeamDetails");
        }