Exemplo n.º 1
0
        public object Get(GetActivityLogs request)
        {
            DateTime?minDate = string.IsNullOrWhiteSpace(request.MinDate) ?
                               (DateTime?)null :
                               DateTime.Parse(request.MinDate, null, DateTimeStyles.RoundtripKind).ToUniversalTime();

            var result = _activityManager.GetActivityLogEntries(minDate, request.StartIndex, request.Limit);

            return(ToOptimizedResult(result));
        }
Exemplo n.º 2
0
        /// <summary> Gets report activities. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> The report activities. </returns>
        private ReportResult GetReportActivities(IReportsDownload request)
        {
            DateTime?minDate = string.IsNullOrWhiteSpace(request.MinDate) ?
                               (DateTime?)null :
                               DateTime.Parse(request.MinDate, null, DateTimeStyles.RoundtripKind).ToUniversalTime();

            QueryResult <ActivityLogEntry> queryResult;

            if (request.HasQueryLimit)
            {
                queryResult = _activityManager.GetActivityLogEntries(minDate, request.StartIndex, request.Limit);
            }
            else
            {
                queryResult = _activityManager.GetActivityLogEntries(minDate, request.StartIndex, null);
            }
            //var queryResult = _activityManager.GetActivityLogEntries(minDate, request.StartIndex, request.Limit);

            ReportActivitiesBuilder builder = new ReportActivitiesBuilder(_libraryManager, _userManager);
            var result = builder.GetResult(queryResult, request);

            result.TotalRecordCount = queryResult.TotalRecordCount;
            return(result);
        }