Ejemplo n.º 1
0
        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);
        }