Beispiel #1
0
        public void GenerateFindingChangeLogReport(DefectChangeLogsTableFilterModelDto filter, Guid taskId)
        {
            DefectChangeLogQuery defectChangeLogQuery = _mapper.Map <DefectChangeLogQuery>(filter);

            var excelTemplate = HttpContext.Current.Server.MapPath("~/App_Data/DefectChangeLogsListReportTemplate.xltx");

            _reportGeneratorManagerService.GenerateFindingChangeLogReport(excelTemplate, defectChangeLogQuery, taskId);
        }
Beispiel #2
0
        public DefectChangeLogsTableDto GetAll(DefectChangeLogsTableFilterModelDto defecetChangeLogsTableFilter)
        {
            DefectChangeLogQuery defectChangeLogQuery = _mapper.Map <DefectChangeLogQuery>(defecetChangeLogsTableFilter);

            IPagedList <DefectChangeLog> defectChangeLog = _defectChangeLogService.GetDefectChangeLogs(defectChangeLogQuery);

            var groupedDefects = defectChangeLog.GroupBy(def => def.DefectId)
                                 .Select(deg => deg.OrderBy(def => def.DateModified).LastOrDefault());

            List <DefectChangeLogsTableRowDto> defectChangeLogsTableRowDtos =
                _mapper.Map <IEnumerable <DefectChangeLog>, IEnumerable <DefectChangeLogsTableRowDto> >(groupedDefects).ToList();

            return(new DefectChangeLogsTableDto
            {
                DefectChangeLogsTableRows = defectChangeLogsTableRowDtos,
                TotalDisplayedRecords = groupedDefects.Count(),
                TotalRecords = groupedDefects.Count()
            });
        }