Example #1
0
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task <object> Get(GetReportHeaders request)
        {
            if (string.IsNullOrEmpty(request.IncludeItemTypes))
            {
                return(null);
            }

            request.DisplayType = "Screen";
            ReportViewType reportViewType = ReportHelper.GetReportViewType(request.ReportView);

            List <ReportHeader> result = new List <ReportHeader>();

            switch (reportViewType)
            {
            case ReportViewType.ReportData:
                ReportBuilder dataBuilder = new ReportBuilder(_libraryManager);
                result = dataBuilder.GetHeaders(request);
                break;

            case ReportViewType.ReportStatistics:
                break;

            case ReportViewType.ReportActivities:
                ReportActivitiesBuilder activityBuilder = new ReportActivitiesBuilder(_libraryManager, _userManager);
                result = activityBuilder.GetHeaders(request);
                break;
            }

            return(ToOptimizedResult(result));
        }
Example #2
0
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task <object> Get(GetReportHeaders request)
        {
            if (string.IsNullOrEmpty(request.IncludeItemTypes))
            {
                return(null);
            }

            ReportViewType reportRowType = ReportHelper.GetRowType(request.IncludeItemTypes);
            ReportBuilder  reportBuilder = new ReportBuilder(_libraryManager);
            var            reportResult  = reportBuilder.GetReportHeaders(reportRowType, request);

            return(ToOptimizedResult(reportResult));
        }