Пример #1
0
        /// <summary>
        /// Updates an existing folder.
        /// </summary>
        /// <param name="reader"></param>
        private void EditFolder(IDataReader reader)
        {
            FileTreeItem.UpdateFileItem(PageId, Name.Text, false, true, false, String.Empty, SiteId);

            // update folder access
            foreach (ListItem item in RolesList.Items)
            {
                if (item.Selected)
                {
                    using (IDataReader reader1 = FileTreeItem.PageAccessGetByRoleIdPageId(item.Value, PageId))
                    {
                        if (!reader1.Read())
                        {
                            FileTreeItem.AddPageAccess(item.Value, PageId);
                        }
                        reader1.Close();
                    }
                }
                else
                {
                    using (IDataReader reader2 = FileTreeItem.PageAccessGetByRoleIdPageId(item.Value, PageId))
                    {
                        if (reader2.Read())
                        {
                            FileTreeItem.DeletePageAccess((int)reader2["PageAccessId"]);
                        }
                        reader2.Close();
                    }
                }
            }
        }