Beispiel #1
0
        public static List <SiteFolder> GetBySite(Guid siteGuid)
        {
            List <SiteFolder> siteFolderList
                = new List <SiteFolder>();

            using (IDataReader reader = DBSiteFolder.GetBySite(siteGuid))
            {
                while (reader.Read())
                {
                    SiteFolder siteFolder = new SiteFolder();
                    siteFolder.guid       = new Guid(reader["Guid"].ToString());
                    siteFolder.siteGuid   = new Guid(reader["SiteGuid"].ToString());
                    siteFolder.folderName = reader["FolderName"].ToString();
                    siteFolderList.Add(siteFolder);
                }
            }

            return(siteFolderList);
        }
        void btnAddFolder_Click(object sender, EventArgs e)
        {
            lblFolderMessage.Text = string.Empty;

            if (txtFolderName.Text.Length > 0)
            {
                if (SiteFolder.Exists(txtFolderName.Text))
                {
                    lblFolderMessage.Text = Resource.SiteSettingsFolderNameAlreadyInUseWarning;
                    return;
                }

                if (!SiteFolder.IsAllowedFolder(txtFolderName.Text))
                {
                    lblFolderMessage.Text = Resource.SiteSettingsFolderNameNotAllowedWarning;
                    return;
                }

                if (SiteFolder.HasInvalidChars(txtFolderName.Text))
                {
                    lblFolderMessage.Text = Resource.SiteSettingsFolderNameInvalidCharsWarning;
                    return;
                }

                SiteFolder siteFolder = new SiteFolder();
                siteFolder.SiteGuid = selectedSite.SiteGuid;
                siteFolder.FolderName = txtFolderName.Text;
                siteFolder.Save();

                PopulateFolderList();
                upFolderNames.Update();

            }
            else
            {
                lblFolderMessage.Text = Resource.SiteSettingsFolderNameBlankWarning;
            }
        }
Beispiel #3
0
        public static List<SiteFolder> GetBySite(Guid siteGuid)
        {
            List<SiteFolder> siteFolderList
                = new List<SiteFolder>();

            using (IDataReader reader = DBSiteFolder.GetBySite(siteGuid))
            {
                while (reader.Read())
                {
                    SiteFolder siteFolder = new SiteFolder();
                    siteFolder.guid = new Guid(reader["Guid"].ToString());
                    siteFolder.siteGuid = new Guid(reader["SiteGuid"].ToString());
                    siteFolder.folderName = reader["FolderName"].ToString();
                    siteFolderList.Add(siteFolder);
                }
            }

            return siteFolderList;
        }
Beispiel #4
0
 public static int CompareByFolderName(SiteFolder siteFolder1, SiteFolder siteFolder2)
 {
     return siteFolder1.FolderName.CompareTo(siteFolder2.FolderName);
 }
Beispiel #5
0
 public static int CompareByFolderName(SiteFolder siteFolder1, SiteFolder siteFolder2)
 {
     return(siteFolder1.FolderName.CompareTo(siteFolder2.FolderName));
 }