示例#1
0
        /// <summary>
        /// Delete Button Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RemoveMemberDeleteButton_Click(object sender, EventArgs e)
        {
            iFolder ifolder = null;

            // selected members
            try
            {
                foreach (DataGridItem item in iFolderData.Items)
                {
                    CheckBox checkBox = (CheckBox)item.FindControl("Select");

                    if (checkBox.Checked)
                    {
                        string id = item.Cells[0].Text;
                        ifolder = web.GetiFolder(id);

                        if (!ifolder.IsOwner)
                        {
                            string     ifolderLocation = web.GetiFolderLocation(id);
                            string     CurrentURL      = web.Url;
                            UriBuilder remoteurl       = new UriBuilder(ifolderLocation);
                            remoteurl.Path = (new Uri(web.Url)).PathAndQuery;
                            web.Url        = remoteurl.Uri.ToString();
                            web.RemoveMembership(id);
                            web.Url = CurrentURL;
                        }
                        else
                        {
                            web.DeleteiFolder(id);
                        }
                    }
                }
            }

            catch (SoapException ex)
            {
                if (ex.Message.IndexOf("readonly rights") != -1)
                {
                    Message.Text = GetString("GROUPACCESSEXCEPTION");
                    return;
                }

                if (!HandleException(ex))
                {
                    throw;
                }
            }

            Response.Redirect("iFolders.aspx");
        }
示例#2
0
        /// <summary>
        /// Delete Button Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            try
            {
                web.DeleteiFolder(ifolderID);

                Response.Redirect("iFolders.aspx");
            }
            catch (SoapException ex)
            {
                if (!HandleException(ex))
                {
                    throw;
                }
            }
        }