Beispiel #1
0
        public Default(SPListItem spItem)
        {
            //base.GetSPListItemData(spItem);
            base.Init(spItem, Zeppelin.ShP.Helper.Enums.AttachmentsLoadMode.Short);
            SingleLineOfText = spItem.GetFieldStringValue(DefaultList.Fields.SingleLineOfText);
            Number = spItem.GetFieldDoubleValue(DefaultList.Fields.Number, 0);
            NumberDecimals = spItem.GetFieldDoubleValue(DefaultList.Fields.NumberDecimals, 0);
            MultipleLinesOfText = spItem.GetFieldStringValue(DefaultList.Fields.MultipleLinesOfText);
            MultiRichTextHTML = spItem.GetFieldStringValue(DefaultList.Fields.MultiRichTextHTML);
            PublishingHTML = spItem.GetFieldStringValue(DefaultList.Fields.PublishingHTML);

            Lookup = spItem.GetFieldLookupValue(DefaultList.Fields.Lookup);
            MultiLookupColumns = spItem.GetFieldMultiLookupValues(DefaultList.Fields.MultiLookupColumns);
            Boolean = spItem.GetFieldBooleanValueOrNull(DefaultList.Fields.Boolean);
            
        }
        public void GetSPListItemData(SPListItem spItem)
        {
            //base.Init(spItem, AttachmentsLoadMode.Short);
            ID = spItem.GetFieldIntValue(ListItemDefaultFields.ID);
            Title = spItem.GetFieldStringValue(ListItemDefaultFields.Title);
            GUID = spItem.GetFieldGuidValue(ListItemDefaultFields.GUID);
            Created = spItem.GetFieldDateTimeValue(ListItemDefaultFields.Created);
            CreatedBy = spItem.GetFieldUserValueOrEmpty(ListItemDefaultFields.CreatedBy);
            Modified = spItem.GetFieldDateTimeValue(ListItemDefaultFields.Modified);
            ModifiedBy = spItem.GetFieldUserValueOrEmpty(ListItemDefaultFields.ModifiedBy);
            ContentTypeId = Convert.ToString(spItem.ContentTypeId);
            ContentType = spItem.ContentType.Name;
            SPContentTypeCollection ctsParentList = spItem.ParentList.ContentTypes;
            foreach (SPContentType ct in ctsParentList)
            {
                UlsLogging.LogInformation("SPContentType Name: {0} Id: {1}", ct.Name, Convert.ToString(ct.Id));
                //ContentTypes.Add(ct.Name, Convert.ToString(ct.Id));
            }
            if (spItem.ModerationInformation != null)
            {
                ModerationStatus = spItem.ModerationInformation.Status;
                ModerationComments = Convert.ToString(spItem.ModerationInformation.Comment);
            }
            //ListID = spItem.ParentList.ID;
            //ListTitle = spItem.ParentList.Title;
            //WebID = spItem.Web.ID;
            //WebUrl = spItem.Web.Url;
            UIVersionString = spItem[ListItemDefaultFields.UIVersionString];

            OriginInfo OriginInfo = new OriginInfo();
            OriginInfo.GetData(spItem.ParentList);
        }
        /// <summary>
        /// Инизиализация базовых полей данных полей из SPListItem
        /// </summary>
        /// <param name="spItem">Элемент списка</param>
        protected void InitBaseFields(SPListItem spItem)
        {
            _id = spItem.ID;
            Title = spItem.Title;

            if (spItem.Fields.ContainsField(Constants.FieldNamesBaseTypes.DocIcon))
                this.ItemIcon = UrlHelper.GetFileIconUrl(spItem.GetFieldStringValue(Constants.FieldNamesBaseTypes.DocIcon));
            else
                this.ItemIcon = UrlHelper.GetFileIconUrl(null);
        }