Exemple #1
0
        /// <summary> Gets report rows. </summary>
        /// <param name="items"> The items. </param>
        /// <param name="options"> Options for controlling the operation. </param>
        /// <returns> The report rows. </returns>
        private List <ReportRow> GetReportRows(IEnumerable <BaseItem> items, List <ReportOptions <BaseItem> > options)
        {
            var rows = new List <ReportRow>();

            foreach (BaseItem item in items)
            {
                ReportRow rRow = GetRow(item);
                foreach (ReportOptions <BaseItem> option in options)
                {
                    object itemColumn = option.Column != null?option.Column(item, rRow) : "";

                    object itemId = option.ItemID != null?option.ItemID(item) : "";

                    ReportItem rItem = new ReportItem
                    {
                        Name = ReportHelper.ConvertToString(itemColumn, option.Header.HeaderFieldType),
                        Id   = ReportHelper.ConvertToString(itemId, ReportFieldType.Object)
                    };
                    rRow.Columns.Add(rItem);
                }

                rows.Add(rRow);
            }

            return(rows);
        }
Exemple #2
0
 private static void ExportToExcelRow(ReportResult reportResult,
                                      StringBuilder returnValue,
                                      ReportRow row)
 {
     returnValue.AppendLine("<tr>");
     returnValue.AppendLine(string.Join("", row.Columns.Select(s => string.Format("<td>{0}</td>", s.Name)).ToArray()));
     returnValue.AppendLine("</tr>");
 }
Exemple #3
0
        /// <summary> Gets a row. </summary>
        /// <param name="item"> The item. </param>
        /// <returns> The row. </returns>
        private ReportRow GetRow(ActivityLogEntry item)
        {
            ReportRow rRow = new ReportRow
            {
                Id     = item.Id,
                UserId = item.UserId
            };

            return(rRow);
        }
Exemple #4
0
        /// <summary> Gets a row. </summary>
        /// <param name="item"> The item. </param>
        /// <returns> The row. </returns>
        private ReportRow GetRow(BaseItem item)
        {
            var       hasTrailers        = item as IHasTrailers;
            var       hasSpecialFeatures = item as IHasSpecialFeatures;
            var       video = item as Video;
            ReportRow rRow  = new ReportRow
            {
                Id                   = item.Id.ToString("N"),
                HasLockData          = item.IsLocked,
                HasLocalTrailer      = hasTrailers != null?hasTrailers.GetTrailerIds().Count() > 0 : false,
                HasImageTagsPrimary  = item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Primary) > 0,
                HasImageTagsBackdrop = item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Backdrop) > 0,
                HasImageTagsLogo     = item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Logo) > 0,
                HasSpecials          = hasSpecialFeatures != null ? hasSpecialFeatures.SpecialFeatureIds.Length > 0 : false,
                HasSubtitles         = video != null ? video.HasSubtitles : false,
                RowType              = ReportHelper.GetRowType(item.GetClientTypeName())
            };

            return(rRow);
        }
Exemple #5
0
		private static void ExportToExcelRow(ReportResult reportResult,
			StringBuilder returnValue,
			ReportRow row)
		{
			returnValue.AppendLine("<tr>");
			returnValue.AppendLine(string.Join("", row.Columns.Select(s => string.Format("<td>{0}</td>", s.Name)).ToArray()));
			returnValue.AppendLine("</tr>");
		}
		/// <summary> Gets a row. </summary>
		/// <param name="item"> The item. </param>
		/// <returns> The row. </returns>
		private ReportRow GetRow(BaseItem item)
		{
			var hasTrailers = item as IHasTrailers;
			var hasSpecialFeatures = item as IHasSpecialFeatures;
			var video = item as Video;
			ReportRow rRow = new ReportRow
			{
				Id = item.Id.ToString("N"),
				HasLockData = item.IsLocked,
				IsUnidentified = item.IsUnidentified,
				HasLocalTrailer = hasTrailers != null ? hasTrailers.GetTrailerIds().Count() > 0 : false,
				HasImageTagsPrimary = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Primary) > 0),
				HasImageTagsBackdrop = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Backdrop) > 0),
				HasImageTagsLogo = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Logo) > 0),
				HasSpecials = hasSpecialFeatures != null ? hasSpecialFeatures.SpecialFeatureIds.Count > 0 : false,
				HasSubtitles = video != null ? video.HasSubtitles : false,
				RowType = ReportHelper.GetRowType(item.GetClientTypeName())
			};
			return rRow;
		}