Beispiel #1
0
        // JOEL JEFFERY 20110710
        /// <summary>
        /// Checks the folder exists.
        /// </summary>
        /// <param name="folder">The folder.</param>
        /// <param name="newFolderName">New name of the folder.</param>
        /// <returns></returns>
        public bool CheckFolderExists(ISPCFolder folder, string newFolderName)
        {
            //            EUListItem listItem = (EUListItem)item;
            EUFolder listFolder = (EUFolder)folder;

            return(SharePointManager.CheckFolderExists(listFolder.SiteSetting, listFolder.WebUrl, listFolder.ListName, listFolder.FolderPath, newFolderName));
        }
Beispiel #2
0
        /// <summary>
        /// Ensures the folder exists.
        /// </summary>
        /// <param name="folder">The folder.</param>
        /// <param name="destinationFolderUrl">The destination folder URL.</param>
        /// <param name="emailUploadFile">The email upload file.</param>
        /// <param name="fields">The fields.</param>
        /// <param name="fieldInformations">The field informations.</param>
        /// <param name="sharePointListViewControl">The share point list view control.</param>
        /// <returns>The url of the new folder.</returns>
        private string ensureFolderExists(EUFolder folder, string destinationFolderUrl, EUEmailUploadFile emailUploadFile, List <EUField> fields, EUFieldInformations fieldInformations, SharePointListViewControl sharePointListViewControl)
        {
            string newFolderName     = SharePointManager.MakeFileNameSafe(emailUploadFile.Subject + (emailUploadFile.SentOn.HasValue ? emailUploadFile.SentOn.Value.ToString(" yyyyddMM") : ""));
            string newDestinationUrl = destinationFolderUrl + "/" + newFolderName;

            if (!SharePointManager.CheckFolderExists(folder.SiteSetting, newDestinationUrl, folder.ListName, folder.FolderPath, newFolderName))
            {
                SharePointManager.CreateListFolder(folder.SiteSetting, folder.FolderPath, folder.WebUrl, folder.ListName, newFolderName);
            }
            // JOEL JEFFERY 20110712 - what the hell was I thinking?
            //folder.FolderPath = folder.FolderPath += "/" + newFolderName;
            return(newDestinationUrl);
        }