示例#1
0
        public virtual void ReloadData()
        {
            string   folderPathValue = this.folderPath.Value;
            BaseList list            = LoadDataSource();

            if (list != null)
            {
                documentsList.DataSource = list.GetItems(ItemsRetrievingOptions.DefaultOptions);
            }
            this.LabelSharepointSite.Text = this.GetBreadcrumbValue(folderPathValue);
        }
示例#2
0
        protected ObjectModel.Entities.Collections.ItemCollection GetSubItems([NotNull] BaseList list, [NotNull] IntegrationConfigData integrationConfigData)
        {
            Assert.ArgumentNotNull(list, "list");
            Assert.ArgumentNotNull(integrationConfigData, "integrationConfigData");

            var itemsOptions = new ItemsRetrievingOptions
            {
                Folder    = integrationConfigData.Folder,
                ViewName  = integrationConfigData.View,
                ItemLimit = integrationConfigData.ItemLimit
            };

            return(list.GetItems(itemsOptions));
        }
示例#3
0
        public static BaseItem GetItem([NotNull] string uniqueID, [NotNull] SpContext context, string viewName = null)
        {
            Assert.ArgumentNotNull(uniqueID, "uniqueID");
            Assert.ArgumentNotNull(context, "context");

            string[] values   = StringUtil.Split(uniqueID, '|', true);
            string   webUrl   = values[0];
            string   listName = values[1];
            string   id       = values[2];
            string   folder   = values[3];

            string wherePart = string.Format("<Eq><FieldRef Name=\"{0}\"/><Value Type=\"Integer\">{1}</Value></Eq>", "ID", id);
            var    itemsRetrievingOptions = new ItemsRetrievingOptions
            {
                WherePart = wherePart,
                ViewName  = viewName
            };

            if (!string.IsNullOrEmpty(folder))
            {
                itemsRetrievingOptions.Folder = folder;
            }

            BaseList       list  = BaseList.GetList(webUrl, listName, context);
            ItemCollection items = list.GetItems(itemsRetrievingOptions);

            if (items.Count == 1)
            {
                return(items[0]);
            }

            if (items.Count > 1)
            {
                throw new Exception("More than document has been found by ID");
            }

            throw new Exception("Document can't be found");
        }
        public override void ReloadData()
        {
            string folderPathValue = this.folderPath.Value;

            BaseList list = LoadDataSource();

            if (list != null)
            {
                var listSelected = from l in list.GetItems(ItemsRetrievingOptions.DefaultOptions)
                                   where ((AnnouncementItem)l).Expires >= DateTime.Today || ((AnnouncementItem)l).Expires == DateTime.MinValue
                                   select l;

                documentsList.DataSource = listSelected;
            }
            else
            {
                this.Visible = true;
                this.labelErrorMessage.Visible = true;
                this.labelErrorMessage.Text    = string.IsNullOrEmpty(this.ListName) ? UIMessages.PleaseSelectASharePointListFromTheSPIFControlProperties : UIMessages.ConnectionToSharePointServerFailedPleaseCheckYourSharePointServerConfigurationDetails;
            }

            this.LabelSharepointSite.Text = this.GetBreadcrumbValue(folderPathValue);
        }